{"_id":"@mangata-finance/sdk","_rev":"320-7fa5bdd801c3c0070b4d49b30b3432c9","name":"@mangata-finance/sdk","description":"Mangata SDK","dist-tags":{"release/1.0.12":"1.1.0","rc":"2.1.1-rc.1","metamask-test":"2.1.2-metamask-test.0","rc-sdk":"2.2.0-rc-sdk.2","latest":"2.2.0","feature-rpc-method":"2.2.0-feature-rpc-method.2","rpc-types-generation":"2.2.1-rpc-types-generation.4","chore-update-ci-automation-types":"2.2.1-chore-update-ci-automation-types.2","feature-l2-side-withdraw":"2.2.1-feature-l2-side-withdraw.0","feature-metamask":"2.2.0-feature-metamask.4","feature-limit-number-of-executed-requests":"2.2.1-feature-limit-number-of-executed-requests.0","feature-rpc-verify-pending-requests":"2.2.1-feature-rpc-verify-pending-requests.2","refs-heads-feat-add-support-for-solochain-MGX-1001":"2.2.1-0","fix-rpc-verify-error":"2.2.1-fix-rpc-verify-error.1","feature-fix-ensure":"2.2.1-feature-fix-ensure.0","ci-eth-develop-solochain-workflow-updates-MGX-1001-2":"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6","feature-requests-blockhash":"2.2.1-feature-requests-blockhash.0","eth-rollup-develop-solo":"2.2.1-eth-rollup-develop-solo.3","ci-fix-fungible-envs-deployments-MGX-944":"2.2.1-ci-fix-fungible-envs-deployments-MGX-944.1","feat-raw-update":"2.2.1-feat-raw-update.4","feature-consider-withdrawal-resolutions":"2.2.1-feature-consider-withdrawal-resolutions.0","fix-storage-hasher":"2.2.1-fix-storage-hasher.0","eth-rollup-develop-solo-acc20":"2.2.1-eth-rollup-develop-solo-acc20.2","eth-rollup-develop-solo-seq-mod":"2.2.1-eth-rollup-develop-solo-seq-mod.3","revert-714-eth-rollup-develop-solo-seq-mod":"2.2.1-revert-714-eth-rollup-develop-solo-seq-mod.0","feature-fix-single-sequencer":"2.2.1-feature-fix-single-sequencer.0","feature-timestamp":"2.2.1-feature-timestamp.4","rollup-feature-stabilize-seq-rotation":"2.2.1-rollup-feature-stabilize-seq-rotation.0","feature-native-eth":"2.2.1-feature-native-eth.0","feature-fix-compose":"2.2.1-feature-fix-compose.0","feature-testnet-fixes":"2.2.1-feature-testnet-fixes.0","feature-isolated-testing-crowdloan":"2.2.1-feature-isolated-testing-crowdloan.4","feature-run-ci":"2.2.1-feature-run-ci.0","feature-fix-fail-liqId-maintenance":"2.2.1-feature-fix-fail-liqId-maintenance.0","feature-fix-typo":"2.2.1-feature-fix-typo.2","feature-seq-staking-unit-tests":"2.2.1-feature-seq-staking-unit-tests.0","fix-remove-eth-from-genesis":"2.2.1-fix-remove-eth-from-genesis.0","feature-debug-print-call-for-context":"2.2.1-feature-debug-print-call-for-context.0","feature-mtx-upd-seqgasless-bootstrap":"2.2.1-feature-mtx-upd-seqgasless-bootstrap.0","feature-rolldown-mm":"2.2.1-feature-rolldown-mm.1","feature-rolldown-counters":"2.2.1-feature-rolldown-counters.1","feat-chainspec-eigen":"2.2.1-feat-chainspec-eigen.10","feature-configurable-chain-id":"2.2.1-feature-configurable-chain-id.4","feature-rollup-testnet-alignment":"2.2.1-feature-rollup-testnet-alignment.0","feature-custom-prometheus-metrics":"2.2.1-feature-custom-prometheus-metrics.1","feature-ethereum-as-relaychain-for-crowdloans":"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.3","feature-remove-dummy-tokens":"2.2.1-feature-remove-dummy-tokens.3","ci-performance-test":"2.2.1-ci-performance-test.6","feature-eth-upd-tests-3rdPartyRewards":"2.2.1-feature-eth-upd-tests-3rdPartyRewards.0","feature-eth-upd-tests-parAutocompound":"2.2.1-feature-eth-upd-tests-parAutocompound.0","ci-rollup-wasm-generation-setup-MGX-1094":"2.2.1-ci-rollup-wasm-generation-setup-MGX-1094.0","feature-eth-upd-tests-poolLiq":"2.2.1-feature-eth-upd-tests-poolLiq.0","feature-multiple-l1":"2.2.1-feature-multiple-l1.14","eth-rollup-develop":"2.2.1-eth-rollup-develop.54","feature-mm-on-rollup":"2.2.1-feature-mm-on-rollup.1","feature-eth-upd-tests-parallel":"2.2.1-feature-eth-upd-tests-parallel.7"},"versions":{"1.0.0":{"name":"@mangata-finance/sdk","version":"1.0.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.0","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"186c6c65d5878a1069179b45d019863f83059c99","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.0.tgz","fileCount":7,"integrity":"sha512-Lp6BeE5uJJEc5ROGs7pQo8NzeTUiOhw8kNEbnN8HpNsOba3tR/5nBYBfrBfrj2TRG1S+fdIlb7Jlr5AYUuGfyw==","signatures":[{"sig":"MEYCIQC6S7JqMRVI7er4Ej8phGUU0MRtbKjZ+hW6ldhNRqDMyAIhALWOzQ/kSumG6gKvL0+t3a2Id+EZy0LNm4htZVlKgvp7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqI+bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqwIBAAmaa5rxA9nGb/OJb0URaO0D84Dsg+lgKcNxeSH8Z+Fa2UBcp2\r\nFlWG8GiAYxCKfnVFlCM56I8aldmKL17EvKZBqNSXB43AWlcWHlsaib99Z/98\r\nkD7k1bZmSJKLgaNskEfJCaZr/uJf1BSUCzILghaTg4+sHDa75lAHK16rTCp0\r\nDXWHDPOHO/o6ZXkLTcbTVq7PE4c4X3JWeJ3UHzZEQFx0jH4cA7VT8ySJHFoX\r\n+7NlWcZ6HEEPmBIqeSHWJ8UYChPIDpgPxjFgV6AEUjrmUKHn3W0DWzDXCmCV\r\nh3ztdR/aZbqtX8zeH+RqbSZSIP9qg0Nom0l/5NNN25USDY5U+QD5Cw1rSxzS\r\nXArNoLnZ0eoT23eEdbV87S9TIt0CcQhzh/XrGqLYdykmri1euuXjUA496LXv\r\ngGj7yXVzUORriTvwEHZ6TS8SBXcEqq7SAqlC97Kb5hnyO2lSKIsoUUHtBERb\r\nAJnUPQFTFM+sDizIbRr8BSa1mkShMej+DDXcOfQFGTGCYsy10Tm5HlJsK1wb\r\n0fuA4kskVZZ2m0WZcYfp4RCwBeGAYyzMtgzMp5iyTapqsjUSYiL7KolDks2e\r\ntieMhENv/AzFRf4tSBFP1jodfeYiewEsrtQ3IQvy/2yt42Ooq0Mef6FGMJ/k\r\nWISPAkBuCd1vzpPC811Gfiu3Hkc+YwSHSVw=\r\n=rOGG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.0_1655213979170_0.7507190451928145","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@mangata-finance/sdk","version":"1.0.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.1","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"7307c43bb96f5ee658f70cc5759777ac731d094a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.1.tgz","fileCount":7,"integrity":"sha512-r9KE6yYq55vPHE5NJHao8mIgyT7wq7T2IFNRRmT8ZripkW5XShA1mVTnBHA+5cj8/PbbypJcnwlxJkNN/yVypA==","signatures":[{"sig":"MEUCIQDfAjPdlW9YcbYfjxFKyJ8FfA55cAvWsuQqidVPTHZAiQIgeQoNDWJEU4BVc431KOM0L2exjIJ3zP+IRHcVAjWOZHk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170565,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqKfgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbsQ/8Cu/BTu6TAQiu+pjxYnIzTTxcWIb8VNtBj79Wj+fyQnSrccYZ\r\n5A8vbXgLh2mUWmw3J5Hk8+EhO1JtDVrzpsGUQIQ4jA5RK6WFgBuO+ZmlwPRp\r\nFKlfGrmAe2SyCLyyKBAxiuHEsfMkhYRZJw13xC1zaaloviJxYNhDwZ7wt1uE\r\nrmSX91i2vvS+GGJ/9cFqpX68lLPzEGP27iq6Wizy+ACyBSRNJPIOtSiU+7xp\r\nAXkRUpDXmdz8KIuvladHpufGbMr2U/GKqsJ8CaQ9M5QZqQpiFZk87HO7wgOo\r\nlkMqZlyycPcDe9eQEbNozfpzpRWzzAT6d5Bb7OFehi8jurRu/+fuZ0Z23sSV\r\nt1fytUaW2evxep+i+U4UweA4m9o2WgDNrQyj53AWS2MRGInzLM1T6xvY+zSk\r\nRJ8IhgFynmyFJHILqrP5VBl4H//EgOpD6Dyzfy/ByHvoenn8sJzTSXq1/hYd\r\nUersBfmmoQHVFPvQxdER5u31W01A7UqolukAVEpShHayii9RFrkP5F98JF1I\r\nhZuaMBzhyC9StlbPyRj6dlH/g8f5hmHf/zJzl2Wnt4iJy13X9VFs6ilkXEZe\r\ntlzFjfQUA1WxTJ6FhkTpopNDyUc/NlwlGPB6ldBnJoF/sXs+poITetoKooRk\r\n41SP27oppU5nWLU0tDpdVZ4BnFgl7xoR6lk=\r\n=Xv7J\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.1_1655220191995_0.3713679748196117","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@mangata-finance/sdk","version":"1.0.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.2","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"1ef2127e44742cc81588f1efce779718ecdd9074","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.2.tgz","fileCount":7,"integrity":"sha512-tlmcB86ry25W/iVNVwgH6JpO07RjXruJR8YmT+kgqyKdCI9iWzRIdvYToOvxCcP0I9BGJmhclHhaIKKQw8v3kQ==","signatures":[{"sig":"MEUCIQDmcArU6thc+Bi6hj1sdArytEzX5ZdKqFe2G/T/4w+J5AIgapRcQcmKcuEWWxKt2Lw+XfKZu1NQrRsk7cjplINCyVc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqVuCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQBw//adL6LmCLZp62yOF8nYxSkgyMh94Ea/cQHKzCSMKV1Sythjhq\r\nEApXZ0tRbndcIhGTGlNIgj6dvag0vEOY64xR96o0LdkGCM4KaZQbUruRDukr\r\nATJltLrY2KvxQbmlas86arxEQQtJ09OThc9GMiffS/yvY+kOdqJYyCplBXqm\r\n2uzssqiP0f7Z6VmO7nrv75n9SYktRm/HTIgZt4CT7TGhSsaaKcU+MbrzGA3w\r\nfmY1+cooFq7XeTXRvDjteEGVHDg0HAJK0VFZcqP3zCL8TgMm7CM+l9cQOhpY\r\nOH0aQ44GxzUth7NTWi9BNOPx+mlLC/9K9RscTvbbSuebhaQ5J2U/euH5y33f\r\nQJgTfxJm3JkUUcI/P4CsXFBRT0Rm+Dd0wvu+QP65THTerSFfrZ9FkMOYb/7C\r\nBCDnrtiyV2PYc4ibD/IWbx2iJNXWaXwQVqydTNq2F/SNqtcJOl/20MloLzNa\r\nXKZjgXnmpBCJdNA2Op3kZUy7tvrqrXqaySvQSFuQGDjV6Pqb8wVFdOTkIiCP\r\nfdegNnQH47RJmc/FGrUj/kqJhgd7xiRsdQPeDZPkseszZlgY5DamAkAkREEO\r\n7ZukouoRek3o4+5/6DOX3HXBCWQMtU/P1GrDBMm0C4W9KTeuCwQKPRruHM9k\r\nhPiAHs7Ac5U2zQBGHSD7b17+iwR407be90k=\r\n=JDSi\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.2_1655266178150_0.4976522490499353","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@mangata-finance/sdk","version":"1.0.3","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.3","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"ed32a167b19c7fe9c99ffbbef0f7313376e45c9a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.3.tgz","fileCount":7,"integrity":"sha512-TYo1zwbJZdHBrvdIwEyqJwYxbyqxfwuh+VTpl4LfOZCIVK/isqm4Is/TNG/wl+aIDMQ18LfhyLbpo+grJeNRCA==","signatures":[{"sig":"MEYCIQDih7YLcVVw/jqNd2Zu36Hp7i8OPOg3V9cC+TcUEAsJYAIhAJd4zHGmkn2rE3ndb5wzYl/FFyAWnb8kvhdGAzbn/jAp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170818,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqtY0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobDBAAkeVKHTjSK9zEb4GAG0/Q8TcfHUVH2NvrxB81wtvFwrwvf9Qf\r\nqSGaGa6XxhsCRQ1lTd04NpSbOKBc3XSF8yVf5NCB5eokVDmvpdaRl27Za3Q4\r\nIWlJtLobz2aIr0JnXf5e0+pg60sd0Jkyqnr8MvgwdeFz/AUbxz6a7M6o4N0V\r\nM+Yw4srBLmPw/xyKy6ZbvWM5vJDBdPtZQ2mMTFf729naxpo94Y9Dq1s0YVAf\r\nNEVbtYujfHJ3yo9VLYZ46DpFO9Ke43iOhZH2GaCbMewUY1mNRCKrON3+GGFI\r\nORibsKU36w3HI0tEclUO2Ysa2qEMrMmTGTUmjYiVZLlPT68Ati+J72w8WEJL\r\nLg9I7kVSvox6sEkAky7Py9qRppvdopx6bNvk19mwfrtbGGXaiq/SIAHQGgVz\r\nrI0ZtYvrDuDUIdoWzt0SBtxFqPnR2e6tt84yKB4Z+RXX4+C1jJS1Iqk3Y7lH\r\n1LapUGzLizlk+ljNpnkF2IjJdb6X0ADRuI4KMbtaYb3Whal2hww5S04pirAk\r\ns0nuDW/++gzjsjHe9c4o/3H4mO9PZWlCIRXYYUm3CGHfbpyXqJlPSUZOAM+N\r\nAc2v50xm/eDsE+5/2GPm+izqkV3Tnm/NhGnfyTe/kszaWZrKzlnGaz2NBE76\r\nnlRTjlk9w+Lgy+8TNyTt0BZV+int04dhaS0=\r\n=WhVR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.3_1655363124651_0.9852771239992988","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@mangata-finance/sdk","version":"1.0.4","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.4","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"c7a3dd303683116010947b6d034b7b4ff4607d02","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.4.tgz","fileCount":7,"integrity":"sha512-o4zykAF+wf99zJanvhVjc3l/tl4mtDy1yBUDYgDqq0xJs5eN2RJYgRI6iQrgJryC9suHDiEwmdHXnjZnR19Fng==","signatures":[{"sig":"MEQCIFS06vSgxO7Cbhk6bTELMk8ITrg2E2m//q7pmCVfAFUhAiAXGGgbt5grKbpVvmORtHcKqD4sfSPliT/ir+PQtN7UuQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":170928,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiqxY8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpVtxAAi/Wsl/agXZqK7S8vgUEYaXvJH+qb7F1yY7WuDQiA9Nm/a61g\r\nbjZcLlq9G7NOHZ8XtbKo5minLfeYWhaMdCwv5603VVqDtp/gsiVXmAUjmXsE\r\n/wO6x2gbID+RNc3FG9YuJd3m26Yk1/nNoRUPgDrYxMQL95lymLFwezGSx+Tm\r\nCRBjVOcQXTM8DrO+q7iKK9ma6qRBZcR89OMzAPWvk1bAWtHfHew3YYqspY/k\r\nrpowlmeGeSvFrABoZ1OnsBVUKrupUzQHS/kU1tY+J2K11c5nG/SkJOflIU1Z\r\nCYWNofJcs0v0aeY2QnFi688uCE8I1U7l2LH+TQWtQcUDZq5QG3JPUQjzBWym\r\n5kgeXNG3XOmoKc3dyc+zL73e6n2gNYHAfQx/8kmrItGTXls8fV7jrtxkPuSz\r\nUWBcVqPSbgTxbO5SNio+7jq3s68eFSrGBDKX36ENVHjH5gHdfKntdFzLoVew\r\nMGogauJ5P6Em09u/IScC93epmNlzM6sQ/G/oXXL56POf8aFs9eeozlSaQWYB\r\njUI/LEvRLl2sAZ4CI1IORCsqodE6zSXMrrUV1HCnSa5M7CU1/Sjq+A1Pu5Wu\r\nTPOTaARfmBo+M73zz6ZQPwP0FKZqWukhYHc/PE0T4kqzHsXQBr2uzQuxCBhg\r\nmuknakcloVGwZfGHO+pd2vvnStaLT0jptbw=\r\n=jfua\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.4.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.4_1655379515765_0.45122413184465815","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@mangata-finance/sdk","version":"1.0.5","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.5","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"1528a4bee5869ade4d3d44fdfd511d35bdf55e4a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.5.tgz","fileCount":7,"integrity":"sha512-8iwp2NPTOepjkDnmUlkqONd5L8OfyvPztxWWSqM9CneMQ2PKG0mT5X9dztkFx1AJ1Wdsa2zmCdZpXc8vdqDHXQ==","signatures":[{"sig":"MEUCIFF1Gm+rMvI/iPOnFPyTWnRhMPDS7ITRfJbQLjTdDnt2AiEA9ClWNvdhfLrO6aSl8UU0csq/77xGIcmOjiiQWd5Gvg4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":171649,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirIUJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmozvw/9GL9ywrbJNwoDFNdyX9dsLOyZb78YP7kE20sDyfunPoEKfjgW\r\nAI0WF4Lp24N60M699KEpo0eym4m8lqR/sKx/h6AGw/XE2Z9EVH1QLOvKQq0z\r\nrKtfBdcEDy9gvzFOCYOiX4MFdZ/MEoeHGMM8dZ6f1R58lygFiDzndnJ6n834\r\nPiI1yaJHOVw3wclgcJYLhgZkweJxgzq3QhQ/g5wKdsn3OMGwEIzH2C0tyOLq\r\nTK81EyF0ScgDlazeMP+tWZDt7EnEi/Gxe23cE72gqiBSjRNLJX19Btt0SK1R\r\nzIH2QC4f8TTUUVo7SfXe66qkkmm1ykhH9bUF+w4ruY7tsH7dEodJSP59k38N\r\nfnqXQ3r8r68PODhS1l/aJcx6rBdzj7+zmx6kYiFTtzcSHekxmKUpjGlWVe3l\r\njJ9Z4mhldk7RpgDFz523cHlHmvfxqpVaimmAT3HUuxglI/l8O0Rk3ILZ1ko5\r\ncYiitnqUWJNZdkzPvk3rzfqHz3RsitplWsUk9jt5rSpMQuRBfKtGkTAJN8X3\r\nWg7zRn1TxspvzD8bp3/ScbqwqsZzZrUgmm7vAlbcTsUFWMjmJvvjL0Ot6+/V\r\nh0Y1OT6MnQILO1+Ddu8aWNxe0jxMv1Sdyg+rQN7Avtf8JbDu7rgXlJBfrCGQ\r\nl6/G7L9nvtiYFKaaTlfAhSy2e/PAQN0iRw8=\r\n=faXW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.5_1655473416925_0.8664597326054617","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"@mangata-finance/sdk","version":"1.0.6","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.6","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"576ab66bee92323cae44d2f7833609c853ab925b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.6.tgz","fileCount":7,"integrity":"sha512-4R/albN+QEcb0tp/zxfImbIRnZggkG3s/YDFXH/Xp1qnSIay4FR/gEmC5HCYP0S/GNQgfuScfaRARsiOPOqxlg==","signatures":[{"sig":"MEQCIG95dHNI57HbWtTCWRCxDO8NSQTmHWJLJab7C1ClWXefAiA349tnOXTnVy71u3E9PPgnaqvYwz3tOpKLJDE8jBE1oA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":172069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJirx5xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4tw//bPFoOgV0oUzFmXUTz50ErOAsVr1XQU/1S/aToRbbhiNqY/Sn\r\nx4tc0hLDJRI4WGzw61DGmPRMSkv3LuCkqgCOSdLeyxf97jWJ12nfHMki6YUA\r\nHnCF5aJjoWLJ5qon2/tgk4dpBd0ZDaOL0YEEbGgod0ADIS+sTgfIb4nZQUYH\r\nUkSj0yM65J2uAUj+E7H37Rd/NLd6m5vdLZEdRIiq+BwudVQzmJezgx55+3xF\r\nh7wq0JISxtO/T6eVKt54/q4TBaAugdgx9xJKrKVtBSMJ6ULbDpIJiY1KlS7l\r\n+Y1AD0g5WsrRDnjg0JGs57cOvC/wCNst8nlQ7TBVeEYfAriL0G7tibmBA5OU\r\nJVI2+ZTgWmLjvvxpQ78Qvrb3XhlO+TEtzzxbC8shMmwFwzQ5dLdCL+4MyRHt\r\npC5IbQEb0G/1EcGwMzMG2AUD3eeGMW48o5P+u8hnJPC9gYc/gNKabMHWUG4m\r\nFWpJjSmMVO9AkNEA+6NgXj4rhyIQ5pvGZAxZdm8221b2EK29ROGFd6hYDgXW\r\n5xMarliVeUgMyULre56NqPR1EHGiF1CHFkK4KQFeuVur5FZj/U75XBFdgcf9\r\nfJCYQoDZKMBFUai9YMzdIQa0L8JuGZKQe4ZpbDvWNkco9Zy7UcyfiXyXGQqF\r\nw329mhGsihX9IFZPAfEWvGtUCCbKa6xUtXA=\r\n=DwXM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.6_1655643760886_0.7741775023900321","host":"s3://npm-registry-packages"}},"1.0.7":{"name":"@mangata-finance/sdk","version":"1.0.7","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.7","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"7a2567c1379913a9821ef4479bf0f12db6c3e56d","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.7.tgz","fileCount":7,"integrity":"sha512-XcUKrmcbwlHjnF9CBgOCxI5GfSY56/A9YsBaH5mEilOYs06/vABz+RXbasb/GSznb4ljA50KOgDvN75FWvccwg==","signatures":[{"sig":"MEYCIQDJbKh9VlElIu0otvDfUWIb4/BMBT/cMo9thBbQvWHw+wIhAItczPqmkJ7t86yAnxdiX8n6c0JxE/kP/otBkHKQGjZa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":172384,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJitUk/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr/fw//YN6hE5vr33WeFU/sUghMxvm9o1r15987RrZxWNSzZBezLlsx\r\n60oyxTk90kIhWKzlQrJExUayq+pasJGvTyRZ/k/CCSr8myHZZoSaZ1cxDgzN\r\nJw24VaBihn8lbX33FpRjOuvtu3AuVCUz0tMU/bqUup9wPHkER+Zr87ISuqsK\r\nFkt8uBWRHxljQfZpua6Ukqwoje+YofzXU8tLUFTRLhbaf5jcHCuDLnmZORYZ\r\nKraXciKGMaOVeWhQ0MZy+ImeVDWLuKPA+jEbKpUfqV/RfKPVtIR8FjWNPL0N\r\n+QXhaV4jFyXem2XfxaaG4c4GtxDMTAWs5/qV9w4+wBFb8XZBKDjvX2EPJo97\r\nLsTP45Av0nOjIX9z1GdtuQnUy6Epg43SZ/vZWOAPvxDEOiCa8eu6pGB4cQUl\r\np6UGNyeJg+GqvHUEFzhRp3AMT6z54KWehZp8ndObHU9y0OWvDktw9i1CJ2qj\r\n5VTZAHA/NYL/ZdxvgztObn35+GA+cKMPliKZ23ZdIeolpH3iLky5gCMHpw1c\r\nJm+Lk0CM3Q7IjYa1wyYahKZlQFd2qTY00QkIgJjWmzANAb9uZhjJ9N/sBNVn\r\nGCNV+/a782lAK+WALfUELogf2FyPs3CJvNSSVPaL+acvANrlBD93e9hBM+5l\r\nsiKH47Xfk2cKq9LSKnq0QZ0OIrEj9OUOuRE=\r\n=WI+Z\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.7_1656047934866_0.898447616382912","host":"s3://npm-registry-packages"}},"1.0.8":{"name":"@mangata-finance/sdk","version":"1.0.8","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.8","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"8e49590283e30c8828078179e81e4e914af9e2a2","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.8.tgz","fileCount":7,"integrity":"sha512-T+E+/XN2eB8GvNZ17Gz00Moaz1Giy6nYEJZq35iPYEGtgoLZVeGwgVGRDt6hHUfdCrd/ExKSZbDz+UjOLtU2dw==","signatures":[{"sig":"MEYCIQDxwgQmW8BbB9uuyuNkN6HjtX0TDdabtENzNZtjRQJA4QIhAO/Em9pkYuGP25bODgZmbkiujDlg5EAuSI7fbDMWj+F2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":77967,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiuBEYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrRjQ//bKcE4ElVL4O4E1mGLuO1Pl9KtjbaSqep91qJJHM248R9LhOm\r\nQAVtgXvPZs8Tpy1jPW5wXFYNgZE7BPQ3wWwNaIqCdMLYBKH0T3DlEnpZ88mj\r\niiCoqzfT98WrQ1/WaWfTdUf/CIwSU8OgDRh68R3SZTrW6wjppT7Gqma99upZ\r\nevdz6wjJf1EB/plJGtUZBlMfmG031F+kXpFdvq0/+70KTzXNaReID46EFFlt\r\nC0iQ97jV428NM9RRoTofABWJ/odA6NDKsZxAUoQyCLYc2ptzKrlbbpP0dhgv\r\nqmpb+M9fc/V9dJO7fR4bhvT/VmOPXFwsjB+XYdKLzVyiyKjYYP9UMpFKHmJJ\r\nAwRFpT6B8tlPvgTuJSO+bQRUDJvvZI1y0+oB9EtRaqQUvnLUschEQZA/a2VX\r\nk3UM72x8T7XwNcs1kKLZEVvk6vSka9t/Hb+A0MZ9yp6If2O0hw6EtO9zIX+G\r\nQ7sCvfVTAl8jYjF03yfgxAwfmoweys6dPEbZABF5JmsCvQFT0e+/T5BRQL26\r\nxn2ecRYkqtZsJokWx4OFsVfvR/PBXIFYkJaXOmRqWwiU9sz+B0rGF6+ylrqQ\r\nJk7kKRK/khBlh816J3SFdhYPwoJEXBuXyX20a40m2+8A5NZRltFw3JYLqV/S\r\nFRhoaxNES/jrivrZh8DFQ4E+9s2zPnnvhNU=\r\n=1KUF\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"yarn build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","bump:major":"standard-version --release-as major","bump:minor":"standard-version --release-as minor","bump:patch":"standard-version --release-as patch","eslint-fix":"yarn eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.12.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","standard-version":"^9.3.1","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@typescript-eslint/parser":"^5.23.0","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.8_1656230168508_0.07877272714465522","host":"s3://npm-registry-packages"}},"1.0.9":{"name":"@mangata-finance/sdk","version":"1.0.9","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.9","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"3691d38cd9432a02d69abad7d76206f6c49406f0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.9.tgz","fileCount":5,"integrity":"sha512-WT4FCqHNmHx0dEk9i2MO8p5XzuYFcFV0rEpNr39ESyCPB9t8O+mbpJDHiX92N5aR9NbcJwGOx14WTqVq5k9fog==","signatures":[{"sig":"MEUCIQDa8QkHs9ZUHydPWC12jetlHwDMzAPbaT/6mYMrLXoF7gIgGBir0TnhAE4fwI88VrM6sehvRO3geJOiBGBKwNXMtjs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75956,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2VlGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrSMBAAgHOQDRL/zLavRwJJwH3xli9tIjNimUr+Wav60c3ooZZU89Hy\r\nLU+lnqRmrsLcElNOQtoEqLHN8VbiCVbqct7LAHFrh2s7TzaS+KQWwys3KlO3\r\ntRLeDQT4jXGS2iZ645qaOVCR1nNp3FQRv9ljN7NTpmF0GxuFnAgrXuY/LSUO\r\n3Ng2OUX4fgnIXmlsBp8/FPJW+zQKhBLsloIKyEi8bWm1lzFJWNfZmmSZpKnK\r\nSB1p1ct7cIh0kTbRUm1r8xXDhkWaK1SN5jlpjoGFKrlRBTexpdUiUwPBT0Pg\r\n40oYubq3e0WOe585luBHwT4rSBITJ9JWl1587L42TPgIblViyI11QfQVlMKe\r\nioCFboSCTPc/YMianJPfo9wvOYjOOvfnPI8wHU1B9UaKxBSpFm2RsapOiEHm\r\nWEirVguDhxQvzUmezLGkglnB+SvkqZbPKU/OQYTQdpWxmIS35PVuZUss5t99\r\nEXcOW8arr3vw34CUFKX0QLeYOtYxVkSGBEW0E1CXybAAHs/3MNwklD/nHYS0\r\n0B5IiJBGgw2G6gh7trGvDrV99r5yr8Wfm0tbD56VhgKKM7oss+xeiuRqXmDO\r\nPhgPnOo4Klva5LzWJ9ogy/JxLf8kpT+1pH0lcck86DuqCa4y3NrP3BQehOGT\r\nLb5EEDyFVg0EPNd8XLT8Ud6mqsk1jTJ5tZk=\r\n=we1N\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"5461e07095cd778f01fd407ba315cdf8869b11fd","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix","preinstall":"yarn config set enableTelemetry 0;"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.18.0","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.9_1658411334439_0.7211854658933168","host":"s3://npm-registry-packages"}},"1.0.10":{"name":"@mangata-finance/sdk","version":"1.0.10","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.10","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"5d2acd5742eeaa4705447ec696b725f432de9329","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.10.tgz","fileCount":5,"integrity":"sha512-yhVKuaONLtTX8rYkcmiIoooeVwpbUwbU6HG/D3bk9fTjSAa/Mw0zGzZ7wumVzA21qK1CM+rMXNK/XAQ7BnyYeg==","signatures":[{"sig":"MEUCIFDE/PbgBun3v247C+7hstZf5lK5ORtYWx+xsI4oO8mWAiEAqdA2Uj4h5KlsiyQobpV+m1HARZylD0JYIE9aJNo48ho=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2WrmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqD6BAAgULao4L5TMfuzDl7ujLtRMgr3IXYm8fN/6trAuXMqq54/76E\r\nPTdiMVh0RtkIH7YeXOpYz+CX+qKbCFYJf2BIBEloDtIE+CPX0zgZRYjt68B8\r\nl5RfiGpvpWbQkVPY/bIVSyGdA+ZogeYi+sRIIFX+hg01LGKoGUgWxgbgADHk\r\neCGZgv0P/0sXxC4AvHV+GsiXwMyRpIY/o7cizIZMqyZHpgmPgq6Za6fJi5rP\r\nSWOOm7YPPwGQbfEB7B0a6c8biykh8G0HktMdYn7b0hRTsw9zi6IxR/Ompukf\r\ndrEYUkbyF/5fXnqoZWkPtnxIHoAZJqW7tEtdhj3wxRRHkWHEIorfa1If04Sg\r\nTD+/WxmOWCSNZiHa/4jZ22zqL/Sfe+PL03k43a8m3gUh2FrIXEYwx8n6x6AA\r\n/a3aeqf1zTp6kjvIcqC4kSNAIsJqShQ1s/zlHGPIKYwLUPcQWmJao20UI20Q\r\niioFsvqUWELO9uTuaL+Pt87SD5pF8urTGSY1tWmh8nCm6MH3+SgYI1f6wBiL\r\n072KPG0lCjslDQz4+GgxXKKZzgMGuCar0sfFWD8H7L40dkXDKxKVQ+Y2Uj+a\r\nbLgDv+m4B+auEJo80THDXOKZbS0gphFcTgEVS3AO0PVCv+gA4DO/EBFjCSjJ\r\nHe4Ls+XH1ZSt7ikxuqjP7SH16E/sgRF9650=\r\n=h87C\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"0f695c3f194945072cc2b9288ccb4c04bd8ad64d","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.18.0","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.10_1658415845921_0.8569117812234626","host":"s3://npm-registry-packages"}},"1.0.11":{"name":"@mangata-finance/sdk","version":"1.0.11","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.0.11","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"e8c2ee13625b56590bee1f87a92171ee42757238","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.0.11.tgz","fileCount":5,"integrity":"sha512-saDaMk+L3DFx4aSayoOa2Qv2JseT3RIUhDaiK9LvWQ6YOpnbgCSZfVG/pd0T/12z8AaxHoVNNXM8k5BJM+6hBQ==","signatures":[{"sig":"MEUCIEc9X0CNmsxpYJ/TFzX0TInW8U2GejMFycM4zN2gloudAiEA1U268SxFVKzgFZG4oOgi7WZvakSTNf4JB4YfmEa38CM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":75923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi2k80ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmosYg/9FbWG6kKFd9OUiCWDO8T372GRoDpL0MnTPnwvbvmP7u1ac+p7\r\nrZuR2Ml/eR3Ms37UjRKTu+fCzof11I+CbScN7fMf/UoLx6mJvzCtSJVrfZei\r\n+zhwlLb02kw8KHyQufVc9fdaA6I69IVCnbsbmZ00N5p6QDZzNqY16PTKIjmS\r\nPNHa8eHc7fsjPdM9/srRwYyBjEjB77S00sCycd6kOPkeU9uQhncJdFkiaKik\r\nW4sKpu762wHtpRQLIDpr0HmeWcq5aXjrlWn3ateRn27jKOveFO9iJ4To9Blr\r\nCiAuiEemDES/sWxGVkwc4dR3t7rsEP6hS2oaufzrJlySWovB8LaoSYQqr8V1\r\nIDJRAmIZJnOHvvAlaELxKNG4isjRwSWhMr0qxm7CF0O7Q6//hbfnbHbsE8+5\r\nwRX+Nph/KtWvFC6b9dbJZF9quQQ5CJv7VouVkxIM6Gy0uLFFB9Drllq/bQZR\r\nyepcvrW59gWAy4ZX0jRMSnyd/pmn44nqfFaeIbTy1jCiVIRda0PX6rVNzLh5\r\n9rSvGlNnZVsf6b4VkJkECz4Dg13VREs0fxvgpvAKIqvB7wo7VAJ90+e3gTKX\r\no+7IMm1sjhC0l6N8G3Sv5c1dtZZjCun3F70i5HXqgPjxyMbsjW2FdONmhCRm\r\n927QqbvzpCtahggCp5c/UmkkSvnD2RMjPy4=\r\n=clDu\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"aeff04604f117045963709de8f787183c92f46c3","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.18.0","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.0.11_1658474292728_0.49431967066253457","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@mangata-finance/sdk","version":"1.1.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.1.0","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"69f1f7ee381c3337a9490734276f732ecb64fe2c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.1.0.tgz","fileCount":5,"integrity":"sha512-Z9lnUiZN/ujCnJ7ka/e/hVsKP8macyHbXX7y7tLkth+FZCRz1+lZBDgEBapNATTulyiyvx5soPYjH8PNfBE2cw==","signatures":[{"sig":"MEUCIQCWVnfcAociCgS7VorfflcH3g+oIey378BwtwNftx4H9AIgQ4FBB5iiOHRUNsQLoD6I+qnVor9XQT23r5+70KLFPNM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76022,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3nO0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQ+BAAlncEyLD/QdwIx5Q5RbL6Zv30rcKdc/0O2KaAl6gOdOkOYw+N\r\nZYgFlRlHt7NETk8v4mUfnlzuGpAnQVcvohamRfM7W4AuMOVakXAEe91PHCrI\r\nRSVvvNYyTqTiPIiJ++TdeFh0y5L960/2/Bdw7cPq2LOixn7IcnmDEqJfEVah\r\n5eBWpbuVkj00AByaIxWW8X42Se03CZlUiAcWowTeMh7K0Pq7ZNAH6qG0R7wC\r\nHayi1HqLrg8fkZhid7jflzbj6Y8x2NDmHnQDkVHEnYhUpFaVmMnsR7ZJZV/Z\r\nADwubhL0A8481t90WXInLV5phf28iu2zvJqIbaVsGcb4qGAS4OUZM/z7lG+c\r\nlmBMYt6ucwWxwt7MxtwqrsZ5yiBNg0bqU+qQ3RHNdpJNaynNCogFOkXIm7bY\r\nt9lU2opo9m8AVmiE7RatWrcC8u+x1SzgHDHVvQz8dE+MrZS8QSyAeBvr375U\r\njp4vYfmIrxh50YrciZdU93Crz5n8UABIGchlnU3Awwc7YukEZkwUKxA8gGCd\r\n/hre8kEZg/Qsv4fnMgB83HoPva+HTJ33Azjfye66dyngGcGQ+2Ym31NvMAR3\r\nif0aLlbn2qD0WjgtOT2RFpceVc8+TlsEtROVD256Wh05cvp48eOTHjJspl7M\r\n2KF3eo5ZlWo88HCBMud7p+zN/GkYOyh96Kw=\r\n=KTqH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","readme":"<p align=\"center\">\n    <a href=\"https://https://mangata.finance/\">\n    <img width=\"132\" height=\"101\" src=\"https://mangata.finance/images/logo-without-text.svg\" class=\"attachment-full size-full\" alt=\"Mangata brand\" loading=\"lazy\" /></a>\n</p>\n\n<h2 align=\"center\">Mangata SDK</h2>\n\n<p align=\"center\">\n    Mangata Software Development Kit (SDK) is a toolset for convenient communication with Mangata Substrate node.\n</p>\n\n![Artwork](https://mangata.finance/images/home/assets-artwork.webp)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nMangata SDK is a first library, built in typescript that provides easy methods for buying and selling assets on Mangata DEX. The main purpose is to save time for builders of client applications, primarily for algorithmic traders and frontend interface builders.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\n```js\nconst { Mangata } = require(\"@mangata-finance/sdk\");\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.getInstance([\"wss://mangata-x.api.onfinality.io/public-ws\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.getChain(),\n    mangata.getNodeName(),\n    mangata.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"8a9d1c74d5c7ff80201cfe948cdef3c2bf69624b","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.18.0","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.1.0_1658745779787_0.9212915926239982","host":"s3://npm-registry-packages"}},"1.2.0":{"name":"@mangata-finance/sdk","version":"1.2.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.2.0","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"250441f545938efdea1d284d7c44fa83eaf7e4dd","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.2.0.tgz","fileCount":5,"integrity":"sha512-1WDxVg58xRCXLYzLEFXaHZPZ0kQtwmmvgcPn4743itUxNcwSp8JN9zCrdvIYgjzSJaK7B97KIy26dboHzJ6Pcw==","signatures":[{"sig":"MEUCIBJzBzgBNw0pmyTL+o2jX3jRz4kHhSGphc0mXAE41pFiAiEA+axeBxJLnWAq0Gz1DQm30GLsVdnxnwf7+tTMkDgCiI4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3n6+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp0JA/+I0Ly+x6o1r6lU/xrIleejelwrHTmcll+6lvkAJpeT//ndCOT\r\nDMOK5MDsuStSIlwf/ggJuqDjPf66zWy2ce87oJLnka7FNrZeLyQggbaZncGL\r\nRqvAhB/txXTVFhWE4JoKknvQEoWtQXs7w/rmk81/hIdwwMSeE7YGocwFvjCk\r\nVrvel0Adaa6X5v4xTe1TkQbIomdmFqnS2o3xmm7ZRPpUTh+k4F7hbsU9fnjj\r\n+UDjE0iEQb7+g5PPNbY7HbxAjzBXoRAwWsatvwwrz/kZbUnFwP6uHBg1kuz5\r\neg98dC1maARxKvoMPr3SXw8Lbz/bbgfZ8Es2labvE8qLW4RuXMXjBGmB+vBs\r\nv8ym5C9Coy6yIWIudGDKgNp++MPHyVvcLV5p/xbP/SFP/kb0tMIs3jLBCdKw\r\nM3vRHpLQw/5HtkPLCLHUJ4idB0ri7j6Mz6GVEvbllWRlrkzMtEy6dI9U+Mux\r\n/UHFS8kenJpSm1M099sk4NSqOdbLCiNHZIn5/UEeN5FfvXUbzQWCkZQtXSPy\r\n5JcpSVtEobGLLhEjAnG32hJ+Lu47qWUwKneOdsa426LD1jt5uqbuVY9IhXgI\r\ntqX6RDLgtDuWPqo6ZflCFiPbMrkKhE+eWGHmbLHs0L8qlFHa8YN1kvyJtJrw\r\nkJ9N8TyfKlZlkVzF03KeyJrtAPi463jfX7U=\r\n=ya7F\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"47b7cf421bd0cb6c6128f8ac0cbcf850c55b6299","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.15.0","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.18.1","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.18.0","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.2.0_1658748605759_0.6491681313654543","host":"s3://npm-registry-packages"}},"1.3.1":{"name":"@mangata-finance/sdk","version":"1.3.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.3.1","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"93eda7f24d0640f860d7bca0433749dd7368a06b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.3.1.tgz","fileCount":5,"integrity":"sha512-116gJFS4M+JD8K7g23UNr+hvZcjpDwCEuWYRet0IcfadWeFl314GYBdarFvsJ61wHtPX6dNNmeHPo/C5+vvqhg==","signatures":[{"sig":"MEUCIQDEwes9wyR7/RG8zTk+19+zuCEemXM4pEo/qHyjkE+dBQIgMzQGgFHYjmvoSoNqi4EJsMl/1VWyRoVYzvP5JyPKJkY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":76151,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3oVGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEKA/8DFEa+10bptjMUzknfdMQZ4Wzij3gKpqZH7/UHv9GE2OCb7rY\r\npmKH10MZxhJXc+diN7oSzzyi/y/upn9BhWJ/ssaAaLvtnsy9a7wkr+bD6BrR\r\nrNgp9IivAuhJ0l/OGsnLoouiCw5aZhbHq4Tg7056FBDZg3aE5iPX1lF5X1Gs\r\nLN/Y6d2Ae4vxl1xiO5rndz35dL9s/fLxPhcUp5OIYOf6jjljuMCvNF+HUasA\r\n1Uv0q5FndOzNcRW0wvf8n1lr4NLx5OdK8JxCx/drlIunScadDLEf6zpDrPmj\r\nSWWN4Avo+rTrDIHq/PfMlOwfia9/R6IoZBC/Q8b2yCdfC/hLagrvJcFLlnnC\r\nyU+AQXNXm4/7b1GRfVef9kFsQfWIkO+jaOJMkxafVtQQ6qstcGJQFKe0Bxwt\r\nOi8TgaYtgZH4OAwEzIM3OShrl4cblvgZX0ngmotz8YlgG4jFZG+xgvJ1izG9\r\nzbae1K9bEHrUtS+KzDmMubw/Xv4qJtm4+Q3LVRoYx7dSVYqy7p3DEFWnXwal\r\n0W+VSwAC1VM8WvNgzuLQvvGMq1AHJYVlpLWKsP3y3yoKPYrV7/orZkJHz2Jk\r\nrqkK9eofzebfp1ezHl7mtgV1rUIGBQLebfCG6g+NWtJ9/DFCL06sQEOQCEqQ\r\n7X6SsTj8k/UBDGb4rX5Nt/bmIJBG/zxcoFw=\r\n=JX5Y\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"476b3b1c16cfd778c424f7f9290ca2f5c44d7b70","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.5.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.18.0","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.3.1_1658750278559_0.29978274146635076","host":"s3://npm-registry-packages"}},"1.4.0":{"name":"@mangata-finance/sdk","version":"1.4.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.4.0","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"920b3e083b270376b0b0bee19a084675b5d89f8e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.4.0.tgz","fileCount":5,"integrity":"sha512-/3ltrsRR08NGz1WbbhNhnezgLMQt+/iOVkroWaz8Yapi5zmsPEnI0Yq6BcgFfUm4aWJFVkgP2tO/uMc8LPVf5w==","signatures":[{"sig":"MEYCIQDw5pkub3aCA1035JlpNSou+XlnZHpNA1gmhqqJbOk3qQIhAJ6fab/Jj02YxCZfmsZcVC1d+nUlCnGEURAadl7F83rF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+L+iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtLA/9Fa24y5BzH0E8dWclAJU7AvUkA2A4zJsmkTdBZ7cYbUpsjKme\r\nBPYn+n1zV6PcWW9JADLmIGPGWhHKf1KjgDZgLaVnu68U2NyG7snKQcyQgpeK\r\nq2R7W7QsTX5O1PaY3Sv2skS4oN1EoLaEB7WrExImiftlUWPwrF2IiZcduHfP\r\n9LAAMUSlA5Qb5qOEhlB0WgrxAHFNVb+64Tt2iykn57lGzGaOHYHbIVubRzK9\r\nV/0fO/fCacvzghKLuSP/uLP7k+0ritEYeWs2tm13svi7TwhCQU8ge9pPRap1\r\nh3UeMArCeVGAv8mS2rChGw2tZx27/qPG2HSH+mn4WJktCcpjb68MDuLqoZdV\r\n5/6ixtdoxSI6n1zLT/OtD3IxpxEYrodzNzkvFBe21kggaFsmg9WNLq+YsI/v\r\n2Rx9p/6nQYtL06PqGO64+Af8UwHMGHvRWbNGwwQ0crJ3oOAkDkYrS2kVzGtz\r\ndMkrkz8yel81RLyXjZ4Me9+p0LfksboCEUtNFWelBlu65nxQUZlyYsZ9fBjq\r\nlbT1n7uCd/t5mdEonmdZ+VRnmxtHVJ4I+aqqEXUxDW1umsM1Q2vFVaTaw38M\r\nHjs7CqNvwD6s3GUWFUjPkKfbvUrFJQVMkePbrvpOxSyc17dV/e5tU3ZDhfvi\r\niqwkeQSoVGoDicmDSE7z4vq3KpgDeMT6w8g=\r\n=QUnS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"c5b4cea2cb7a9fdcf16cc00fb1b5a74fb31e7210","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.7.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.18.0","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.5.2","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.4.0_1660469154344_0.19467458702762563","host":"s3://npm-registry-packages"}},"1.5.0":{"name":"@mangata-finance/sdk","version":"1.5.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.5.0","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"52f812ade2ed92ac478e20dbeb7ee94f51acbdfb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.5.0.tgz","fileCount":5,"integrity":"sha512-U7TSI8AsP+DRlG8bWZ5oBxniW6i+Dmy+AybeTzLoq4SoSl2Ie7tN2Q5IyFYR/vwalfruAXdeophl1cM0NnyNsg==","signatures":[{"sig":"MEUCIQDCJYbJrCCrMB672tk4BOQOxrFE22kzyMCrGThj5S2sFgIgLL7blm6PREyjATABDy+KC9Nm6Qk54PpVDInvK7lC89g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":80997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBznFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqpQ//bgHUcardh95n3+4IKBJqAzyj6+Elenux0cRIPB+U4oWUublh\r\nbalgub0YkHt3BQmXVwK8Qrnob0KjqqCWPTq7xz8NWb90aTzmMBZDPScJuZoK\r\nF4UjMwm7fIUcBN8DxTa6XI2ADHFbfjZdJrCjoRDtIANYKcDRhP9jX2vkl531\r\njbsJwiL6Y1/DWH1YjZMaDd540wH8rf/AbEdmpOyvqgGEyc3H5KiWT0Ba4cb6\r\nbKxHGiVtMaO8pAAni+RdFZHmM5Jzwve99IPTHKtfueAhkuAeqlX3BELue9md\r\nNQXVhVCzD+938JF5Z6dRHcCDz8900JByC2ZLPlDtty7U9bLrIN5pJJ7hhShK\r\ni95LBK/QXhyGOykCf0racTX12PFWdb1vWZAbc/i+8bEBBE2ugapUX80Ar79K\r\n6hXTNEePqzych7kZmWvg3kVWnk+foV1fPd4o9BapD6ysTxV8+gyWMelXY5uL\r\nNzPkq861XlJjy3idx346tTEdgf6teG0sXh4NClEE2v7QTfqMmI4X8LiQQrNF\r\ngQn7zNbn/BGhm8VXXL/tBqpWcR9h4Du6nENfboNmwd+s4qAN0yPH3PK6c6SE\r\nq7esKCpK9xcxS3xIFj4j7QWHQRlK7lAT5U612dJkBIoul9NaNJ5OxaGmnfsk\r\nY2fndg7i/qx+Bxqn0pk0srvh0b88wZbVJb8=\r\n=6aY3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"a9986627da5cdd36c012f1769a9bea390aca3ae1","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.7.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.5.0_1661417925790_0.7179943256553056","host":"s3://npm-registry-packages"}},"1.6.0":{"name":"@mangata-finance/sdk","version":"1.6.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.6.0","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"b35b066f47aa2dbded9229611e27af2297b367be","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.6.0.tgz","fileCount":5,"integrity":"sha512-U03uoM6Nr1p+Zp7Q7rY8rgYOpnNf3s67lJpi4BuhebQLdlMDrC/ea06/goA7UhxOHByiCAZyIN7pdrN7myvt4Q==","signatures":[{"sig":"MEUCIHLCWd3b/VMMFjIi/Lv6k/tXzzY7H7cAzIgTE+s5ZmUnAiEArCyuI0/6fkulNr0pN0WYjP7P1uOE+AWZuJw3RciTmSA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82737,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjF0Q2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhbRAAl+9yQytcoNj3tPOJ1iD4Ml3XBOFqMdIBEFLUoBT1WaDHscVg\r\n+SHRvlaOvpnEO5xTFxNUxC2dZCGQJRcVP+TZG2hnbglWq/46olCfWpD8SFEs\r\nG/Qonu539ul1czKK9Bu8U5iW8LJ7+eDjh8ymxiXNyZcsH1ah6fYkm6lSH4hR\r\nshCzdxVQNzT7END1RoovPIM9tqdP/pnzLbiEGR5GUO+0p09m6RfhV3Z1/HZV\r\nUlp3qIeK3uprukILlLWGeJAT7djG+Kg7xg5Li7CDAxuFNoew8ivWxA1cXE5u\r\n+W5YPzgmQ71WrIF/ABiZPkTkL2VtQxRzKalsyRwbfCEjVqjXZ1Z7HWnTnZuC\r\noNqeSv3e5nlrm4Vfp9pQ8NNiMwI89Oyi2MnZrnr25CBatoKWn5qmOKUyXeZz\r\nAO8IcXqDhyobkjxuDrcP2ZyPEmBKIWPeSEmSktPWoghs6UoKeV6ef0UkZvU7\r\nMpKHyYjHwnOYQCLWzB2pEeBzCm7u4NJRqFJJjnMBxIQY3XSTxnlu4UUVMYSX\r\nTraKmxCePorPM7RO2YTsoMvNuiRNN8YpEJwzVK39M5hFjslm3MiLlwYrQg7q\r\nXcsSiNaO3uPIQ+M8NwV35HFHN8ndMtfYH5xK1GP27N46U9AnC/l8aIRR9924\r\niuxowkLaBxVSmhLkpG9uLhzgquXeCflyMtg=\r\n=QyL6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"99c31d24676416b38a43dba6a29d637d1931bb12","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.8.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.6.0_1662469173798_0.4338071243284207","host":"s3://npm-registry-packages"}},"1.6.1":{"name":"@mangata-finance/sdk","version":"1.6.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.6.1","maintainers":[{"name":"mangata.finance","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"e7c694e1407ed55333730a065f052d67048a04e6","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.6.1.tgz","fileCount":5,"integrity":"sha512-oDCs0dyDTeOuitJF1KCUUpGvlkAfyfk4eFQCRaoS13wOZXJ2joOqTojFoK23b1LMziP+SzBaJBDyW5FlvCed0Q==","signatures":[{"sig":"MEQCICKZv2q2rbkzWI3qgI8JHmkFhQwI7iC4PCryiASRinWEAiBAcpEzIywNR2NqgbYEoZNQe5OlKCvLHqr8x7GXFNAYJQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjF2DiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtPQ/+K1vAmEgK62v+0fu0PytQMuwegQK0S1+KNA7NBenK3Xtuciep\r\nTTZF4z2EOl4j0JBnhJ9bb4wg9V7KC6dFijYS3t1lMZnRAmfmQvxm5Bxzefyk\r\nzUEKhZwn/YIR0+Z5dGSh+UPtFOuI3syCdB1HDdbIDdnw3DuGAl0oOuirBUFu\r\nQCjlfYBkQPgLZIU+EPNYcrKbiy5xvCgeaTFpJKJet2S+z5Zl0me+ELfgxF6Z\r\nT6RQkloXQaD9EP7Pz4W6O7adqehvEs6Bum/4afIGm8vsjTBFOpgyUHQBKeuU\r\nwZFrUuZwq/nrXRqypFWQmgfDMnG9kfEkaqjTlDxqBPrKig9zGSirGBVjo7sr\r\nDUD8hiCG+1hprHutlcyiduNc930GtAxsl2dcb0wLRXcY/LNb8P4k2QuHHTlT\r\nsvqnhjjKYC7RQpnN6FtvGre2LbdD9vJU+5urnMWLk8wUri9b/MIrD28iPdIt\r\n9wabA8Hx/xWNKIzFyfjgtmmv/0mX+NkVvVUMomrqYKPzq6q8DFZ5kgVBDAAV\r\n9/7XKOQwFeNkzT/ek24l/C7ImrgYHErXLK/Ue3bBWGS4PRNjKa+/jcom//Gz\r\nXiGnVZPPPgEsNaGJPdzih/hVB3J7kN349teS6CV6WUuoJVCmO8iLetEDKpQU\r\n81xXs53x1nK/35fIER6Jvfe/1ic+pDW9r6A=\r\n=XKaz\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"411ad816e67e960e78093fd69dd103282ffce16e","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.8.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.6.1_1662476514625_0.15219876077922567","host":"s3://npm-registry-packages"}},"1.7.0":{"name":"@mangata-finance/sdk","version":"1.7.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.7.0","maintainers":[{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"d1184e58820de91df040143dd6bef9d84e8fff0f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.7.0.tgz","fileCount":5,"integrity":"sha512-uHtGaCgku/C/2VzqodgIgzq3Top9Hbcpz4lmo5YwiCRolj5IxB73WiQGoDGXcukdGfSoy0jYaN5PkNbOY/JtQQ==","signatures":[{"sig":"MEUCIQDH0u6VsixbfN18hP3ouXyeXH29xCSkiNL5/yfAH4xgGAIgaHrp5Q3KFZpitC1e60JRujaQvANZmDu1JGiBrQjQqwA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjMuVcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQHA//VTbrKXvvkGRh2LdBtfl9xOTK7qajmXTCdMDdRTgHehnnK9an\r\nIA9atnT3IH100BbAphCiVxre1ksOt4Rkovtx330Ux0G+Ps7TOIQjRifQY5jf\r\nFdOgOPAR2vuFgl6JeaUouvh77e+QX/89G5COJ1UehYWLJxK8oyQ5bBckg3jp\r\nep/QdyLSygTHatxql0lt5D5rSHMGMKNP0KcSjSavrXeQlOmQ+bk5bJgl+Z3V\r\nIEsoL7LOqcVvcj3tHplWuMXwQkWooHLsJyRwBNpmuGIU5yT7lM/CLQmJNDao\r\nXI3lJquK7nC1lI0/LVOok/oiyY7Lj2UFaki8S7N9K01TP1SqQE4Q6dqwxwkc\r\nCSgZaqakV7VkaoSccxp7VJbRydSUDgJCvXyJvVt9oJcCbjrkG5g8yqFg3380\r\nKk1bitVumoSCTpoDXkhMPEYYjgeJdvzrzbw27WROqik5kXNJawkrCfR35ybQ\r\nWtsXIMMs1qLgBzuMq9Jydf+VXjEyKcffbd7lq0tGTThR10E7xRCQyK3895Iq\r\nyArtPUnmacV0rYlUyh4jw72fVX5xcdyQvgtN8n9KDh/qIZCnT6WgfR61SeB5\r\nxRPk0AgHQWfmkBXPQB26aqt9ZeR8N6Mcffj1OKVc4f67w7ZQfMTPzqIZ1hTz\r\nETwx0vIuDjhjoVP91Q4wJD/2ZYBw1eXfrdY=\r\n=Gbnw\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"38078478ba0b58d215d92cc46e04b5397fcdc6dd","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.7.0_1664279900276_0.887392250692163","host":"s3://npm-registry-packages"}},"1.7.1":{"name":"@mangata-finance/sdk","version":"1.7.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.7.1","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"45ddb84ff6c90b994aedb2761404e293d6282227","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.7.1.tgz","fileCount":5,"integrity":"sha512-XvaknKy9ave7yW49S0SY+9/JkUolkCyW/cEHxJ4kyj1OrEQW1XIEfc1/m8JR8RrkEOMZTGYk4Dq2M3zn3QkEBA==","signatures":[{"sig":"MEUCIQDn8pFve98CBAzfXARCTlAIkcnBBEexoWuyrVptS7/xGQIgVET9o5jVBO09emlvlEqB1kY+L7uiIP1ViaXmhna5SO0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83256,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNaWMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqS4w/9H9xbHEnZr5Xgn3iDeKnyAT1BT/BLnvNNB6X3UAXh+teNsF2S\r\nLQE5OG/DHm5HtTfRJlmORyEWKCWnATbxBREipikLVl2AHWWuD4pbULmwIXVX\r\nkC1DmPBFPIfF/kfhJntEJ1b4SSRUCTilQ18eaTKIhPdM2nFIVsppHWeTGR8p\r\nlPijhUBw4POWfsxY2h6EcIY2mc5mHsP972JH3tZa9e+ygsyZ/z+LoduzRV/t\r\nh5tIeMQigP7R5IhYoUOChrkDqgSNIUt6xnDsId2gXG10b4WJuckyJx60ZJ3L\r\n0Vtsnlr4M3ZnoiSIRz5U+RGAIevP4KYzFDDCJwIb7OysZkaFoaZ3ayd0kJvO\r\nnMuIz67dU6+03+6zqO02qymZi+7ypVMbYdL6I/aQ3JpsvavdpVVoNtZ7eAER\r\nxTjR5xDLX/4Xidyeu792EbgzbVwg87BE+HCqeiGqfc7VOxMGGERU5AdsBYwc\r\nVJZF5pomt4Ta6o7UAT0JiHLgcS2jgKX4epi7iVFVY4AE5naYhHcsCHP3WxJt\r\njhdY77U5Myft7cCK5RGVlrMzQsT6J6X69ekirAi3ni3J4p8OWtU/GU0daoPo\r\nIky/9zvEOBxLWkudKQ1hUKRvRMLkl841fUqhGz3XdOkIEqgXgozjFwvG62yS\r\neQs2eiuu8/MxczfZFT8I25ujGgktTWvuPQA=\r\n=zfQ6\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"96efae12e1683cad15f8b3748c96750c9297a0a6","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.7.1_1664460172433_0.8519831114961494","host":"s3://npm-registry-packages"}},"1.7.2":{"name":"@mangata-finance/sdk","version":"1.7.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.7.2","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"ee718d0a61f0647b9e88f25d080b2eb897ddf8fe","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.7.2.tgz","fileCount":5,"integrity":"sha512-aaAWSW0MPbLsSGP0ldJon+bv9HZ/x7e0PRSBo+doNkbp+kWfygdYkpAU/n5PJaNr84GRRx3EsV39f4qYDIpcDg==","signatures":[{"sig":"MEYCIQDgRlNtsMXLKZH3wahKR1kN0GDherMTNYazrvchjYZI9AIhAKYvjvJyjP1oxH+ImXMR5TWhVcDVGi+QS+ieJhXqwqFV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83320,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNd8kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHxQ//T0tVFnQm2p7KgCOll36aiLQo1YGF1xbcd6XOKVPx9rxzhOKG\r\nZX1FnblvybgYRQVL5WE6k0zN8fUGaNgPkzoAO6OfCxNCdJOwEj21LghrCOe9\r\n6Djo7ubvaxsOfF8N1U4w3N/50M560haY4MVkIiM/Uoj8hNBCo2DC7CLe+3Eb\r\nIPaUBFfaicVpNaGf3a8oBsL7TUPFlD3LIpv3+EhfVzYPsLpvahT9ea+DpXFG\r\nGIVWM+FsGlJf/o+FL3LZbrSK4/7B4+Htrfr5G10/sPiBzXk6rUHM1rTkldlw\r\nF0uZStkvB3UoPg/ModMTz9KfsYzjFE/USkEkbj8hujvNvFacR1cLK0wY6YRz\r\nZJN+DOU7tbeb1S+hbKBewUN8KA0uJRnYp/JvhqrL98PN88t6AF4kgd7jLdRI\r\nredTfApRLwvMNSx7qvj5zZ1fqSxTIdm4Kfug7FQmvUUtMi1nhSracqa0KKUL\r\nZZafIzoWNMFrt5varkw3LUGG+uUAmzM3zpfjzg0AGJrAGTErJuGSGjF7i98z\r\ni/BFYJFhxsPmSnA3reGoyQUz6GZ6i7btHLxpJAAUPhxy2O0HuKu2CEs2b7S6\r\nIbGUWugI24+FMaXsbnzurrhnkMaFdOQsq6WU05y2Z/JPtSqyuOpmD1MNMBp/\r\nHtooEQtyY5kPQMEjo7yaV17jRLfWM9qOLfU=\r\n=aS8U\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"d104532cf1827cfec4eb62e16cedcaa14b58eece","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^8.8.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.7.2_1664474916268_0.8340638439908701","host":"s3://npm-registry-packages"}},"1.7.3":{"name":"@mangata-finance/sdk","version":"1.7.3","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.7.3","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"bbfb88129fcb888c0af94c12872a562584bca179","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.7.3.tgz","fileCount":5,"integrity":"sha512-mnbMGKneYK6Kjfrpxnu9oiZ1am7Czcf9+rYXQc0nJRO9pP34JrWG7fv0M+f1pM95AXLVkupm0Euj1KufrhBDog==","signatures":[{"sig":"MEUCIGfAWxl3t+PHs/KimzEwrDhg6p8a5n4xjZZbJDogDVjRAiEAi3wlxvNPaMdXri/lt2RCgLei60NuzhiTIpQcuVDcmHA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83192,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNpNbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqRsQ/9F8ugU7Izlz3asfjizggkjOLAziNcRSwBBug/+8qlkmRxSFSd\r\nTPvd7uxtTFglg66IvqGuOiGpsYnMLbiK3V2IrGvP7T725+iIsDzRZmnQ67za\r\nHrE0c7MmIGOf3OszaSO2HQinT+/ah4QYWaj7tzQMoqUK6kMDi6MOXFX0uXYl\r\ntCDT0Yo/J5pTmVGE2YekphhrOP5Bghuj837QQBX4SjhTMUy6x/u2FYMu8VdU\r\nNJJgip1prqGsz5+mEPIUt7V2+hChgM2KxajNKjuGLFZ8uJFvBTfqUyGotWnD\r\nWue3TBBzNlbAlbBXwGD20MVUWRXk8KUGxWGaqQk5IGro6eQqIYpX3ceLcNWu\r\nGM9qFbBAa99w3Va5xKSj4H7W2Wn7q3fXIwQ75/LwjDCP1MMqSlRElwYwUqra\r\nZkRXk4+5IznLJKs7CxYjvWmPxSnaVL19RULzRTJlv1P+qSE9KhU2uO3dZRV2\r\nmFWHSJdz0vazlXSnhlcELRU80qh3S7Q04S1IZ9w95AqHV6e7e5/PBbN2SQSn\r\nUcBtLBYhrZSGbApoPbnd45L4275/buwyHuX7YKAOMrE8Do5U43lZoYMsD6wM\r\nkieCu4qAkPURGne7aNQy7k1bTmOSgfHRfIbFzbepmpu28yN8mSLXwiiUciFb\r\nbFGGIgS53JmFr/DND9o0CmfJQXL9bH8IA+g=\r\n=/tzY\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"2b3421cc7d0133387d9e6c4680714d18127da5db","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^9.4.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.7.3_1664521051684_0.64074334353536","host":"s3://npm-registry-packages"}},"1.7.4":{"name":"@mangata-finance/sdk","version":"1.7.4","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.7.4","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"736d9e52fcfc5d3e9be139b07ea5dc9aadacf997","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.7.4.tgz","fileCount":5,"integrity":"sha512-CLQ4wv0/LUbPgAGiELOpQeDaikQrlhaJoLnrCjojKPjusonbHbEh9fLVryKM5dlHgmJUvLpLyUH1+P1TYZW7Uw==","signatures":[{"sig":"MEUCIHnXumRpk7Vo82ezNVWx0lmaFH1DUKoxY2H+Lg06PZMNAiEA1Dwv4kpBbDZZ9h4f8AcFtK9UKcIlrL1epUtmeJrose4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNuCoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr3Bg//RuLHrWqSPKfvlKpnTlXqDEdS4xIQYs5zNGr6tQEHIPYaDlyq\r\n2/GlRdI3iOcLzuB8r0oN8RblgCJFcSKFbIqXKq/M3ADFfaNb4quok6t+/jND\r\nQK7O6fA4qdcN0snGczvsXxAbrgVdfxwfaDxxK//XW6MJZrENrGEQ+lhc2Q52\r\nRicv018IgatQqrkAgIqHx8mZZ+R1vQ2NK87TzTdmO7OTEvngxQNgIKnMAq0J\r\n/badNh7D0aFzjz8beBZZ6yp7D2RIdWG0T6CjAz6cWVeYA2grqpOv9dT/6lSo\r\n3zYG4YaddVarvfb9e1jizJSZxh/A7e/LTCiZTOgvzhJ13YQ9w6kwuobHiGAw\r\n3ReDZD98QvAvJyxe3zEuHPJ0uoOUEveHYa76ibvamdQlSUAgkiFj2vewLHyL\r\nlWvuD6f4EvFbZ8UBshmjQDGfBU2a5cc+k+3GvFJlrMHkCNrK6Ay4faPiXx27\r\nYgvgXjMicqYhdKCMdnTIwViMHwO628fsAJCzsA2ec7OfzitfRZTKyHZ3jREJ\r\nMU67OZq0yg47nyIQS68j1Sf5RYZZrYsC/VmJq1wpyvlcCURk0ZInCamFDe1m\r\n7vcbiubb5aF/PeXagSAKRuWT0Fb2X9maWCRFTfNEMnHbmdVTMfpL0mhlA9Ox\r\n6+GPRgx8xsh0VX1Z2MPDGmt5GQlxqas2e4Q=\r\n=dnlk\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"c8e8f3fa60be848a3668a919dab8fba53b0ae0f4","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^9.4.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.7.4_1664540840649_0.22546602782549208","host":"s3://npm-registry-packages"}},"1.7.5":{"name":"@mangata-finance/sdk","version":"1.7.5","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.7.5","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"9df3c97010455502ca848a9545369dacbf1d87a7","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.7.5.tgz","fileCount":5,"integrity":"sha512-nDDuLg9auzivjbBvxixzrB2zEyIUB+BkhbwfsLjy43H+d6A4EAYJuoGzhY79TNBZg4DByLR9phOZe1+fIe1ylQ==","signatures":[{"sig":"MEUCIQDdKGSXqcXWheIPGBzougJSy873GgTeK+EvANmT1uzgpwIgepiOusJDJzKd/6Up6GBVq7KTZKxJjra3AyiSha1Xs80=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83074,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNuanACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrWg//diBoRK0Ni6GkaXHDTWDIBH/wD3s98OkWLbC2X+XRrn6C7kdY\r\nSYaTqcgCiCnqeV6Yklft/gP+1C2oW19vWtmRA/XGIOCWbiC4nPIwo7mayptt\r\nx4G6ywyDKGGiPLzyqAM2eiEGfqo4Iqe5/L6OCgr+Y7wvJLJfsXXV2Bfg/o9Y\r\nlA/3IXq0Ac00lSW8Gl0rOHiqFfEb55VU5DDDN00EyA4B9+VBJIEzaXrDuNb1\r\nyeR3lnOvexHdNigeE5tvjScrvCBlxjhFKlM6vhms7fUJBr39kKBT/ydpSkmr\r\nfVkRRVxD5sXytN9sUChTmcfdrqC/J84bz5gqLEkRVtndPWWDZ11GBS7RGxDX\r\nfR8zOnuU6rKVP6d0I9f0o5d+gEy8Mce403LcADuAidcLSKPTIfsmkAKRMS2s\r\nLsG782fzAd0QJHaICxa/Nu1Rden1O6HtVy0MgX27nYIEt/t8oMk2SLH7LnMR\r\n3slOIoNtX/VvFYzz+SWp3a9Kwtmrq6+te2rXH3G5GXO3UGFCUKit521cHVfL\r\nM+2uB4Hi2bheSyel1UZsSCRnvqy6anUCXeSZUoWnmoOcH9tNhOaDqrSFddef\r\nOGrIoebZ6Im/o006dbmm8GxSJktwfO2dI50wObHqWLYkBE2i3g5VTnCGXf/g\r\nRNVZ4zy8Xt4gmP+0dSZJXIQsMuk6jmLDLYI=\r\n=GzBp\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"9927412e8f95e99d3559450815aace0626ef794e","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.0","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^9.4.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.7.5_1664542375209_0.7618405254943739","host":"s3://npm-registry-packages"}},"1.8.0":{"name":"@mangata-finance/sdk","version":"1.8.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.8.0","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"2d37c0625d590a3d0f973488c5d165f309151928","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.8.0.tgz","fileCount":5,"integrity":"sha512-iQuJyJjkJr1/xFhd7SuuEdc6pWfOaZTzpW6p30VQtKMuaPY1svr/zVl73hTiCp2w/za0hbudPZAVnaik/vBHOw==","signatures":[{"sig":"MEUCIBRUEiZndNAGedSg9K+espyu6B0WxAteDku8nSlZ6Ab/AiEA2COty64wpSzJ/np6TMDU5RP7pD7VfoJauern4XQe7f8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90104,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjSV43ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDvA/+NgJhUKurfIxC8fC9imBaZNMB5lSDuIffZi7eam9h8sQkwqLA\r\nYa9ZwHq8+XPmdzqUcbr4dOmk2iKhokSMf73perTClKtAjru+oPfG/0rkwJ3z\r\ngaASLKOnukVEBLEarlx49WVJdrv4HTpeeFyTsc5HOmTJvV92ZC5Ou4eSPxvX\r\nfEAnSLozHHyuncu0rGbVNM9VYAiswQfXXS/X2719u2vn3z+oxP2tmYTuK0uI\r\n6a4qUOKo3eVw6dlLlopLp8ApDJ7zY22z5Y3qZS4HmUVmv1vNWPCvEKfyMH06\r\nfQxbcqnWw2kGUUTNuRHGP9uGz7TlCC9foqRhoS0KwK/GTVm84fucCgVxWz/A\r\n3QWnehvqgWoM76QnUy3Iq/jvJLjeuXcVRU2tPC4578sqRjZrdTsUVtthTk2y\r\nwFZ1U7fyFm1IolRBYJ22ocA1prYoz/+4hJpjh1V2WmEUVD5mQysUMOj8ddFJ\r\nrVtJ6ENrtNfQpmFBMNyVo7eisVMeDMdMiMFz7WAbguVLUNn1c/KJ/K0La5bu\r\nVqlBIGmoK0L49A7YeHAa8U+DMYfexez2+lG39KxcGa6kp2sT6M5P8+BsTgmh\r\nl8JFp3vFLPPJikxGL8WVfuSVpNqFkQ6iCqEs/Y54JTQAbRNtmV1clTv+k0tB\r\nzmPyseQnWTLmq8+s9oT3Aj+An98E9QFqd9k=\r\n=5qDA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"abb392ef0a624ad755c8a854568c0b1305666b56","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.1","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^9.4.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.8.0_1665752631171_0.7061816915348518","host":"s3://npm-registry-packages"}},"1.8.1":{"name":"@mangata-finance/sdk","version":"1.8.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.8.1","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"be47b9802e4061048a820b75389269e05977cbbc","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.8.1.tgz","fileCount":5,"integrity":"sha512-/NFZHaLHucNPHqI5FlGgYJJ3EkoujtAyaVthJoccS8C5ewypePX3QCxoI2j1aPZ/A1Ajc05ZYGA7V10h/t/xGg==","signatures":[{"sig":"MEQCIC2ogF7MyYR/7+w24LLmGVkrITUyZZGl0u9IQVyLDrppAiB9zukk2wkc6FLvp3nyD9qBkm+1/Gnie683gV2IROAARA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjUTmSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpp8Q/9Ghuu8nZQ14pFTexp2sSmYqxthVqlk/OK+zKVrQhQviIuHmrl\r\n9jXv/asz+7daXGuH1etLlseEfZAyUTdK/yAi2Uyjti19xa5XKDd6CKz9ZcK1\r\ndGzgGbn61av8MGo1KHFSfFv027hQ/g0P+pT5a3+CAUZKx70HHzuGwiKFKIP5\r\n+0+Ffz97B5F3ga562p7Xu8ZwYhaJY832B1AWPvofT8zsr6J28zJWnM/XAD+h\r\nEB1NUSMa0WMPyglHqRdhx3xV7GHL6IE8wDAWI0aYflruWoOo+eS3CvJ+K0va\r\naCLnZ5Vk4d/nVNl9gPe/NToFSJtTmS5dwVCCs4CXMuCVV2gn2C4dH+Bus89Y\r\n/Eqk+TwtSAF/VUFM+gZsj2nKX3lRNHITmaLLeUnRA3UbY18TeLN2v7UQpKzG\r\n7vmtevN2Mx89cEqHHnLGuTcVqXQxQ1b0qvLvjiPe6o4Ah6sQplWe4Lr/Oti0\r\n/4MckNtO519YaLGXFB57cpvscJQjifVMBgeagJgcDPmJ5TzykS99mttYR0qz\r\nOCG+EaMsyAkXIjcyc2bE4A296SayZTGqpG2AXKtq6JelYgUmHt6bxVbDf/vd\r\nLgspOD2YPFI5Wv7sb0Ao3V/d/qenJK3gkUBXMtvtWjSFoJS5pwxPELt684fE\r\ndbFImB7FG34FVtuqnbzT82rK5oKZiJXHzUI=\r\n=+XHL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"92ea97f481da073658d802e2ae4b0eb4b8769cf7","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.1","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^9.4.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.8.1_1666267538509_0.008469705020698992","host":"s3://npm-registry-packages"}},"1.9.0":{"name":"@mangata-finance/sdk","version":"1.9.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.9.0","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"6bf2dd2bdb28b568b857571571852374c2879f2f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.9.0.tgz","fileCount":5,"integrity":"sha512-E0QfrShq4TIz1r01zhwIt85atmDQ6HFPtFaYzzDNpt3IYONszKvVDPo/sCKW62tXJb5arANjVb/G+JlCzH0hdw==","signatures":[{"sig":"MEUCIQDdcQA8gwBrfgmFc7b5ms5RSFvY5980vPzH80xHi/YwbgIgbnrJR5/4d0OyS9HlEisUUcriNLi3cGNaxkcjPSFrzSw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":90107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZB7mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUrBAAjO5mrZvvdWb2+j2L34x8yt1nQX2MzOXbfBO4iqIsY61mwPXf\r\nxV1Vo1OOs7fZqPweYQwqWj44tge/EIyT8s91PICnVLsDgw/5CVPBKe561YFM\r\nmYBlzSulTHl65S+wC94KZACixO/KT/EWGOy0hq5Gvz/rV3L2Q+lXloAeWRCk\r\n6UD2LFQ36aCf9rzwtjVUxkT80ri2Ly6An2BzMXzkUzyn/IeCUDZEC1C7xcI4\r\nONZRsUBz5JPebpMW2v+chS+2USrvWs1AQRpmp52ceeoq6+Ej0SBkauHQIuhM\r\nkgT1kyPFrJ9nDWyx308c6rEhgIkm0rmzIOxi5rV1bsZAxOjyJcCxKppEGVSO\r\n5jekn7HHbLBUQuoElGXga75S1dr7l+9nbdspceh7XBPpnDIcohdRj/FuflSj\r\n2L9sWVa6tK2W5niutFSChys3GETLJQjlGTt1md8h8dsL4oG+FJZFuFtN/CcP\r\nv9e5GJrsQ/CD4HQjIIAPWlFd8ryOnBHqdfGPpv+Tif43TMFo12CZlzMFv4bw\r\n/BrBPs0h7f8kR+LrvE1km+Vy5bpbOgyVvUKaLaWjdYViNBs5+fGVQ9ewTAW5\r\n6939wpfCsWuZRmRX3Uz3TpwM231fRvIDMCj+SNxh86y/ArWtpsAteFbii6/I\r\nurW+fNtDLp1yYgzZCP+sLItujvz0xh27fow=\r\n=WMZr\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"894af242a5b30062ad4630bbcee811133114fa3e","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.20.1","dependencies":{"uuid":"^8.3.2","big.js":"^6.1.1","@polkadot/api":"^9.6.2","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.9.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.22.1","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.9.0_1667505894044_0.7245851282666906","host":"s3://npm-registry-packages"}},"1.10.0":{"name":"@mangata-finance/sdk","version":"1.10.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.10.0","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"efaa1d9dbc67a8e7e27b6b4847a3d608e8eed0e4","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.10.0.tgz","fileCount":5,"integrity":"sha512-+dD8sc8NQ3pBmEhZ9YAbHc3+VMjSTrUt74LjzI1vi2Ftf8PGNMqxy8JD88BF0QiPUDYaCjhcRdFHSOJH0GIbXQ==","signatures":[{"sig":"MEQCIDDslXQeYQBGhcu4CBf+ReeILWdD0R4g+sWZCjq5LDIRAiBijdWkzDOU6ApYNhGe/ttwYEbx2u6d/Elz5r+h7DCvpw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85526,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkfrdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBgg/8DC57CJWV46j7e5yFN9aWpknSOViss48/7qvpPUFjJHR1XInb\r\nPMfVPlXyj7jXgYUrILuoRiu5gYinVNEFSSbyK90855v1vbMq0dAHtOWLTITQ\r\nLqZtV0Jq7oJ2INzVfUNp8Xub1+fmHBPLddCXdkYqIl/xy2y7rHc61DTU4WMo\r\nB6TGWgwvxFnjdaBBlQotPvGiNOYT7W9y2P9lkYfm5ldsyl/IJIXYGtxresoc\r\nJhrgPXQBfDPBOq3fC3/UW3z8kma2Q6WoprG/YFLUbO7WyKzAHX0B2XQJfoTl\r\nnh8DkLj0munEreKgI+DRAMryb+1WfpnIXyD+ADoudguGwe7C+uX6nahUDCE5\r\nhTUXf0k6vZ+LSLO/kZ7GGfbJ2NaE4hBp1f5vMF+yzeBi1vfUbHdHrb4YfqS5\r\nI16Tko/G/iWRG4jseqtIrVMvJ1+7akU0ts9VdwqRRUclWkaIPIwU9xwNWtFl\r\ng1p1yFxaGQOJpawFMCXeIjUudjsNRciCwXQORdGyQGwe1YpkybvA2SKZ8EhZ\r\nkBQRkYHi6FLB/nTrgkfwyQFJ+K7Kedh9RI51laZpGxywjb+zt6fmUdn54KNA\r\niCgzSVRkvXVaidh3jcu0ZKTwnh2G4gIjj8nAsGEBUJ4T0dhQmKV5+HQe6xE2\r\no0jOdaE8Y4UL9k+WrUtJWCGhuOOoemv5+go=\r\n=5A7B\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","type":"module","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"24c678d5c99f5b9a80e9500ed424b0180478283f","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.15.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.10.0_1670511325427_0.7715558721886278","host":"s3://npm-registry-packages"}},"1.10.1":{"name":"@mangata-finance/sdk","version":"1.10.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.10.1","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"b48d8defcae87a4d325af07e9a3310647853d14a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.10.1.tgz","fileCount":5,"integrity":"sha512-A1G9kJ4uwc8LlduqzG123yywH+yzgRFu9qy51UZZ19k1rPgVqLhUEYwBkqZ3fxABaYW+etwhX4HrLHsE4mmo2A==","signatures":[{"sig":"MEQCIDTF9BOi48YT5VjISbL6kt4tMgKp47Fc/9XvImS/l1dlAiB7tfa6hM0u29RunllYGlGu6qsUVHrix7iKtC9ok9HFgg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl0aIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqr/A/+KvLVnaoKYNfRjcgpfmF3TIjwV43HI1UKqw7CdbpnzlITuS78\r\nMvCMmXaf6aUl4qZkj41jZHOtdIZz8jA1/eaF6fq9nLxGIXmq1EHJNe8TGpUr\r\npKjbEkw12fuaPD88xwJ2WxObtDU4uRVFTGQ5hp6ywVpKIzKUtiro3d5ApVHH\r\nS4fMd/TEYTKYIzMf+dEntancn8fwI49eJyv2K7ZJED7805A4SKAKAd5hko65\r\nHCDCa9zvTsa9ew+5W5q5baSSTaxxydtLhi74uklH598GkV2dVyOZ/2a1CIe9\r\nmhjZ/KRsyLX4dl6qFD+hrNklm6zgvlcEwqCjbtX+dbQw6AmDsVL5lifGDTwL\r\n9IQ150rugnA80I2MaUgX5uas5m3+1DJp19adpI2ZVTWGN/tgJPrcljpLWIVD\r\n72XXerUuPn+NByW7o7T4LvoqSixbD2K4UAxSDS1FO5REiGJna/QlxItV9aRz\r\nmtoyWZ98Opkb7QvsilolZQlU/MaDlOiQzFCLbT87A72a42tCfP05QvNudAIY\r\nWLiWk5dFd9IH+vEmQJQp+Rb7IV86jhRMQpYjDaq/kliQ6piOdZ0yL3myZHA2\r\nva9FvMaN3Hr4ci46bgIazAHCKeEG9PgB3X4+qM743bUMzZcydw67z10JnDfL\r\nW9+Ob91NBkxj6jlebmy8M4xw3YjeXhs5WNE=\r\n=XgJN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"ae389a4a24cc390d19becf1a174ec96791f90481","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.15.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.10.1_1670858376375_0.08999895916021661","host":"s3://npm-registry-packages"}},"1.10.3":{"name":"@mangata-finance/sdk","version":"1.10.3","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.10.3","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"37203505c10a78982bd26bde49ee531d8c17c4f2","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.10.3.tgz","fileCount":7,"integrity":"sha512-kKtN0ByOAqt0IkMUZD18QRYNweMbd+VPDgIX6Ri6mfe4ahVVkr336YVZUqAI1+JS2yS7bTHP+q6BlOiJ9w/xAg==","signatures":[{"sig":"MEUCICWryn2qiIBTKEfsDI08oqxageYZgxxpHaHCzVDPrbDHAiEA1zuKldlScAAcVWoq/yyFUvvAU50uWUivQLaHdmjUGi8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl1W6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQnA//THOf6hjaz0rr4PGkXIrgf9Ny/R67TvdtPBxi0YJpMGjlGgEL\r\nJYwmB7fF2epAn7W5qZJryKyp6y0Bb6OCEStj2CHGk8dujoIEMrDEaAhP+UNL\r\nZKyH9vo1/6P9frLmQbRbkARd3RnzN/7q37TineMTP6rdPY+rYylmp8lpXI4P\r\nrNXkwo60r5bsx5VbmzTh2ssxI4Dg1r2H3XhR3Ynwi1T/kP+CojpxQ4hDhX1/\r\nnRgdar3Stk16rok4tHbQKrszh0G/N0XKUeS3TSNRkq4EeCakaLylKmdBj8Mi\r\nO/DFR9CsOynkuIjFCyFAxnEKQuCjqF04mkujBLX6u742vIheVKHiQJpjzmfm\r\nK/0snb29dLJoeMkeJqWzxwHO8DtbrvtLVW0BfKy6DxqKWIwzcWIneGkj9KPU\r\n3EnH29bqLbnchM5NrXl1iwdo4Ig4fpoqRKjATOdUqWtmG7HUIKgdFdJZUf9R\r\n+pVhtkEnG04kqgOTI4EkFY1T8XC3+NlnL+l+aqFz5mdr8OE0B4nXeFM1WmRi\r\nQMeOnbFGYTdMSvwjCqb8SAchlvysBsMm/R141/xUowvuFne072TWfdHwHm+L\r\nzyj7pKecLiv0iOMBd9N75jgpRCEupHhnHgSXqbs8NHanoUA5bpuN+50wowzS\r\n3dTgbhkMKHAPXetFW1U2sTunycPz/3T0gj0=\r\n=8jB+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.16.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.10.3_1670862266546_0.4341707567693067","host":"s3://npm-registry-packages"}},"1.10.4":{"name":"@mangata-finance/sdk","version":"1.10.4","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.10.4","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"5c42f5c74605b1ba06fb2673230da958f9c0a8e3","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.10.4.tgz","fileCount":5,"integrity":"sha512-l/4i8FY5whXCieWCgIFTIRLiJDD+jVfqdpfJSmg3WMiHOn1BLSevCO7WQxZ0M1NSGlUnLW5DhUaErpgZtDo2ZA==","signatures":[{"sig":"MEQCIEY2uUqa7RbwS7Gusge/ROzIlZjugTjBoGigMRYwXSlmAiApV36+I8J2FL0nKoF0jV+XfdK9akdLnBF45so80ypsXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85518,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmEpHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowQhAAkm+X/iu7bXwccWoJvmrad7RcstCxV4tup7wJo/lNNCUZTgU3\r\n5i8MjU6zQAWjAVxWjxmpRCZLxd4AnR33UkiA2ejzBO+Oy7fShAloVMhShrac\r\nQVtjgttUVxMFCxY4DiQ155Wwk22PZEyQ2Ffq+fMmYh5kTarcZa47h6FloZrh\r\n1imEMoWFqu6ZylDjgaIhmf9ZUAL+cVG5d+kEfYBIwxr87yAbqNBpG99LdDjO\r\nHbRm4lJvhBCGj7jLBdONWlZPdFIQ+6DIQeAbVTBkVDR0/Qsso0gdFJdSNYnd\r\nvRdjMMn9CQ0c8ETLnzHfMOdLfefaYBfIUP1usCdW4rWJEprNSv1hx0Hx8OfL\r\ntkHEnUEcoGJpsb/tSURe+EwBtp9NbQqIyUyG27zOwvoKisEDShoc5UrjuLFP\r\nDh+9vCdmS2G6kA6SRUT0wX4y+GYKeRTqHLEQB5daeV7Z80ptINzkThOBB8Cz\r\nZ2pkFg3QkgpR6RURGdxsyWuUTRTvSh6GGdoAhxAIXLVsa1UPQdUrZ0969bVK\r\nzNlhyhP4iZYYPgmlgpXnV79/G0sELIYinsdHM6KCuH1kAyCovB7zrVMx6sXU\r\ntTI9LKc9qix4CCbqxFWh56SfAbGo8F9KLcEoFJDGXgVQMCy/tzJBGxbK5Cap\r\nVX+VjWsmvg8fM2cwQzwIhgMrt3/uaP1YH0c=\r\n=bxe5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"3e8afbf75a1de988671a3bb13140837ce27f20a9","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.16.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.10.4_1670924871104_0.6377978209965081","host":"s3://npm-registry-packages"}},"1.10.5":{"name":"@mangata-finance/sdk","version":"1.10.5","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.10.5","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"2396a266b0fb69fac9fb0367765784f88cbcbcda","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.10.5.tgz","fileCount":5,"integrity":"sha512-MWQk/3Ug+LH3EKKfBz7AbYZn1d66hN3jAGdqFoBnVcRi6lwQo81U4SqAITKjYVT0uKKbyGV4qZjIj0cDdpA4xg==","signatures":[{"sig":"MEUCIH+mEbtbbr0lr2Gwn7bdqdtwAFNVvfZkFDdE5kwopmenAiEAgEBmbI9ogee9VI6b5uS6MPnojELqGr+6SLxbGWlBO7k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpEm5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNyQ/+M9guA74RPEzV1Aa3+putfKE+BKsj/4RbIVF0R3Ber9Zr39W/\r\nseZa/2I5Dw2aDKsYyb+iOi3YTVMMMG95Ek6PtByuXfVcqKBN79Gg5h99zdaT\r\n+7VCzNWhA5zzK1aa+EA4b7EqdscRujMBcVrt0dNvbfZq+6JgDrmcAmJI+Wfb\r\ne/89nb2ShWfaAPRj5N/aWwiJWRwuVsT8/Rmp7QZpD+lzr3gyYhxXwz7ouTiC\r\nJa3HbITXmWWMxaYskAZJX5x9gXrHMO2pERPVIwpAdlJJ6GA3i8NWso5qk4aD\r\n2GuKCz2qmncAUby8d/8U2aUCYW9+e9GDPrAjGiSlRlBdtAFu1yCgJIsEGeNR\r\ncu9AJEntD8KrFihO2xR7J5B/5S3oytwws+bsy1qXpB8j7vX8ub9h0y5y7wpv\r\nqLIwrCSXyxdB8bJy5Kf5aSwfcaBevNdkH79+kf+tAttXnHClLkpcZ4h3AZxR\r\nI+1ajrf9G8imuMmfOAcGb7Ow00PuHF6zmFOT92jKI5u4IKvGmElFfoDMSSzT\r\n1F1a9ASg4u9SWXvmA6WKCT1anukG6oY/xFQ1SocI7iw+g7Wn1GaqCjrDi9mt\r\ny0wjj+MwHzo/x20RW9HroNUPjBHPtba5egQuzVJvn4iKgpsNmOf5IbjfRqHk\r\nLqp5uBPfLMvW2XVbL2uHPlMljEffc4EhKfg=\r\n=1uNH\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"664c9cb6096de907cba4c50d23124dc11f77c1dc","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.16.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.10.5_1671711161596_0.05539284123924637","host":"s3://npm-registry-packages"}},"1.11.0":{"name":"@mangata-finance/sdk","version":"1.11.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.0","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"54ae23e87dcf8f4faf9739026ba0839607b55143","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.0.tgz","fileCount":5,"integrity":"sha512-B1ek9zNHbIsgMK1Lxdz/LIGoc27DF9aMTNLMM/HY/lDbt9krYVBFYcOofO9U9X4CiyWp39U0HuIyw3jhTLHnzg==","signatures":[{"sig":"MEUCIQD1rKFEtEE+tbyga4sia4NLDLZmrgLsDCF+JATb0l6h7QIgNJIOru5G1dP7QYnWQn8wnN57Go6CNkxsyyojzKnnLNE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85597,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtpKKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbexAAluCRQTZlvuHSNXwjKpv1AHMDiVlsjofi7UmAuVcDYmbLkkUy\r\n7GcUUNx6Mguz+I6G3/4XHaRbdi6o55W0fd7meeiKp3rhhmNw2HwrDiQpav+p\r\nkLB8sIyhwTE3vlyHsbRAhRy0alR9/fWXW/1AOvTd9Sl4ggMyI05954zhJK9r\r\nRTFF0kGsyd4YQZ37PLSsp6O4L7B4wML08PcRztfWeprt+A5iNmf7T6qKhAcE\r\ngiduT3shdteVkUTaigKO6TYMiuUHc3sqlcU20BXMpE+cvsgWcziKBtWrqHOL\r\nwmsAdIMYgas3OOSqAldak5xVO0NC8PL6q785Y9x34UvNKULS5EJuVW5jWqrM\r\nezadSZwmBjTIWedjvBK4wr14YhjhIn4pBahvW8LpWVpE5ZBWxqWrShpbr/96\r\nZHms1b/soxlOh71s9WeWZDDzckhBAFXegjnQZBpr01EzgsNDCyaDJD3/pXpB\r\n+5BcuXUJf9SkWUaBrbudNsrvW+KBvT81hJ86E5xH4Z5mlCJBPgFsXw3auuX6\r\nM55MjAp4WSHI3ysoPuzZoMTuZTNGvAKYG7cRmycnaN/vAMz23+ayqkxPjqae\r\npw/4FMOsyhqt4NnOa9hOQ2WIcegYEh+fEHqVlN21J2VtXLaKJeOiLLBbDMz5\r\noQdp4ymJqEv+KEoLTqLkTgHf+PFdWHNB4u0=\r\n=RSAR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"f3e896124ef15f3bed87d6348b6d0ea9ae7348cd","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.0_1672909449996_0.42635223257113264","host":"s3://npm-registry-packages"}},"1.11.1":{"name":"@mangata-finance/sdk","version":"1.11.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.1","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"5215668890c2d51c249b4c833e1fb747dc4e16bd","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.1.tgz","fileCount":5,"integrity":"sha512-wWENBLW6YYpqqjPwhDPiflZZdysLB+7GANAjZeQKMAiuTtSKfD8BJHgdvUl+JdjTYVakGgc+iQDVBoWr3GqP7w==","signatures":[{"sig":"MEUCIHpmVe5v1lOjIlU2Mq1vYCLbFY/80Wza/LZmh+PIEAb3AiEA6O29Drzyg6ZEjflmTWu2TQdt00F4CHbkyI6fQthOirg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85701,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuDFlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVYQ/+JvTOdENpfh3mkRtLpzKc31FjH9qq+AQ6gGbLa6l56k3OkApd\r\ntM89AjmyNu8i5LCMu+j7dBNiMbE+ahXs617MGn855Ec4lzdWLJFp8j93bPev\r\n/6QtOd5XLUiZyT64lclmkLlWxcGLrn8ImD4baHY27h/Qw71fQobR/eYaQwQ1\r\nrbv2WSkK1gd5ihGQaA4lfu+x8O7HgiR1O4NNkZRRAVtQgIkZU6xY3FMINSLy\r\nmKIe1J8c0wxhB9lnNdFwtA6YLMBGZ+b2STsVXgKqry/AA+f4w9wxu0qMiMIP\r\nIZr86PWqxigDn9jw4ibr150jpvuT0isIvdNAlf735tlhh8l5r4atD1cwYv7a\r\nskc2M71AyParTb9pM/eg4gBgYTitQWV1OFUyhn+Dg+fpx8+k/ViUPrAfyUMk\r\njT25h99bD/n7QOfluGbM024lDXTuqOAjxRkUUxLEbyFj68q0YtPy8cTJCH1c\r\n9U+H740fKyXvr7CwYXd8AV3BwOH0+w/IaJe8H2q/ghazkvQEdZw77OCBaRZV\r\nLX8tqJ0hhmz4/dV/N5o/2vxK0g8ldUNZxYnx4sjEi6W6wGLcDX2ZLv7uXPfx\r\n+NALTQL/ICfQuwHfeV5pGU1QHd0pKJixPKxWTYkR4aS3JzXj6K0sTf5Xu1lY\r\nhu4vZC2VOwDfNs1SwavxjbjDBh2gkP7722Q=\r\n=62eL\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"d75a57b916800c80687c79009e4fd88f5597fcb3","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.1_1673015653334_0.03857672335613627","host":"s3://npm-registry-packages"}},"1.11.2":{"name":"@mangata-finance/sdk","version":"1.11.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.2","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"3b7ee0afdca7fb7af4f2b5ab4baf8245dee5366c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.2.tgz","fileCount":5,"integrity":"sha512-BeON5fRlACqH9DQLHEGN3NreeOS8msP80ABFACeKSMcnIh8zJdg49KJz+zNxR2j5tEjZst8BA08NMT8bggFOMg==","signatures":[{"sig":"MEQCIQD34qav2/Ib/s6jkJ8nPEvr7UOTgbK3pggj4U6IpgnAjwIfUrSrhcg0wcva9WXCm17I/2b7c6CotZIkutdN+35Q5A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85735,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuHe0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqahQ/9Hhe+elUj2aqEqEEiJA7AoGNmWpp8aGWTGD1Vinz6ejzehg2B\r\nPl1DKoJ22eiQN2V/8oNs4v6s+bMnx9at8t3zgen++lTvTS1ZE4b/isTmoCcV\r\ntwhPf5g6QKxR23oLctUdBgeqHkdNS0xbc0ztgAbLECLWmxFdAoFgkgkzmX5D\r\nxkYdEp0ujOZhCba+pDP1xyW01tVCVtl+fWbrp22UBRUgHHTs5eqTNYpALokH\r\nD/m0otkiJUCfoNmNHNey5ajRshTbGWoXoYppHx9piSugJt1ij/c9jhE770uj\r\nioaCfJWYkizdpBv/0PyazXGxKBCKPli1u6eJekR2YyUfjVvQeJIeDBxEeYO9\r\ns6pL7nxL2CpPrneAIRxEUH913lRKQzWju50+8zG/7gruo60llLxpgg4Fb3nV\r\nI5DwvcA6qxosTqxUiUiNF/5rWxYV+Zgg4hqIBXi1H007aWGSm8IGMx5g5WC9\r\n6KcsgOb3O0K2RI90QYy/TyQdRCEBa+6i082pLRy36+WNQDBIxuGvRv2cQMXl\r\nCCt/v6OFMm60ndlsjKAXTR+Jo8rfp3Va1w5YyJsyWiGDJpiZWzav4mrZl9hG\r\nubPT3ikkt+fO66nop4FKmevyoQuDoxjTxXX7WimUiusskURhAhkI/39zlaRb\r\nWR7fLPWrh8/8H46owgGsmZ3UEULbK/buaKg=\r\n=ZgYA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"2c3a3118e9b6aaed1a08413052b75416e8c4a5a6","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.2_1673033651861_0.48637382914158356","host":"s3://npm-registry-packages"}},"1.11.3":{"name":"@mangata-finance/sdk","version":"1.11.3","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.3","maintainers":[{"name":"andrejmikulicka","email":"mikulicka@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"9e3cf34ddb0191601614d6c5ec6cb818a297e7d2","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.3.tgz","fileCount":5,"integrity":"sha512-EDGkOvOb3rH1u7jRIx4nnbankSbJwJBlZBjqRY5sWko95jPQ/uFhxL/i/jgR9FK0P1aJtTHTch39OHAisH9DFA==","signatures":[{"sig":"MEQCIBfmtfYYBn+vpqcf134Tqo+UG+2I7U8wyaxkdwT+0LryAiBP6dM7MI4DeOhAsZ98a+wUktct4Svocb5Nfhy5cDYXDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86271,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvBZFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNLw//Ro7u1w0TOo7+bVdgPo3tIdq/E2CPeNXGkU3oONivR2MJpof+\r\nSeGWf6ECUs+J1dffvV8DlY9XrJSBf61vC8Hgg+5pdHmtitfQDkYy08d2BaOw\r\niXNFNVp5O3OkvKMHTObBdHGt2IR+pilpNY/Cdn4SV2gUgjdi/OF/YBhQLUj5\r\nyz3sRItOiilaN8G3ePVGp/PVDQ03wr4ETGe1XtSvIliw9xVZyJBlbJ7lJU7l\r\nf4u5PAP32zGJ4N5XuPxlvLNXhFBUtqq/Kv34PVEkfFUgS3ZY0N+Bb5MIAl9T\r\nnY9G5GuAQkJBK77bYvuanY7XKrWO29y3EVIleTr+dZzGF4/MP581psvwmnMF\r\nGe7N9htpzjDNl1muN32ZLqKaERhrA+/BmOboPd4+db1eKgJGxq38XDszPFBD\r\n2BU/On31p0zctp2iJKCFEwOQ16LYclnFLvDV5Me6tURJFEvoG38SZgLc5HH8\r\nV1v3wWi8sTEniMN3QBII67oPbl9h46cp3TJEeQqgWI170EoECVx8ZZEmFuOi\r\ngkMrX0UCi/CoRS2RX/jWbTHUWcSCazR/GZfS1bVDRwuj8bfgH2mbOhdrcy1i\r\n2niGxYOm8jFTlD5Gc66J9l5Garzs88vAY3SzIRoUPyqCt0W6ijPAYHhL6gyj\r\nvgt/BKAghsZnjhBWI07EYhoTTA3h+rbRav8=\r\n=z2pj\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"e73d88898f8cdd71bdd8dd39b2b44025597a09ab","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.3_1673270852993_0.30662970814904766","host":"s3://npm-registry-packages"}},"1.11.4":{"name":"@mangata-finance/sdk","version":"1.11.4","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"374d1736705cd618d4b0fb98560d8f7ad902b840","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.4.tgz","fileCount":5,"integrity":"sha512-cZ6cfMNTWPRmQVr4P8upul/ny1zeIFLWlONbrENrw4CIV6lNW7Ry8FeEFOk7sqO3YFo75Xp83Ynor+934L6iSw==","signatures":[{"sig":"MEYCIQCx8FLaXq4uRlES3oNwfxqkFSxOORffDCv9vT7HP9++zgIhAPsqwRnhAikC3PlG8wWaDBQegHA+AfudxIk17/YjqUk5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86057,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvVvmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFsA//djTFuTp7vWq7qzYdJpPo6aXZH8T4wMpjZeiTM+NxzbnChbv3\r\ni+57Q/7sl6lAB/Bq0J1GsS+juxAAuPgWyMwri6VnBTwWj1X+viKJz0pohivW\r\nEKuHVLnEicklKZ40fYde7jUPtxZmXNcE3SE4hJH+G7xcaEhg6XcyAWdVIql+\r\npbgCzwRhfMKcbQPqQMXRjzT8+CTWQaHsCkm5uet/laPVzYmu+/sK7UzyR0Sl\r\nFwJHI3t0HL1+ZBBtTx6xUeHYcvvx632mDvPq5Y0rj120htTM52JFPElxr4Jc\r\nbfCSV718neeU7ReIwg5sNXpUlG38ufoLMZW6gx4+OhI6njFK99s1cm7tbIhD\r\nujw8LgrmuDf1euochwYwSX6dv8TLgv9Z3ac/KUGMgJl1aJFzWujvjYCxJavK\r\nG+iE6Xl6EYACo2SPFDj8jZKc1OGAw6EcGZ2UChw5eBlZ8a6pQQ/ortOheG7H\r\nVJoCXK0+0KbioOWQqqZYJ3HWsF/+z6Yj5WfeIHZS5G4nxuwfEMBc0tjsFSn1\r\nAMSgRmdNt4fNbht4+DjQNRp5SO7Qaq+Y09M2ZPBchlCoCOtiJsBf8UlEJC/A\r\nr1xhjuPxWPI3e5F/6gAr1RNyqVcaY+nIF6jNv6rwQ4J0gqCRGNaNgBsgl/8T\r\nT3bjW1vSk1tFYOKtQByDd0WF6ZzKvVm2tFo=\r\n=yaR9\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"2f3ddee33854af689152cbf653f737b337e56ef5","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.4_1673354214476_0.9989706374097622","host":"s3://npm-registry-packages"}},"1.11.5":{"name":"@mangata-finance/sdk","version":"1.11.5","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"092e23d0e1846ddf23d60adaaa90db6e7d4e001c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.5.tgz","fileCount":5,"integrity":"sha512-HuOzcztgVaGD7Lp9BX3SBZo9CqlMT26Ei1HIk1GrasDPlcR6dNitKn39ro+Ld25AQVprjv8n77kvb5x/QlM6Pw==","signatures":[{"sig":"MEUCIAQRfiJPggcsPtdEtvRBFMNhQ3uNVlkF4cxS7F7L8bSGAiEAkLh4oQVIiZj6Yu/RFDlYKUKYZVsJMDb+OJ9B0voWrXA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvoB9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqr+w/5AYt35YzDjvKNZePoylyGCVkqBXLjntvy0oy4+Wp1Yy2FI2LN\r\nNE14hWyj1N9AvvuoZ+nnlk2ksN0Q8yJHSslXFWADN11+9n3ABQfB5HZwXuMO\r\nfZd7CPn+56Xm3U10xap65yidacCNcoyEdw9FMYUMAjlZq+hB4q4ua8Fmi+Az\r\nEUAnAQfgLCpBsYQ5CdxNv0Q/MtL8cId4+MtTf5Y1XVyen+RLscKPs6GzIpFi\r\nugkf4SPA4e2Q414Zyg3BsVULG2eHXhaivCsSgWXZf6U1vQh5owFmP8FXBf0c\r\n8mBX1re5U2qpCzI9n+RcciZNjwTX1D/+7/HlpmstT7QNyI+9H52th/KbNt6m\r\n7vlJ76yfc+Z/mE6w40BW8QdEgJ628MAEKfGXtYb2tQAxc6L/ljfqWBccm5RH\r\nOTzyrCsjuDeKnRzI2QkfulC2RO93JgY+EaWXoi6f/XV7F2UZbLKfcsGNMXw7\r\n3vJEAx8eS2pOxtqXfpEbxyZ6LUwqFONtAeZmtI5girPMoXRkFLTK935LXASK\r\nLJgSQXia0aIqTpfUrsvrlcsboOBie1cq4wv0Y5tkdCDvS+Vtl2y2uz8uL+k3\r\n+9TUrqpZCri020Abm3lXPk04F6Ny4LX9KkesPyU88GDTWOGvHhehnyLV1PxT\r\n8Ht6GQPsYQcQtylzYIMbKOiq0qf3694wRmY=\r\n=+Fgl\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"fa6b7a839ffb6e386057250702d530ad36037bce","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.5_1673429117519_0.8328912649992954","host":"s3://npm-registry-packages"}},"1.11.6":{"name":"@mangata-finance/sdk","version":"1.11.6","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"bec49c85be723b6ca10601807ab99c59dbd82662","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.6.tgz","fileCount":5,"integrity":"sha512-M7wW/55VdRbp+yfR40SadHHTUaVQcr0n84hNq63N6Mr4zpi+QYCpWs85Uim0qz7E1DtDpVyopK5y1acfjfsBig==","signatures":[{"sig":"MEUCIQDt3Dfmf8Axk4gD3iMYG/LzHq5b/EG41jvrRsJQWvwJBgIgQ5JmI4YeGeT1KLG82XC1bSugF3E1YMkqNkQ/Y19FQ4A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86301,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxnMJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp5JQ/+NjaRyya8aJ4wzF8z6zNr5QPH2RLdLuR3sbAk425jUDjc/TIz\r\nOyDIxenZEtBtQ+Ej8gtWHPhEvoccN+Kiqpc0d2cxxvmJP/1fAN7bgUeAfC0P\r\nrbiH3dtjIt0seaQ92jSKUO4GSrIlQ5vCtZysbNNPP4bYB5WE/7WC9+6NXuqU\r\nPAi7IJ+GbFNPLfJ1tnqR6IEoABSUehKUzEdOYUSOMfvaHLpLBnoWLJXesb9Y\r\ncW9HEldo/eu5oLuABpFY4OQ1NC4Q90pGC2iuTuiKbvobi02VLAGEL1+21ov5\r\nIWhkTC0ogVR0c5bdmelrjwASCqFQEG6U6yL/IwlTBR/bMqhzCLZZDNBdGqA3\r\nhPG9apYpnRnbKe50GbooHccB7ydTFmn4EyXw6/IcZe9enNafWuTbWgyxM5O6\r\n8SXUOk54V5qZ5bBefaEZuuJdoEDUe9ZxtXqI7PmEHpbkVPyWOG2ua3QIo5J0\r\nJqMgk7lMNiYOJ/iBSZyDzIhnTsr2SNzlDMW8Rv1lBgDRa8v+wmOwrjlA+Scl\r\nj2uhzRcuHPT7kIBM5VJl15oyjiSlXr1x9KfzgErA0S94OvCRcyDdmJMuWGfT\r\nz/Oa51osA6Fd0mVXQsFuze43aKIaxPQRuDIbdqiMtPbVxjXAVgM9ezTfNxYB\r\n/BXFFtCic0ol98XIIfjiICsLKyZYzhjZWJg=\r\n=DGKR\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"5ed5c16ccdddf8eca8884b23b9e8c5d2e41dd377","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.6_1673949961180_0.26327794556411255","host":"s3://npm-registry-packages"}},"1.11.7":{"name":"@mangata-finance/sdk","version":"1.11.7","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.11.7","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"d837b122522a606cd029f23b947dd41f31110ec0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.11.7.tgz","fileCount":5,"integrity":"sha512-XIPv2sfVUWM8/iG4qZoJs3yUo7bBIv6R/3uzWtmrt9ccdNVIibxS5+OeEm0mWdQgtN3UuVLsOjR6E6zV2cBbOg==","signatures":[{"sig":"MEQCIGAjuBsNbeHptiX4jQ4oExobvsKu3d3N/3sIPCxUOON2AiByiUagk7MNtdcgo4tFnog/Uw9TQoI+dtUozJG5ZwVqEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86461,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjx4wvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpN5w/5ADknn4gGJnXP4VKxpLriHpGQDUfhonN+Yq4dBEhmL8mZONpk\r\noDkWGIwP7C3yAWyN0duaoch4l6Q7ym0euH9H8/2Qb/GuOmrP1F/j55sehotZ\r\nlxhtuMTe4iFTKAFx1A07HWwpucc3klSS7hT/alrvYyy+Q9n7UStHYt7KkTDl\r\nNHg2phhTu4XosqgxvEy2kRgJMj66bdU1nUaCaMpu+qVhr9mFzYJKA/vaN4E2\r\nRNZJrhikyvEdvYlJqpxmV7L4xdhyaLsTZDAEfnZJ4aCBsIDlfeT1DPLI0vAU\r\n6+49YOjM2edmSxn2+xPZ5LepqZwsjZEtDlQPBuLsjE0OZwwR3B+eY9L7eVCI\r\nqgs0F8lpDvhdH1+xr/fQxcVCyL2kK3b9rgFhxfEocD/fyYGWKjd2CsOmHk/3\r\nKu2v+fzp2eC8SsypqsBawkKFWtmFkvK3yx599r7Jt+fLk6gAbZm8T7Y5pQiO\r\nNyGL0JOkgjfiJUVaXmkQafDSCmkQMzDUVL4V9cMKj9KaeHyt6n7F+NTtks9C\r\nI95HsAkhFx06LAcqoigUzqOIVZnxYkXLJyjKY4Goac1O72JVSTJM5Xvm07ua\r\n+/yROu7qsrODxcxlHoX+fZtDMEXqQqbAiy/DwfcawXScCxq3mhPTeHpYSeTh\r\nmy7N2GVoRMA8oBKxoFBG80Zf2aAxHRsqVb0=\r\n=ek21\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"f28751a34c0dacc75d4e0bbdeadb6665b060aae1","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.11.7_1674021934851_0.10694878996361656","host":"s3://npm-registry-packages"}},"1.12.0":{"name":"@mangata-finance/sdk","version":"1.12.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.12.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"a9c455380ebff7831501d1368b2bfe3e73f17ff5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.12.0.tgz","fileCount":5,"integrity":"sha512-4qmNpQFh+9PXxuJMbly+O1Y1gRVVHrlmcV6izU6Fvzu5O1dZPZdzbdiCzh7fNmWC9fnCWI5a8BKa+NpuCrdB0A==","signatures":[{"sig":"MEYCIQDe7zKkoT1qDkqbbLKxb9kO4nlvHmIslYDDU80NIhVbFAIhAIXHfpC793KyZDoAXKTcCjuEK/swfkXMCg+TJnEcrbzx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyuuiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoTpQ/+LHL7EJTtZ7AZh+0NFGO30pUDoRJoEHBytLz/JNmB0+k5nTCb\r\njlm0YjO9qLDdlPUZ9GO300pFFoFFT08UWvd4Frz/7xqUVkK5XuoK2zUPIFzY\r\nSB3KnRwe+YNVaVQ19pKbO4X4UuvchSv6eqMgH43vsvnJusugRD87b7kyklRS\r\n/CHNNup3WzMYIIMuwL8Ztdh6HOHFG6MgAyxLIN2A73JfeqNtB8+U5FzAnehK\r\nRnt6/VARiMvS2tDduw0QRVesRd0sFVjTcIYnWCuDs6EuZuU0v7hxb4kxFPUN\r\nzqsQ6CmzHvWokAV3dk/K2GR2aSZLrHPxYgBXlbGdNS+CTEZWL9nfAiBaZwjW\r\n9+ZHe1AB3TEYmqe4XMAuyGJgMl9jVbZElLbVN8hMVoLN/kMiIGLefXpy41Ql\r\nuNHj7NovVXSLhdtc8EKJsdLJLOkI/mLjJrQCtwi1lHF90uNmy8/jYIpLhQmT\r\n0UwuMNohYvkRmHze51jzItrzgYcZdG0FAcnvteNL/4O9jyT05+aNYa/rzZLJ\r\neLCAHwUfAy3IIUczlnaxXQe1rN9EwXfV4RitAZRQtDOBdfKS3W6YUsn1mVvj\r\nzGBjqILTQaOZlN6lcNC4KG7w6ttaMAy6A7Tmhqj9qlAwpjrcYv830Wnap3yW\r\nybhYYttVQQmOa+5F2vXNenF1i03MTfUlj1E=\r\n=9+g0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"a4581e368b2bcefe4bf6f6f4606f7b0daad7e178","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.12.0_1674242977859_0.13185005298753127","host":"s3://npm-registry-packages"}},"1.13.0":{"name":"@mangata-finance/sdk","version":"1.13.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.13.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"1651138559b11099fa922fe2f390bd2d5ec7ad99","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.13.0.tgz","fileCount":5,"integrity":"sha512-u+9AveH7t1e0yGmq57Z4DmVqURxGRiL+apDvA/b6Q8Y67ZfHLY1rzXPX8hVsPYieHQ7E7f+GYy1etokLFJ4d/g==","signatures":[{"sig":"MEQCICAz1Hkdve0ghcw2gc7/7QcCW4+gvwh7V1FboPlKk5PUAiBJUsI9ofggS2CArbR/3abK/xqB1X9B638Sr2QK3hyuEA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86729,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0RvoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXtBAAnkfrdn1B5Gz3cqLkH2+yDTlh6eD4IaLaSUQra+Op7GPVi37Y\r\nhO0DC8e6hha9KsNVMQ1tFm0gGMkG2XTDJnA/w7JNk2O1X1bXr50zQEg8JtzE\r\ncl1BoyiBFjzUhXqk6RvAcYoO8tbL7AubdXr6H7MA+sGIEu/4cBD8QQhViEm7\r\nYOhHO7qAbgFNnrhieyEnIcT3VHaPk3IbK8gq8UTjAAEqqBL2j7e11awe+j+A\r\n8iAHxTidSso35tOsVWqF/cd5TxPgX5uyJk3ekZw+4ACUL2mI4L/2spMNVET5\r\na/C5Wz+uiGb6ZoJMIwyuY70/1vhuvaLg8YONkaYoCzYerpY7iQZG+2ambweO\r\neNjw6EQ6EnLjRL0ciifOEmg+2jkgqb6zgBgPXZ/uii3YanfpregZoV0uOUgZ\r\n6pSyBEWUa3tRKc/OebaMJMYZtbvhqVgy3udU2QZMHsq+NsV6VmcH89UjbG+D\r\naz3b9RYZSr1sOdW+RFcd0ApDYXD6LAzUeI5jl6LzYo5gIrg9T0q5mNJ3EG3R\r\nJxIskyBeY3hLgsZYgpl9Yl3IfOgPxzbrpnkIQk3JxGN8joevrrWURFiLapQe\r\nCkF4SNnQzDfGHkc462UYPL/t4Rar4gofeaHUdOo7qGicme1BMJ9BvuS+6RAq\r\nZLLp/9YTX4oNQM9XyQfAl9V9gxeY1RKRONY=\r\n=VVX3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"ce41cdc1a81115f1c14720b511e81273b5f24730","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.13.0_1674648552647_0.568603494522","host":"s3://npm-registry-packages"}},"1.13.1":{"name":"@mangata-finance/sdk","version":"1.13.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.13.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"ed693e1a9ea9687144c5f63c231cacb118b8ee89","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.13.1.tgz","fileCount":5,"integrity":"sha512-CjEJ3Uxeuemy7ZjCL0YqT8ckESLtBHkd9f9HXIEzOH35r9EJX/Eyd9FXLbuODJO7hgHZOvfGFurx+YkBVPZ0Uw==","signatures":[{"sig":"MEUCIDtFeLocrg45CoboSUNBEce28bn6Oq47wv/3neAesWASAiEAqtk3FJtAyJsJTTlfWjtkKg0hBcRn+89nRuRj8sNxgUE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86653,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0YqdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQ3g/9FmUx019rYe2mFFNsDBXWraIOiudpDEVgO60rgas5f6pTXs7D\r\ncCzrzq/ly4vrWsK0bXwUoIxVJQk7fNrQvAUXOaJq+gdV50qVuRq3m9ZpuzAL\r\nR9051TYoV+ScO1tP8yDrBSrIysCfFmHTo1Uoo4TJiPhHohFF6UopWilHBxgH\r\nAgAzouxsf8Q9tCI9JR0CDdkfa7fxKNukDCJMFQQ1s6JJtX9UgT7FKgOzvqQ/\r\nuRxhF9ZLSipS6a/VOpGGf1pnGxoi4C46pTJlCkPz9waYDA2JRtif37UGbvmd\r\nNt+jjezrwnrP/EwbMex8WZ6UnBmp5TQ3KEAK0E3ty6g4EIr5kakDBPaHWL9v\r\nMpTO2Hzui8ANoXM87Q2grK863zTw7PuGisUxb0w6jUik8kkv6oCJqXjIMTsc\r\nDyq2vIeRQuXQ0F2klxidrxDdcNNqmsa06a5aIJtbQo8OjkpQc7/Y+xl7BVJb\r\nf9wwbxF8i9r3dRGLh/VyGAAgEtfznqmX3vtTEm1CqLdJFKFBlgrzYMSf0OVT\r\nuKuBYBoSWS4HxS4/iwEBNn+PcDV3fRo19Is0hVr7T07M1c15lNs4gqdSU8fB\r\nykDdZ8MWJX4IW00Lu065EDc21agVDuo4E9qyZsrgwMeWiqhOkDmnhIoROcWq\r\njKcWZGTeWodgOM/GwQQw+yV4HRpLL0KmZYo=\r\n=F1R1\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}],"@babel/preset-react"]},"types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"78aab47381cda6a623f3dfd6a78692345cc9f7d7","release":{"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator",["@semantic-release/changelog",{"changelogFile":"CHANGELOG.md"}],"@semantic-release/npm",["@semantic-release/git",{"assets":["CHANGELOG.md","package.json"],"message":"chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"}],"@semantic-release/github"],"branches":["release/*"],"repositoryUrl":"https://github.com/mangata-finance/mangata-sdk"},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"commitlint":{"extends":["@commitlint/config-conventional"]},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","mangata-prng-xoshiro":"^3.0.0","@mangata-finance/types":"^0.17.0"},"eslintConfig":{"rules":{"semi":0,"no-var":"warn","no-console":"warn","prefer-const":"warn","arrow-body-style":"off","prefer-arrow-callback":"off"},"parser":"@typescript-eslint/parser","plugins":["@typescript-eslint"],"parserOptions":{"sourceType":"module","ecmaVersion":"latest"}},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.13.1_1674676893572_0.7086494097133313","host":"s3://npm-registry-packages"}},"1.14.0":{"name":"@mangata-finance/sdk","version":"1.14.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.14.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"b6fd6c4f56bf6ec37674c6259943e627e035babb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.14.0.tgz","fileCount":5,"integrity":"sha512-qhOVhkhG6ZfNJi3hCeNhgRVb4bWwP06a/bDonwSp2JyOoEoRa7Q7ug9Iu63UARVUUPVRqwsCVjkk7Se2EwFWxg==","signatures":[{"sig":"MEMCIDHkPCJB3YVk3MgHRacF7bGy/13VeYz2c8fHhSUBIWvLAh9Avr4sADOS8iVc5rsrABMbxqW5LkhamGShCzZ17ee4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81791,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0m0cACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4Og/+LkQUfazDQtil4IeONIxk6+SotvrYOny1ufa3bgX7Wfzvi3lw\r\nkSje0cYnwYawRLjeASZRDsS+hRm2Z6//RjSwcu86aUu+BGSTG1+mIFL2NPiG\r\n3v8sRUpfICeHguKZEo+XL57pmsNf09ig2lilvX+jGOX/TzzTDnnP4WKFxH7K\r\nGGbFNLKMwOC5buE1lkPJ/YsugxcCF0dflD8qrNwD23keFV8dVdz+IveUcwKI\r\ndp9cU1oiq4CC5bGNimodZB0QnVaH3D8yaoNMyKgLiCrx4yj151tMjPHw2c2K\r\nZ60LQzzq0H88IAR/FJuH5JGxXDyhFmkbeDLB1d9NwYu71SgiugMHqF81Yesa\r\nM93E2+5VA/PC8jzPqfk+dH7rkF3jAR0rw9KWy1smbkYmBMua3VxItV+95TjY\r\nwwzENuy6wKJbryvcffYlGxgWCIuM10eR0oeToOK/A291zUMwtRPIAWim9bZZ\r\nSyOBzlv3I+h5Eup2O7zgSMtb1e+KOBm/CrWC/Fut4xjX9uhsBwR4D2ORUnSS\r\nv7rnnVA/Tm5L1Acs2s3nMR3mjxLqoZGdq+JlJDrHJEvVsd1tC/VbDib177U/\r\no7jpPzODYLW7kCqXP89WpAK5nkeuLzqm3TYOhlRXO/carXFSg0kTJVai4w+N\r\nVBpfW78O0CrmXGZscIiOlnH7hcg2/g9BU10=\r\n=WdWm\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"c9bc407e6800e98a29625ac1b6af86a1ebac0655","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.17.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.14.0_1674734876468_0.8576492926913697","host":"s3://npm-registry-packages"}},"1.14.1":{"name":"@mangata-finance/sdk","version":"1.14.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.14.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"7ea0696a75074fb677d67bfa83ede5df39da618c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.14.1.tgz","fileCount":5,"integrity":"sha512-UbrAq42OjWCpZ6fiNaGc7aY6DI42qV7qutf6GW6M239adAKAdO155q6IA7t79Wl0CG+sSIdIn+lZq3uIBVk3uA==","signatures":[{"sig":"MEUCIF8rPLem97g2uHPuvXG7+wrxS0hzksCEsZJgZKLezhPUAiEA5yAt/hZv52jQfmYP74yB1RniZwz77hg1wQuSUOFTy+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82245,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj06BeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoKIQ/9EgtD4lJwT+lWpDi4Ht5qh7dPasfm8GrX1unEOniT2dpMz5s0\r\nxUtUETIW5N6aB0o/czVcYo6z+PymnA35Kena4sR0AQ3Kc75CHnBtMYzgXZk0\r\n+0135abi18rl8+nzvXWzasI7nQZqYuzWV06kPuYtf9ChxiucN1xL92l22j3o\r\nt+KXeaOTmIgbOJzDMrWdfS0b3mSQ51bzFGFO4/CgQ5LJJwPdLjpsbp1QRhUS\r\niGOJ/g8/aTYNnwHjPSFzfd/iX67OID1uON13L2/+A4PfxTHIh334phslt11k\r\nBeikamP8DeKGtJtIij3nmOhR2oZfK9NzFrUelwzB2p9hfaxdbu9t5hAudRsr\r\n2HdTp1dclMSoor9lxzUXdSlTdPzuVHx/MotcPBJ1eGobEiQ/RovmBO4C31n/\r\nyoXg/SBhJ6yuDH+HiKPErYxkTO1cdqLAjNRgcfsD+vbn5YiiEZNwDSsINYVz\r\nPszLSvGqiFL1nh2cuNg99X+mpND54mRPM4WHsB32HssS3ITRNRQ2sHxE9GbJ\r\n9k0RI5Bu72z88hhKA0teScZyIWrK7CnVkmYMX/l9TyacgrFepqIQ/7vhLIS/\r\n7hXE2EVQkwQAsYxYZf63+x0rc6ku0B/6B9ZUfC6fJzk8ltGM6B1p5TFuSxp7\r\njo/UMY0aptLBd9loeKbErrw1Crt6fCMR7BU=\r\n=orxs\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"7e630a4a31dfdfdd50297c0e3b4829d39d02f84a","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.17.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.14.1_1674813533794_0.3449596278049267","host":"s3://npm-registry-packages"}},"1.14.2":{"name":"@mangata-finance/sdk","version":"1.14.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.14.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"59188cf2066c3d3d9aba7afb234e8822e034e368","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.14.2.tgz","fileCount":5,"integrity":"sha512-+ejMTWv/drqzvTg692Mzvu6Mdu6Wa9UsjFIvjQTSUNvFJu/kh3R0XPX7fOXWlN4tXjMpjkEbJ5P6u4MLU2ICQA==","signatures":[{"sig":"MEUCIQDolS86IUsGRvbB7w7lCo0NacnZjx12P4DsT6Xl5ZzcqQIgGPdf9hmegmIdF+Ru2Fh1vjy4bGimzfkbxDSfouGa55A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82281,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2jHIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUbRAAnwcRvCj+H6nXuq0v1BC/OFXIPsMJ4LHBhulPft0qK6Ac/x+k\r\nmFeEsC49bhKdK9im4Z0jlRF9ImRSvzcf0cm62H8nOm1ZifU34pazROEjhRYQ\r\noqztBnVHWmlDo8YiSzuDPUQuFFAKHTN7Bh+M/U+uHz7QUAVznXNDZhb33dWi\r\nogPyBw+w8FqKtQepDlwcMynWZrb8kb8/O2W2E1nKEq0rL8KW85KEU0DBYBxv\r\nJbnj2E8NTIk6PxgbRQqoteaQWNv+zMwJetsH3H0oIVcBfuFbVG685AyrJs5K\r\n2pppWaLFQRrjKOP7rg0oOjrl7rhU7AFE8AtKdEeDp7m3veDzBv2uoGJ0g56o\r\ntgujizT+ZgQmje2C8hSNp793LMo3PILqHgS6cLENMGT5w6KomyDHwuyqUrgn\r\n5FwB250u4/N3ep62kptWuj484sSi+pK89AAJ3FH80sOKNmNrUb17cxrLJa8A\r\nHHavVQ46DebjOLAgUtpPRoT2Gq+s9hpxcxn+N1m6F2MqFQHY7qkbcETyT/vZ\r\nsBl5sFInKGPldj0vk83kvkOYBC1LKAd3L0l2Cu1dZ7k+HgY+WNiIC/euqemU\r\nA2/YnRmhcL3NI2EUq5UM7GkpU6HY/hAudbBFBKA8j9neJALTXA9HlH68E9N0\r\nJpHXoFm1AZDNzQoRvjITDKyiK9/MsooOQqY=\r\n=bfZA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"9db8424a570d27e0a18fcd0230096a48922d9de5","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.17.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.14.2_1675243975851_0.7942259679766299","host":"s3://npm-registry-packages"}},"1.15.0":{"name":"@mangata-finance/sdk","version":"1.15.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.15.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"c3351eae619275266cf276cdb4a6740951763d5a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.15.0.tgz","fileCount":5,"integrity":"sha512-2oQV6AxCbIUNxP8QpeA2P9EHPa+hnlKZo8K2bmpBahNzLTvtwt0ahPsFlYpEzHCosxsL9941qCwOdUWjXNPX3w==","signatures":[{"sig":"MEQCIG75Np5PrSdrUsbrWj5eweW4b1DpylS13g8eqq/I+m4fAiBe3crczCLQYV6k8y1DYalhjBCSrbPHLIwEXCqXVy2hug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4lo6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrkA/7BtNeJQnR6jqPeWKlNjq0eYHigcJ1xVSQIYwn9j51sczo+eyQ\r\n+jaOmZHB2/rUTL70fk6KDVAGfGnScWZLWpWg7Sfz8YEIwYUSbDPG1cKcorOU\r\nnGnI20Di19RGrfpR3/IlIqQztv+VRUT6uaTOV/RFmujduDlGftzV2L5i8wRF\r\nLkhy03LPUDQFAatZDD/uO4txTumOMHvjJgLHgAJRd7+0jW/w6wUWtB1/9WYg\r\nXQZ/Tt5bQkv75boL5eBNKlS3wz9vMpMLLOEzir3u+ucbIAraUqbcIQ77Ydhn\r\nzFSpC/3PRIDC63idgFGyf7Somu44/UuOKsGegcbwLRZ/u0sJhJMsFpuu8Pmv\r\nYvtZvv8g7TuHRDyn539ypWGNG/z5u9C7adVHB1W9VLoazLw5Kcu9RdyJJZD4\r\nol7e/5PyHx10OYgfW8yPi1na+lhMQ9bkwI/t8C8D+N9hrykQnUJ/Wx1hW7T5\r\nigGm424p7p3aywNixlQbls8yylNDS8yDwzyhJFFKs17JxBdqUGuu2S59IgRD\r\nqJGE9l9o7IhOqIOPt5Fw+VqCjUANdzcfcjDxSsieSVA0IUKCusbC18OVga98\r\nwzR8zhFtJmPUJgPT/My9FHKAtrc/DS+5JM/HF6+6/0XhBk0uMfKj7/9gw0vX\r\nIIGJ6X94/gVYE+fr4fr0a8V5Icy9JBOzydM=\r\n=0cHA\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"9486be8d4edfe37306e82889fa12b1ee66c6d2fd","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.17.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.15.0_1675778617886_0.9878849637890943","host":"s3://npm-registry-packages"}},"1.15.1":{"name":"@mangata-finance/sdk","version":"1.15.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.15.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"68bfda5e3fbebd631406571587e9b5504b207eca","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.15.1.tgz","fileCount":5,"integrity":"sha512-BQ+AeC4Ipb+vt3/JC8JfWn5KYz1QrlyxA4uxU787KLAidRi2CklNyEAc5xHfvhgZzmJv+Cj8yxcppEBl9pX3Ww==","signatures":[{"sig":"MEUCIQC2e74BRAQztPCx5+Eajx486unpcq+Oj31G6UyDpzxHqQIgOYUwkPVJH/W0OtEY1Xn67HBkyVKylQCQ/rcggWJYbRg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82487,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj4mkQACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpnfg//Y/fLwThUJyzrQKyBvY4GtAWrDu5VVGem1PIAQVloTUmeXfXR\r\nHK9o0aPltGmOUpN3hQ9QwBOThlyGlpr6uA1k1mjWv4AXkHxnTA5xKE7hFD4Z\r\nx+FRDr7+e0cdy7EFQAhFhvdkkAoSLdEgm1ZaHbu/ICC0NYPpxt59Q53q6Ym2\r\nVNnSXFg9RIaUGQygRpM2ykxl7yGY0PjcJmftaVw6kUHQKubkjWt7/It12g2f\r\nlO12OeZvpCM29C1IIDyXx96z1IgSxY7JijiO4+GFdvCBbgI9ZuxfI1jLKAzd\r\nlTTCJlIdgT4M6UlPKztlaRNC6e/jjfHYnhtXJ+OxaK3NxjGMD979hcF2zCEM\r\nGymlGFcUr/p0bf/XVZWxYjs9pthAjWUsuR5NAo39hXf+JDdt0dYq2Vq62pI5\r\n/gWHO+mR+Qjx1rPKsk3c5XBZEa5soo8OFvCkxQ4HwEi+hbZdKt/EWXND2yh6\r\n1QUvkUmPGdBZvAFdlX5y3isui7b8XQwiGaVNxka2hmfuH4t4V4aXwU7j7wD9\r\nlfgiBXJj85v5cJu07GID0/fWgUfD9JDJu/8DTfEyH56trUJk4hEJVnbfUlhF\r\nzqjoyhA2ZeOaRMLWxtfUwdkdUlVCWrC4Rum/eBZFzbkss5ZdVWE5hiwS/XM6\r\n74C5X7eKoPNWUuz5O3bWx53tB/vYcS77nD4=\r\n=A5Vq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"810b3920e05f14c6e6d247ef693e442f56160d87","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.18.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.15.1_1675782416578_0.34348937873342145","host":"s3://npm-registry-packages"}},"1.16.0":{"name":"@mangata-finance/sdk","version":"1.16.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.16.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"28b5737706414ed4149707ba71657332e2035a80","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.16.0.tgz","fileCount":5,"integrity":"sha512-6cVFhjGoUp6++q8IOWpIj5YYos272kdmBQv1t97DpTFJo3/oCOeFywkHjgCP8/Nnq7H5iDMtE1DYN8uS6bRuWA==","signatures":[{"sig":"MEUCIDSmf6Whk/z0YNtgiQyusI7uMqYKs7sKjOQtLqNWgAmEAiEAgRJkCrt1fO5r/MiIc+8aAkkvW/tyYViObY/OAdz9JUk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":82607,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj5j7LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrs5w/+PbP1NM416v6aPowyQT6GAq2zgyjj91ak0tD/rKBMPI3Rmhsw\r\nNDc4RgPJEM1p8XOb+MyTVXreehYiDvvKYgFd07Kn32DAiiogEooa9k9Lw9au\r\n78T6spTM6htoRJeBUgm0DtxC48f82qQBMlljF3R1eEs4II0nB5dq9kKf4MPk\r\n+wPN52mP9QLuUw+L9K2n+F+7uH2HPd6l2IpNNBLXVRML/jRyD4tRQLlNFpJY\r\ns/kqvq3m29kExk91lvGRTe5g+fKgtTlLCM9mOaY5X6VM1NG8V1iDNCgadISr\r\naXW55UupEHB3zfqwpZWethOyhKO4aiW+P8+cpRmhY8rSqznIt1aJD3d48M74\r\nPnZfNaiDoSStbJe/vJSRr6XnR21sI93E6J1kl5R0iy8KCHIDSE2Ni+wTP4Mk\r\nG65yT2q7FgqrTJ528d04oLrYHPXyJ66fG6ekW7V4t5NmGS1i8gMPhWZXXsTP\r\nVGBfZZmDWBW7M7Dvc43EwbPyYbgdhFocPgldJ4VlDRkOs2EWMxldbnxNGVQc\r\nWoxfVzKTzInXU19F/zFLcgEiDYR2bcYXwOPqqcUsHYl2of4E8u44HbqcXzGN\r\nnfNlB2gYWAgQEejOGQg+Ovo66kJ7t/Y3aW6uCUfSeiVrY0xzDLsxuc/ZTyHJ\r\nSh5ohielJeDtUWpD2eZedFwnuejR57EAHIs=\r\n=BzN4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"6fc2f8d24f65984a51b8f86a69f55d797eb42994","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.2","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.18.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.16.0_1676033739605_0.18606816355654998","host":"s3://npm-registry-packages"}},"1.16.1":{"name":"@mangata-finance/sdk","version":"1.16.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.16.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"a62478d2a545967ac32b0affe2994dca30ba2ed1","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.16.1.tgz","fileCount":5,"integrity":"sha512-Ru4X6bH4AJDwxvETRenkjozO+VuOlk3j9dALsZjaUQa1mj6ZbKZDJMaHE/Ms0NZHbtXmgf8tPUEWYMOxNTWkQg==","signatures":[{"sig":"MEUCIQDD24dURAruQlMKHr0L9RqyPthJKtARI+38bwl4oM1RgQIgFXvhqLLlW0lPa+OJJYVN+DN5sN9EXo3Rjv/g83nLq/I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj90kGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqqKQ/+NE1xiRW52EB7yrhv/rJj16WymaWa1V/h1wqHIb/nkfQmByA8\r\nhUQfH0BfkopDQdhwC9foMGfxOXCEyLceTuGIQpofGpcmBtdo7/+d1G/wtvMt\r\nylZrbr4r3o1tKHMWmeO7p8FEqGQckKlpRDM4l4DAvuR1r6+kTrnuCzVLZBGq\r\n/XXQ3jb2mBPM1d6zQY//ZM3+DkkRmIm9C+uZgI2yRCU+8v0Xbak4r+LI8BSj\r\n6oNUeSaZJ8B6Ndqo7UALS2Bolx3/5tURUbJHOrK0s7dhYkURk4kncbRs859w\r\n0C88DG9GvT93LCmqdryS+4FTa8kv7ipB+mnjVggyMdq7zdT0mkx9xwJyopWv\r\njoSzhF3e5cgHX3gr3mmL3tW3cAcb86CsQnHvvaKUJl3iQqGxvOVnm3APuPCp\r\nQxsU6HH/BuxAHVCrTAw0vkmpF7yg3DXmBpF91zrDvwog2xgWY5LLEyjDoRLo\r\npcFKVBFk7DLhZVOSTw7gyJWxLjSfICxcPewWSigpyo0yNbjFym0427N3WVYL\r\n4GDsLg1/nclAmFy1cfr5VEKcVTH89MWY4DjgYifGTLV1fqtp5vUun2dBR74o\r\ncLXDPT+5bH6foA1p2BxhFgSVrc34wVpRCgoMAgQ9SDyiXbKPqMAtnwBq6muA\r\nYW6fbYgVykbRquSelaJLtuDy0JSkkK3H3w4=\r\n=Xi/n\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"38454ef53825506b4757ce1e9f9e9834feffb32d","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.18.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.16.1_1677150470293_0.7553932451078591","host":"s3://npm-registry-packages"}},"1.17.0":{"name":"@mangata-finance/sdk","version":"1.17.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.17.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"c30a8efd7ce3b5ba21d1293cf3c44363d9887b26","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.17.0.tgz","fileCount":5,"integrity":"sha512-5GqQV7SVYUtH9UshMAmjPQKgheA5RbiC8gVEXjxXVp5DFcWiTJTVJ/9Wt3ylcsnnISFvf3kdZqe/7+YR/wZGwQ==","signatures":[{"sig":"MEUCIQDNn/P1VB41mN91Ng1xyyNKDTss/EBxWMYIrpHlM1ABfQIgWSTRFA+w4ImzMADKaBq31Mc72AuIbkLg4GMJxPiu+rc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85003,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIVDWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrt6A//QtnCfony63Al5AFs5PB+O/oXMQ8/rh7ptaNNUzmfxWNjaoTr\r\nw60QWJTL11gtXV1YujlGhUgpWe1LTGscQKZXcgHv9Wji20vLb+KxUPv15aZg\r\n8YajYRP/s+EESD9s6YpiO0Y8aef9tdGMCXbTLxPvVme3bHyyfpAs769Avj9C\r\nbXYiRMn3DbBWxgZ/G7tIEU0Yl1dXXqjK+b8ZiN9AJKGZ8f4H98HtiYGvE/da\r\nJ5ZZHQYuwV/OZMzzGOsgbl4UjuElm4LnOI4Dzq2tm2k1NEhftU0QZoc00+kk\r\nTEnHT5Tqx+j/Wi2E+9uKUVwx/pbsOvi3cfUbH2OtlJobIQ/2uYSvFTfCIxjT\r\nPE2FVq2Lwmt7fcFI5h+VhRzDa91I2CZ2s2uz2/060Vk+RtDG6x7yeyjO1uCC\r\nntLJSaXNvDwRR2tLN5Jx4G0iVlEbPWa09oy4FCc/rSDCp4wkpmD5S++A/OSQ\r\nxV5DCHPn6bvHhZsetMsK9QJR+i0FOsKVN3rdsxQ6OzE9n9S31UbbcprVVJX1\r\nkVnYFFg7OnKKafEYDt/5NbJSjgO5M+31Uue7dmjlMYrtDA9Qr7AidIxTBF/U\r\nwvmJ8RKOUjvJKvCQUQM9YCketbIadYVQQubS0uxxsUS0MGtVLGpO8afjXeRJ\r\nNcVDpZF/UFsWTaLT5sAy067dj28kBqm+GHY=\r\n=ULwW\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"62896730fb93dccd3e61a8f4278eb44cda229358","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.18.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.17.0_1679904982367_0.6048765803120772","host":"s3://npm-registry-packages"}},"1.17.1":{"name":"@mangata-finance/sdk","version":"1.17.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.17.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"03f818f2f9924e2cbe08cd4a7b3f240c4a1d1c22","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.17.1.tgz","fileCount":5,"integrity":"sha512-vYchJXEm9BPMNNe2VSsHlGBGDtpvUn/dw/iIAA9hYAn4ib3HSVDant/6YhakGIWXEIgZQHg/+oVg4uq+mjBR3w==","signatures":[{"sig":"MEUCIASusoPhvIhEsSRVzum0/i2ZxcRSTEqPxcY6kf4Hp93nAiEA4Te/P1z6KYc7d03RfFLIRcBWvlgenpUtDXAE6r13nHM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85261,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLAczACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbZw//VT8r5WjvkgePpWs3uGEbMaUF32duVnoXIIBAI7gS/vUkw0D9\r\nMYGwWidDcE5ENiQKReuNhfncWOEIUnSGknmHVZzeNqwtA14tsXAVTHgBJ5Mh\r\nMnxTs1CqI4cgwwS6VLipGpHxG4c+JVmnLY18Gk6os+dMjvgHkxX8k8WpjGPG\r\n+PnX2HRFTXH2Wv3UOJN2ylSytXKwOPTBdMBKgi0iE1bFbV3N1H61pA6XGI4a\r\nmezxHqK6uh1v6rUQlpaL9BGlt3z81ofQQR48rePOcvpXBVA51XDssiEwf47q\r\ncDvOo7KAWkrb6UBcTaaA8ZYiG2QAwR6bU+dr623adS0+EWHYwTNhJj0rg9wH\r\nNHVO0kXGBWfCrAVM0ncuMpykYdFvoWDspG2OCOdityGi8MwU7nnyQz2a/yxj\r\nWOhEHQXqcGzpP+pWzDMHwHKA89zXNvjw7GNMxaVdFgX3WQQQY9gOHCcgDRO+\r\nXLHJLE8gwNSh71+zFMQKpC8OA/aM+xZ3sbauExQ/HNvC6isPlo50XQmRdjsK\r\nIKyNlON+D+4EMC4D9oYvDkCLBaOSvikC5Llxnh928RbUuCgyb36JVlVi1695\r\npaV1q8Cs8PnVrTnHdqfPj3V0PN76tPoEuKYcUt90xJXRer+7g4M6AUHQ8EUH\r\nlmQPkGq73332PWD7Wkdi2btP1kpkhWEYGTk=\r\n=D96H\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"cd81a5a9414fd349d17c24d343828ad5aebf0662","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.18.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.17.1_1680607027015_0.2423555619269695","host":"s3://npm-registry-packages"}},"1.17.2":{"name":"@mangata-finance/sdk","version":"1.17.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.17.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"9cca04ae3ac31ff65bde8b89a862c0ec27ea7368","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.17.2.tgz","fileCount":5,"integrity":"sha512-ss/T87naojXHQWp0d5gtVBUZJenFhLT7nq74FQrSuqsauY/t98Gd7Ry1ipyGqVoyNn5T2dRickKX4TGkY2UxJQ==","signatures":[{"sig":"MEUCIG6X/cbYatNXYoAIt38t5Tvc5te/V4LFA7UDFtvZeww7AiEA4sTiwtIT35LPRsRipHN78NnLxdVSo/T+bw1+UkcgWYc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85247,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLChAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrABQ/+KASZFd4u4s2kupQ4Ag7MJmS0pBxELIpDGUzRNnqWPawFDAhG\r\nZDzg4m0sECBtHcfn6hHbifNiAkrDiLoj8OHmhT0jyi7rZrJh6O/ZuuLPI3qY\r\nr7/TZHwjF+nSkRyP9yE0N+NcIxyrI0WDWBYHYyzliS94Qz7H+Na7rQtuZIsO\r\n6pYbSf6mRNxFTaSHdEsIb4y2X5mPLRoGzGFloMuExn9N1tpH9wBkAWbO5HKX\r\nzjGEaZfhaPj256TJuXtJ2sQDUjkbTr3Du5U+/ILNFPD/UC35ELAAcMTZjZCH\r\nyryMEMBZJcm5R9JXP8hOo+mDof0thtaGt4Ps/TTYg0nNZPue5hu7TwsqVW4r\r\n68f2uuQbEBIsXspeDHa0febFY5MBiEu75OFFjfqsKTU1pNzZGapc+U5jfMlD\r\nPDVHFT5yESTEmmGd340RhLz4J7jl31fFOnd7lOBdJ6Twhtb1ZW/pNT2yY5r3\r\n7ovfZdW2wGL/uOcn0GSRlPpJPjyIZMOPKpmInewv0O+geMqFRBAzYLc0ylAg\r\nugWwug3/vdUP6cOXDcUMIX3TvVK1w2/lmWoZABUdxA3fQvyb4/5s0DvhRF/1\r\nGCaqTMKT9WAkqgE5ODekn7RsAuTmaQ7DCpZdOAF42MWtd+/wBFp+MLvQoHfr\r\nBraSVNz4sFMJ8MuBiE2EE90w3asyB0KjUvs=\r\n=n/ZB\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"441507e548cbdfce740f1300dbb0aeb6c3268302","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.18.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.17.2_1680615488622_0.17028567528066785","host":"s3://npm-registry-packages"}},"1.17.3":{"name":"@mangata-finance/sdk","version":"1.17.3","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.17.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"7bf5314d24c9a4dd581b667df4d1c0b54799c57c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.17.3.tgz","fileCount":5,"integrity":"sha512-nK1P+1HT6DMpLIsedqCwqA1LJxAK2lZrpU80m7eXKObJIXaOAflj6HHVVXRD+PTL7erxnoAUEdsX4BMJ7moqLA==","signatures":[{"sig":"MEQCIEaOnf2uR/LkA7uXM/5ycXZElusU6TAUiokFkBOnOLx1AiAIOYOF8PBZRxT63gC2FDdbDkDSFzIrmBYAYtBcQnzYyg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLDLMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXNBAAh0xseNbgXaftpefJnkhOHDh2rtyY/tsv/W99uFj4tAejMwgd\r\njESOpgRSWbrH8KoGYEYEGcmmUhQs8jSv5heGHl1xhK84Yg3u1fUvieT3GOFu\r\nsI4dvpHegj69+dgFuE8ll2o47xDJK3kuwrQfIBkavIlAGYvG7d+Gn6qfyw+b\r\nIneKkzFqB3LGjbr9tRBoYh2jytOoL/kz18Rrp9HvwacNR+fJAQaD6gJTCAUQ\r\nhShOHf4qERvmep0WvwqSx7+TNrO5x+yl0Cb4kiW946PpPgUmRnP8OA6/PVLg\r\nkU9DcRWUwmb1TzVUA4EhWfhRTXXzROZIuYy5ub2z1JEYHbiXKxK3IbjbRyoA\r\nMMsVdnhPaxJKHm6beLKbpqRvCjR/PicIj3+z7NcSVFli/xoio5nYWAzkXeZP\r\nwRd3/L3rfjJ6/f3/fijinpemaTeTvqtfTSpyqfwrWxiOvUm8P/9IxdMlVpMv\r\nmtAmdQUQCIuatrvneArnquiMjQ2tMIgZkUytLP3WXHF/CYhgehstmcLxW8hD\r\nBnxttcGPCqwfr29xsuwH5DHC/hFzDAPLuGPrHFQZW6mkW+JXjoiCov9bGcnM\r\nMcct0Q3u63qdTmUMwr2cdfkzjWVt1u29JnoK4PleFe6fzJArtfv9mx9CSMcc\r\neLEapFbUSn//ploQ7mXi4T4PTQD29tplAS8=\r\n=+vsa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"f1c65b6bda121811e58371a04e0c2350ac8b4e79","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.18.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.17.3_1680618188198_0.33310748206342655","host":"s3://npm-registry-packages"}},"1.17.4":{"name":"@mangata-finance/sdk","version":"1.17.4","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.17.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"a4cbf029afecdc67792cb5f0487510984f645543","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.17.4.tgz","fileCount":7,"integrity":"sha512-/WVNQv+CZ/nGwFFLem3LNhebl1dBpSOLlf/GevyRFAi78VvAp3ylGkRiI1hlBgljnvE/5ZslVqFjBIZVHrD59w==","signatures":[{"sig":"MEUCIQDNVGtc/4mLI9VhnNqp5WQ3omEz+itOYrZg7LnddchZFQIgK6fChNcDX5zj6yuuurcHPx7Mur85jHNyioB4fuIE/7c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":96780,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLDxNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2GQ/9Hp9QT7t00mSjEls1CWqKp9HM+ptMZCf8+PxTCY9EDFs2Rb/9\r\nWmC2lK+CfmsPFiMW4nwJpzgUdiRHiiZ9xeoaaKG8/GwwFqHl//q1JUbqjDpI\r\n7vH7A/r8zzs5T4WQ6N68ccEis47ryU01+6UXh6+MSEagratdustjaEO+4YAl\r\nTlm6cR1vlf+wIloq7GHCTj4yOhB3Tm6mo61uZZuPQc7ebDMwSFATej3zm7GE\r\nFrxRVgICuA8fx1eiyqll4pSDJioZdZyI4TZ+L6xVN6IdM94shSy5aBLO4xat\r\naUQEfRcX4+lEJ4koSOxzZf4yPV5W1+0qeIAD/AZ3IcmyROWef8GcLlGou/1k\r\nNFzYWthU+bwxp1VOVRr4tmqMvSFQSqFxAhYdntF6ILarKCOz+sMDUOV2cofr\r\ntrWTgcyaKaytubQn3iBNp8l1cpewkv7JqYfBIbDmk+DY+Zg1XTgQtAFbXv4C\r\n2wbeSq8eDKcrf4VOkAnYWDizniSyzQDYyxd8U/MSqAnYeJ+4WoTnQFx1wUc/\r\nwbAmPkKY8Jr8JaQtlPHFIxFEiml5+5TngJm1rv5IEnrnJlbePu6b1l4SPGtg\r\n4FZMvxIG8eDulaGCULD8ojIKah6cWCecu53huBDUOCWD16+03RPRJL8mLrKZ\r\n6lHE7c/jWSXWu24I+2b36TsSQZEPmBO0tdQ=\r\n=8lyy\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"node_modules/.bin/eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"description":"SDK for communication with Mangata node","directories":{},"dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.19.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.17.4_1680620621775_0.8047589346709607","host":"s3://npm-registry-packages"}},"1.18.0":{"name":"@mangata-finance/sdk","version":"1.18.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.18.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"99eeb77ab20e5fb56fc06a70caf389df60db1b2c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.18.0.tgz","fileCount":5,"integrity":"sha512-zuMHsEOaBO4LX14KLlk1e32i8CQ9ZqQU2gAAI37drZPDSdQ6HfIptqsJQZ6oBQBRp3x3XxFgqcHWEx/QjCccHQ==","signatures":[{"sig":"MEYCIQD5GYywCZRjN9SizjGVrKtaQGTQdAycFeMWaxLcz9xRTwIhAPdlRSc3k2llMI811QKPyaC2qS97rV7IOGRdrFjB/7kJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLEUGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQoQ/9GMVWAh2VfFIW0g+o+DIA+rGTIzCqzjsxNWWyscgL95H3yK3s\r\n61RGNJxcHzNDScIRoB7i7QwUO5dNqjjY3XSkVcB5sDT9/AQycH/7sLfAa9Jx\r\nETComn7WrjsDdW0x9D6vdy5hw1ANpSEfMhCN1dxJhnNADpaX/OmCi8iftkgS\r\ndn6kbLLjWj1sqOGpv2pZxLB4xmNEZEshzcWMDI633hyHnuCv42hmJPQnnAaV\r\nMFMLn9RV3ax/ggky43aaBBoQdooA0g/VrBZP01/rH1PuiuQHqpDhlvbZ8LMY\r\n5UATejH7ua1N4/OseBC6J3F2YPsG9b9jm2UAQiMbdV8DOpvji8kYcUAB/2h/\r\noBHDOgxRFNAHVMTrvehJbQVhGPKAWysXb+jwDFC3FTE4VMQ4uyEClMroPKHw\r\ncP1riqEKd5aNOD7IRpfxHwXEtOEcH+fZmw1T69NDHy2urgbZ+6v5ndOpgqXf\r\nx/lG9a0jZL3YiJW84Kbfo3QIBsYwf0QED2gLSiT0GA4uhULw8xhRBwFcUgQd\r\nCiCFGroJbpRsY3fqDhq/tE8LGhRDApzJ99m+GsBA3u7Rhrx4GgrINVuodUeP\r\nXhctRYlAVFFn7VILBpl5w4J9dO/xielLN/igHr4zo7cr0b1PnTSDk5KD32N7\r\nO/zBlzcj4xX8+IMbI7CggvARLtrVDNv9jlE=\r\n=aVHq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"d9e94262663b74767c7e01b51f15f502cc0dd0eb","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.19.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.18.0_1680622854633_0.47201689439610295","host":"s3://npm-registry-packages"}},"1.18.1":{"name":"@mangata-finance/sdk","version":"1.18.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.18.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"0d3e0eb6b942d5b340ab8b639345e16872106f64","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.18.1.tgz","fileCount":5,"integrity":"sha512-sHI626s0Ur9JOXK9pFXALrzh0qUKYiV6gOD8eIAHU7iAeE0RiYlzKH/rBEXjAKjOLKu8Uh3ocGVxub+O0l6edg==","signatures":[{"sig":"MEYCIQCkQVcloEUV4ws9AksNTRCBL3HJUfqnB/OCxGWGpuIFXgIhANRT9pYBOazl6Jh5OhS/P67ecuTL7u2443jK+rawgTqB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85215,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLEsdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqfyw/+P/PeDTB6Up07InRROAdk8+3y4WThtRgYA9Vtar0kU0L64Ggf\r\nIBCkPvRCjAhmaTcdnbE+LOJK2UknaRkKVq2BfukT80Hbg6b0XALB1S2Y0yF4\r\nN87FMf2hwvbiLczOMB51Sd7olJbrzTsoBMZZW0PeDDy593D6DVc14GNR2BQi\r\nEK20mA3a+lOyw8/8pTtHRmK77Gv45H7ADPL11Wv/4dFPT2/shnY27tc7Y63d\r\n4ZCVsuF3RJswL7rT0hf14Ac9fTmJY8BrH2AJK9Z2Fd61RFls+5pvnYUBKDdz\r\nhYg+OpU3dJoSQJbYURoXnxHhy76zh52U2su6O9HLEUCSJ+8YDvEIV7UjQ1NZ\r\ncZA9BvA36NNdxndFn4jabb5vb3BL3XBkAJjEj9Puq7ATPIIpTFBvFPDwxADz\r\n347U7B7kbiCyIIUKSjVGGIrAutdnbu5GOweyPYzKbpWoat/DfS4KJSOX8gze\r\nT7tYqIReDioo7F4CkG/npcznjuCyZ93q+RcKZGrM2EFYjvic9iBRmThNwrah\r\nPtum5fRHj4x6N5iySiLIBRABRTqPvYSdN/bZjVKHmQeTrgbj7xpbk64YMUMt\r\n9qrw7s4gnn5XWOncxFeA1wNuzJajFeK/NHV+ij+o6ERGL4p+mmz/SXPLlBF7\r\nTf+FOSKXMZt5SS9FNwSJ7BIu9RUdnBoqeS0=\r\n=5iw0\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"e91befdcab1dc858c261c9db70a74ae905d871f1","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.13.2","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.10.1","@mangata-finance/types":"^0.20.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.18.1_1680624412923_0.16967167790230198","host":"s3://npm-registry-packages"}},"1.18.2":{"name":"@mangata-finance/sdk","version":"1.18.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.18.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"39955bac72b835c8ed15e0a3aab962eb80f4771b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.18.2.tgz","fileCount":5,"integrity":"sha512-64wAaGVJ32Lj9qXaS9ggBWA8jQVvS32WoSPGDBxSW2ols6Of1slVTJ5WcWtIEREjisTJuijQgD1vuKB96o/vsw==","signatures":[{"sig":"MEYCIQCvaWu4WMUSRNGVPNKvIXvN4jqBy2LPQrQAFGX+gZSrewIhAIh7RS3HrKbvD/VacuORLT7GQEOY/4UDAleuX6FuJ3Xo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":85065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLHgyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqzaQ//cwROz1/O071dyAeo6wcECR5pmI1xjzbZGV2HDODSqYwMwQYn\r\nl4zFzk65IFqhf+Z58J3xdFAgEhkxjDo1bmOdZI5z6a5sbv9xEagoBZ5kQvk4\r\nqIHVpcC7SEaPeQiOLimjLRL1p+M0Mk+D2aEZqnCEc2vhyMzIQVxPBT2Drb4b\r\n9cgXNdXDyMgoc2HWCqEWJmVKu5tlVo5DUNNuJY0PN5E+5soNKr+AnItnCl+G\r\nhUTEERhaOYWEfoW9cKRfisWQ5Msc7Vhg876z3+8qe2yeCreZIDD6XQPgY5B2\r\nh8qqwBJR/gC7yc2AJKGPGfpcitzwU71YMO5d8kYX6BCcVE92C56leojZKxVi\r\nUVbmsuOmKGbz8m9Gip/fgEbJFcPKH5fFF4hSXeTyU4JYKoBX284nVkcpQ1HI\r\n3yxbbcyeRA3+FctDtUzIgYm42hasyXZv+KpE7dWE8rLGgUED8WIuwX2BAWoA\r\nTIIcPV7STwucWss3NGaQ6huioMXyMYSKCOkCvi/xIVD5py5DWZU0tGGwhwpT\r\nY/TShSTb+41NfHIot7GIUMa052QIyF6U7G8XLny5cp4gOHYq2Vp4t9Bt5bPv\r\n+N3unVP6zYfnhKWKZbJ1Zem2K51X1WwlDibrLkGiYIZwfKOk8AnkkSBFl0GI\r\n4HbxmYEr+KdfgLMULKaBCj+0TC00fuI+Lvo=\r\n=aFGI\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"2d7721f333a7a281e78de54c214bc953fa281277","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.18.2_1680635953936_0.1824681590943602","host":"s3://npm-registry-packages"}},"1.19.0":{"name":"@mangata-finance/sdk","version":"1.19.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"5eb35d4bc72269fa29b5fda3819269285f91ef76","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.0.tgz","fileCount":5,"integrity":"sha512-Vl/E0fVq6Zp+d+183WiQMryqdgb1WgrdHEjXl8RQ0ZtqPzTxcNeno06xRQsmvThhIQpVRP1oK8xhf8i1u5pIVA==","signatures":[{"sig":"MEUCIQC3wgBWcfZDq+eHCsqstv4je9KHo7GGfMGA0UGkkkxzTgIgSChY0bMz1LCxdwPlN5VBwprnrJubn1r3KpE2Jz1AAU0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87083,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLUGvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGVA//eQ1bhKSoju1gYlmIyLfy4RhJc7w1apz4+NZXFz98C9yJL3iJ\r\nRe5ICH3DtvUqhtVMGPxDpPEiF/mhPs4s4TfC/2y7G9tu71QFOzhncWazypSv\r\njqjZy+IPf5F67Gs9CeftoduSytT3CKIozfJTQdLZBtd8e+617IORbzpgcybV\r\nKyLuDA5VPLX266tdCFoNnua7PHFKJnfTYU9pG7P86AAufE2fTvl+vrmHluGv\r\nH4MjfIr2HyY6OSNOL0e5vDxs6rF91yQ2OWRFaAmA/jLI1EJlpsZuKW4rYfUJ\r\nErrViSLm3n7npfUo7Qe02kfauZA3Jrru0aKfYPf+7pab3+tjYgOVrFTzBX0S\r\nrfHGnafu+fL7bcrAbLlG8eMaOfmGdLwBzQ+8Rc3QM+N/4WSsIrB0NDjiYhps\r\nrKBU4JafuiRaNqstJ2pAmx2SLGGMnsGg+ezSquuLjvRQTOfmdSR1+Jz/5Z7s\r\npezzJ4v1p2IYfF5EHeab2+BqJIvUN+/YKsVRA4PE2G9y4pDbnD9D5C4+IzP9\r\nOY1RLHnECvZNTcEO01JvBJ756eFDZY1KEzMiONGn8P2GdkQofxwMM6DzNlun\r\niMU63l1SqSM7wd0IRj8t0g19/SrbVYvd6Gwta659NbfoeMIJlYuBm5iCraLd\r\niWrKGjic9ySCt/H1OZQgWex/rJc42IxHj1o=\r\n=LiBe\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"37e03f9baeb084e4d8ff7b7a05120ecf0afef835","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.0_1680687535424_0.1914468500375197","host":"s3://npm-registry-packages"}},"1.19.1":{"name":"@mangata-finance/sdk","version":"1.19.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"550f1e94815221c9240202fe1c970de8b348dd2b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.1.tgz","fileCount":5,"integrity":"sha512-HnmiaaYiK2JliGYxCnq97HZkN49E3HZwZ724PyFgCiyR5iyw8WSFZdfxCMqsWTx6izRpdiSmQOzS4FPaVBPpJg==","signatures":[{"sig":"MEQCIEDc6lW+AP1Kme9+RXsnvQVraQqOIkcTQ+0O3GUgMFr5AiBOUbgWnz5EWgVO/c0gKYTArvXY4JrYD68QuyMp0qzgNQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86958,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLUYMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoFrQ//fRnScyGR/VzS1lBKY3r8y/QFxHgh5PqGjxaYRTTC3bFa5XWO\r\n9Nl2+UFCihvi4rFxqSVPv1pdN+A87v/LeluBIFn1MTxxscD9NE2ZnghtBTCS\r\nXhWrAhUr0RwJIAXcnPLl1YtAJssb/q9uK/Ccdlek+51h7VbmVqvr4XMKp9LJ\r\nwQlYtwBZZV6ZW0j5Hd/7oR4RnHMdTouR65X/WniWCLZ9FdQw3ooDKoazWgDH\r\nYpeXsSM97U6FDDT1umoZ482caUuTgb7fyCOB36jTznQY5krBNCDyg7XowccF\r\neZ55aSs3JEO4qODXjVJcCREnVzEmjPXgz7a77a3KCUEGW8EZ2loExlvgkz8T\r\nxb98oLgenYkfbGyRMECYNiyEQGLL+/sbBO8DKDSEQ/bDglM5Z58udfe5j2dW\r\n833/J7Jrvt0WdrUMZuJ1LCUFGLPTvJ7KyAuu2r58vsDIhEX77FjJCBFuTUss\r\ncRszQMabj97ROx8gyf5egBGal/x1z7Rti2hAzrlMgHSS24e+84697rjL1Ugb\r\nuMlv5WNeysxMGaD1Jn3HqlS/3QL+b1f56vweDi0CMN6HBCi5FHlA3kmP4nnw\r\nbc0FYIo11ql+QdsRQpMRC3Rej6gfP9QmmptRRHUF2GagPR0beqMIBukgpvv1\r\n3wcEDEQeCSv/Gtw5lAbJqsFs4dh6SmOWWpc=\r\n=Yd3P\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"2cad3d97d8e6427866a5916584747adf9b7e8fbb","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.1_1680688652649_0.09843985671304734","host":"s3://npm-registry-packages"}},"1.19.2":{"name":"@mangata-finance/sdk","version":"1.19.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"0c58752653461e90efe4408ae086ecb6bf372848","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.2.tgz","fileCount":5,"integrity":"sha512-TpyL9S+iZ/DuMJtP54rYwI5yTxdGvUz7ATU+TgwEGba18c3Pfgk8RNekEUCnwNqypNDCMD9Upb5aIL/TV9G/Xw==","signatures":[{"sig":"MEYCIQDXqOt9dbJAufr67UQG2qmDNhFairzWZyWkgPYOBlQy6AIhAIy9X8izlc/CfOGaFfappOjmU4hTdotZXcYjtvDcMQsI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86890,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLVASACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMPw//VORO+AIlihYNLLZETTuUra3ABJXsmEDpmWBR2N23/MH8OqS5\r\niPzxYkufxErkbf/dF9TAPhdlAtgaAFq4ZzpFhE+/krFLTdTe/+dXN38n0/XD\r\nyyZIaFsgY9feShgfnlfB41sgx1+B3Sp0lf2vyoquYrgHM67ONG6rwAckDoB5\r\nRhg6ui6s5oJgRjyH8Js3g2txgPAW8tGILYhFeUAlgG3o1wqRW5dN4jcDuHss\r\nASOQHzdCt9PQldwyWKSqUb4QZazKBkHiN6XbcB3Cy9F/uJwRJQ9fiXKkBl5S\r\n6M6O2DhaaMxsbdxwv0dSzbDzVsUlZzmgmWYDECVyU8qdCqKynF76x0ygzuXo\r\nN+SBtdnIxbR5FRM7kUFuD0QHrO12deqCXw3UXEMMfewFuKbWvEzDyoXT+IdR\r\nOmHLb1KLhqrRg8Qwx/yofywducS64TOefWWP+getElTR/+NnK99LLqXn8i3p\r\n3bh8jjrHbKwUBn5ODSxdt/ZMN4alkV/psLg0LxtGJjbVNNCnAa70tyWW25kq\r\ndxwk7pCvKs8nvVlaC0HqqzoW8HPDDLfGKoD4BbEQHYYjIZXLO/poTVlQ+s4r\r\neMqE4vaDdi4Mo5iN4gSG11ihvXOaUKmyiYl1bWzCJupYVSXBIsrCmQJlxXRI\r\n4CDxL8mHLFCQ92wzXvZFcMrZ8wW4H714ZqM=\r\n=9SSa\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"559984b925095f73b89c5af6e4312cb84e34b911","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.2_1680691218112_0.3660501236047544","host":"s3://npm-registry-packages"}},"1.19.3":{"name":"@mangata-finance/sdk","version":"1.19.3","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"b7703d3201cf89a25317b2f589f371d4a27ea598","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.3.tgz","fileCount":5,"integrity":"sha512-H5Rz6QxBXTl0gRRHS8rRD6rgvZmGPuPNv52DCNbNb0DY8QzmuIbYM11v7faAyNHihLkRwThLt1Pg2zJL6eWVwg==","signatures":[{"sig":"MEYCIQCBg0b4X89kM1/TmIGycUCQs78wmohJt1CwHIRMY7V3JAIhAJLOx9jCM0KlKp2gszkXlXuFFt90gi+9Gu2IANtNJXyA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87100,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLojJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmquxA/+NRB8tRgBT9rkxR3JO+Si8g+Ls97nd/u+2PJ54BVLgvkQBK+x\r\nIei4diS3/WDTTZoPzJup7cnUJG2Gw4l+8SwWfHLWNxYnQsWhVQQNZaK29ZeI\r\n+TKrc4SzEkZlFlltO1WN4KQcAIdpnQZqba2UjKLuI96+YWMNTLhzY8a9rahL\r\nRTDLVHG6cab/LGnCKH5eFBfyCRmbWaT0r/Laam33e54tboDSn1ROjOH0saUb\r\nXu6frw0+n38nKgP/cDG5q4hR/S9Tete3weQA8dGCiuWqSFeoimverf4gqTx6\r\n4Y8sj9ZPWBYZTAaz1ZyvfON+uCEhgdb0RZ9N4/w2Y8QHWYfLXK5nsIya5gXU\r\nw6i5BOO3xK8RylLkzdrGuG01FeM/au6K4n5D10oLnBn9GQJebjUb8BYeOp5Y\r\nhsbz946qnvw8RcEKt44iuLqaLTrd2syseLOmY9JaTMmMt27yegrhlr97IRby\r\nq6f9n5nXLHhAuABhzwa3qo2IH7ke+oWxLcl20LLTi9yP8zBC1Tr4a5JybdKR\r\n4WW33gnC3Q7dL8t3b3tBV8fCoes3ljxTKZtq5qOk1GrURm1fCLqpExx2gyIp\r\n6CXvHgblmaxIdGYP0orU3YGIATEA6Ep4b+hum3t8Fw8UKtPFGFalEm9I5lSo\r\nE/6pX8J9CTk9eYbBk8wPuXyoc5x2gLH8HSc=\r\n=+43f\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"05889d06619b192139eff2e9f2841afa8e532e33","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.3_1680771273400_0.4166340432092901","host":"s3://npm-registry-packages"}},"1.19.4":{"name":"@mangata-finance/sdk","version":"1.19.4","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"0703c93cfd336e4612d3bb26cf0da0f7b4945956","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.4.tgz","fileCount":5,"integrity":"sha512-PQvlUkvmWUkFTFQxJRSDP0ZwnQkv6UvTFg3ZsOjeIZonFo2Vvsu2R3Al2FsZJ2G4fORiFJMz0Ik4Vny9BuiaWQ==","signatures":[{"sig":"MEYCIQDwF/MU98/MD3NIwKd40+czDkKFOQcYlLy6VFXMR/PLoQIhALrSHQlMZe0Bpf7BlkFg1jF8UEk8lnpTAG8AYIpwIM4g","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNTNKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpD8A/7B18Iog/f54bVWGKxalRrXevDJHnTEgdDf2QgG8BrZAWoGtVR\r\naomQ7vQ216209RyxteVlTGoI3mAVw28L2PLvA8N9TrpCv9g3/uU3mmgyT9K7\r\np/nBFZM7PvxZ+j81brZoj5I/69cLMjg0kkHUouU/XpWX1Pb1uSw8IPX/PA1Q\r\n4C7Nn/jsydywMNeu7CWYOH/tClU/+oGg85AFEethoBYS+COkZw3YKcthTjq8\r\np/PatqjvOMu+1lftsDzaSfoASH5NoYiWCsHJ2P+jsFDGXdcMPWXd2O3CsdPd\r\nwlUuibegpuiG30IxTet033xu4tlhw2ZXLqPuuYTa5m8ganXK2rR+bpYvxswl\r\nH+aeqhjWjviGxqB0NJZ+X28evzDkVJTO4WuX2BH231qTVlh7a8VhYKrFFNf/\r\nPcqFLFFH6mOUO2uBnIa4wd9xl303k33afViw6HaQNGZrGqyaUFh5l2uZAsbj\r\nWJnpJRCqBwTmou3IYJgLckKHK02c80vO/XAoXZa7h3NcUu57/RFtpXBRh6Ex\r\nIkgi1K6Pmnt3/hwUKRW00MjpJeXWqoo1RbxldDVm1uHEK1fLutQp3agHqrHh\r\nwpxca9n4rgT00BpSH2KyVazpoIVd1jxAO8//GL7Di+XQunKvzBZ++TQW4lrF\r\n3gls2476WCIC1k+o916k8kRGYhSYwS6nbh4=\r\n=oAJO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"147d80cd80c13d20710a2456a450a044a14cc619","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.4_1681208138746_0.5918989156243915","host":"s3://npm-registry-packages"}},"1.19.5":{"name":"@mangata-finance/sdk","version":"1.19.5","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"7a9e4b2c98f715c6ec021b7c6e8a92c434061e3e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.5.tgz","fileCount":5,"integrity":"sha512-W9dMX8P6F5/cCvjb9KO228JoP+9jZ9LtC3NW53uXvr8xwIQJa++NETtiMB9u4DM6WiWOImejMqx/m2RC96EJ6w==","signatures":[{"sig":"MEYCIQDK4ryXxmKT1eVXx/xp1XtdhHmWMZP0wrwfPqFu4k8tcQIhAL6B2yla2XSpK9LlMwMmjTrlolUivZc+0oL8tZzl7u5O","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":86792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPQHDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEdw//WCUFAm06MBb7aX6e/jAO8SCYfDhMCQSGFiKxSZycqV7d0/Ul\r\nUULjkJuaEkwU9V3meHWW1mO8ls5EJuICrlBCXH8/3vo1n20saglJCna/HrCr\r\nWqWksMmF9d7s8KY6yvAZArs4nU9364wKh70Kyyt+Sz2Q0Fvai22ME7wF1S6v\r\nS4volMI7jGIQnFjSQyCgA7y3jVCBZ15I8ULvHTFUk15Cx2tAgY73tzmwravA\r\nkPjIMC2ygSgG951gC3xBbTxtvXHLfdKy+vJniDeWSUzDLZfzASd+o79FClq+\r\n0dJPlaS4UBP0VhuzLYLcFDsz8T83dYHmeepKT9SpjmBKxN+CtLbUn/giaSJW\r\nNwyD8vW9U3zPmLR2ptI9nwFLeHo9kDrKUDmSXYX83Nurm6k3ufM6EkUjS0we\r\nUM5QPvIsWCCSelA9iXwoI5ayzsSQ+oS8509ONwv1UkoR/DJeB/XK6jc6UdgH\r\nRr0UmSQUq9LA6YTqnWdM9jtkDPGmFEcgQ3Mwf8v/xavg31FeU2HhRvQw+gRs\r\n+hyRmwUgJmhDIV6H9vlhDVB02UdVME+8Xz9yTQfQmUJ+MeYUGR98M5JhDz/r\r\nfu4KzEx9ZGphYNYAE4Ub9Bdh0d3KG99uuC5D4KoHqlyM7sHAi1K66vB2hM1l\r\n6umyVhl7x9F/m7538qHmjNTSRXBp+/06UQs=\r\n=HTed\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"ceda8ad5a5d8b79d393ec39fab9f49436e4c76e6","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.5_1681719747767_0.018693946045410526","host":"s3://npm-registry-packages"}},"1.19.6":{"name":"@mangata-finance/sdk","version":"1.19.6","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"a83c1d2aaed825e732d145a9de86d49700896289","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.6.tgz","fileCount":5,"integrity":"sha512-v7bUnAAevIDVQCQvQucCqhj7Zw6/Crznw2gCqm4DYUJ52C7I8FEeD3SV+PZx7cUslR3n7WasYtgRD7i5mglrtA==","signatures":[{"sig":"MEYCIQCATliM9okMNaHL3idftVZ3AwiEvyZvFoFSUejD8KV8vgIhANioq1JGSvEJrvHMFdHV4RUsXpll1+opwF9s8uc06rKk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87284,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPuujACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpJQ/8DaefYt9mw9vgf+gWquLu+diwNYcnumY5aXJzHzirFKOU2G/F\r\nT75fH/Y4rlRS9aSPIiyGLEf41QlTCa7WOmTx3w68rjYjEOjroAo4OJQgxmmj\r\nUgt7k0PmPdIvanAlogwyCyVNup5VIqRHBOwJ9nxV7PXWddC6qNunrgAOHp3a\r\nGowZ5Dd8FymSraFex7mj4o88yEQAE9ARHNmy57ovRRCtjRKYPq09+X/odhlq\r\nINSNKJdR1D/uJ6MyHBldkBsf+mTloo0aGGze7+4I3Csvdc0JdFDUTSJoxCsI\r\n05vxZLMaqSZuqoJVUMf8mGZmklblHmFb3LZIUohieANfQK1ZGZH/m1/nSHec\r\nO0/fpVvK0qVuFjcC4mjpoHZQagtqlUAeDFMsRYLsefir790UO0+YaPV9ynaW\r\n2VkyG2KTOUR8xB2FLk+ZHMVikB7LcGplT7tAmgbXGuxNd5U5eunS2FshhFe2\r\n7Lc9fIDMWmROzdTuI4EkC3vqRP1H2EksonBtaBp/v6ObsUzIsCvVY2wGRdul\r\n70Zq8/1G8Ha5f8IAi8wRlNvA50VChitc0lFPDv67Lphzu1WBOHIb+9dalGbF\r\n145C2A3fAaJu8caiir18n0UbV60o44hejAk+f1w0X0QP3pMKyqRSLfIQcDW5\r\nSLfVjAoqyTP/OC/LGQgczJydY+USC4EP/OM=\r\n=EYtG\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"3f43f714b94542aa6d271959fb8ef03974347985","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.6_1681845154820_0.9252427173166793","host":"s3://npm-registry-packages"}},"1.19.7":{"name":"@mangata-finance/sdk","version":"1.19.7","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.7","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"2465319105938afc523d7bffa117cf26f095db92","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.7.tgz","fileCount":5,"integrity":"sha512-bCuyH2Fp/cw49ggStfSfA0+bodPGBRUwcfIKZn1yPrp4iRWgFD0UgqAabubM0SKFg/CI4EcUmZaNLvE0sVV+1g==","signatures":[{"sig":"MEQCIHXrxhP/+yYzg1CJ2yh52hFfj889in0xXGDr91Um6kt7AiA+UOAqeaMF9L9zIbVWgFK6qRlbM+KS1aBil4cOOOJ4YQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":87836,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP7c4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqq+RAAh1oSw3G90d0xTIiwSSaArGWxpaoBZ8iZpk+lf4ilde1GPqei\r\nDRxWGlcS9UeQrLhKTHYUOS3RA2E14WtZJ36m63TkhYItQFLnQQn1IS/HtzGZ\r\nTD4eEgrQNwNB7CYy9jS4f3j+RiG4rWTF6ztxjySwxz5zlJjDhw7RxEq4ngTX\r\nOjF6DlKmPxoDfYDUf8pylOY+9btKXRtA1bztOA63KbRIAbts4uUWZzXQBELR\r\nZKs9CIzghXBMhyJn0dcL/ctycpMXR8Dl1J2pllRzatqJTUbrWfyKeAaL3+nx\r\nJdGA6/D7OITf3/KVTw/c/Uu06Qq3B8mOLXvYt2mUEDwUZKDsNN2XCdRzbSsT\r\nXz/rn4fDAi+ZSVpJcLtepQBbhlS+hT2IIkhDAsP5+7H5vq3bfEvgtYHO1tRc\r\n2QXk9uiRlXbgij9KpGxGhYGGW9BhZk9+0ObxT3VhuuEsgUkDRLiiJKqz5uJ0\r\n1MPe1yIVDHzMt6dBW5wsABvx7kbjgyjCLf5o65C080Kxw6D6mU77DPK+cifR\r\nC3/WHGB3LXVIhxC+J+kE/UblrhEM0TAQ5B4xfzFaK1XyONeHPfF8bNeSuS6C\r\nxG9/T5GZkvSWB10DkNUJyzKIXKculVdTxkwhyMFtin3fMpVP48thSJKbo/oj\r\nDqPPxRUT52JotCI9GueAh73HYuQURfrGC0s=\r\n=M0Uv\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"a8b622e6efb0efb37f487a3f719acf5583c3e613","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.7_1681897271966_0.5110667059524647","host":"s3://npm-registry-packages"}},"1.19.8":{"name":"@mangata-finance/sdk","version":"1.19.8","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.19.8","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"eaf7283107c614ddb556fb40016d627a3f14fb5d","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.19.8.tgz","fileCount":5,"integrity":"sha512-f6boN/FC0WIcJ5pfBUd8L3oVm9ncdguJIDrz5dxwqfOI24t1V1McjIwG0l5j5xA4XlbrGdBDx/jV9Gb1kV738A==","signatures":[{"sig":"MEUCIBAbcjYwVkWYicbMlRzMvSnTkQPRAoG3my0J5+23JgcHAiEAqlD42HFh9WfoVH93YTLsSZj+0RMaqd32xu5XGv+cUEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88166,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkP98PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpj1A//WLN0BPGPivPBnRF0w2JZKSxafEKl2n10D1T5yrLaLbF1P1rA\r\nby3c63fgoTWICMIWcPqypfpHwNzMxbGFJsP7Lj9AhMLfQ+HBh5aILPg5101m\r\nEJ3hvXKbMsMjp8g1RB/Rq7GN8kAWU3uokHYvfwfsPc2b7hoTvzLw470wJMnR\r\nmPPEJQn3OwV5OCX6katZ6MyACAVt7N53GnGQ+xcUYtfiFtKjcG64opGF4zmv\r\nZsj0C0KhTWDSzu1EZg2YdMU3aLNwL7jGBgw4we8Xl9W8lDBkneBsIu/Sgwqz\r\nJ7I0aIpKHGAbwgP0FBHnPn3uh4UtPLhE3xCqHyhOJlrgvre2wVoEa4ymB/W7\r\n0bBWq4JK15O8OEApKlCxAxYSxbqhWm6ceJRed+MIF14eFvyJB5dFIhCbkHbK\r\ntJBYTc7b/g1K1LmEYbnjJJ5Wxit25J8t44FuyN5LXNC73LTmHCRkE44FbZHP\r\nRmQcpArKmxCVpUm0OOwkpZhIYM12KCTiL3vPZyFrADvd5hyC4qLPgEvwOB+p\r\ngI+K22Y8jRkBxUK6SiHZzZm4CmAdueMdDNYId2S+wezq3nQmnWTc0KYSyM39\r\nzROjsLXIgRIQUs7CI1gQ+ykPGoK7EbVEO3yxsXmze/Ot99XExcHRu5WF6Sew\r\nVhtfDD6OFK+HHSbrfkymiWV6Fzard00Fb8o=\r\n=Nvw5\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"8263728a279cc435009a4c7f5fc0a1c4f87e5f5c","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"14.21.3","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^9.14.2","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.19.8_1681907471590_0.540021670898186","host":"s3://npm-registry-packages"}},"1.20.0":{"name":"@mangata-finance/sdk","version":"1.20.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.20.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"aab0e898ab0cbd5e84c5d558cf0fddaf33774af5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.20.0.tgz","fileCount":5,"integrity":"sha512-Lfd+uAo5jtzgqD/zsKSVEQi5DZNsFog5NelXghfcD9TvJfx1qSuHrpK7kgEWu31/LmBOn7ZiY5A/SsBkHxFyYg==","signatures":[{"sig":"MEUCIQC5pP8LqAso4HULGl5NH2qU5wEJD6ZlB0rcN2Fxojm7uQIgWY4aNC1dd3Rq/mDuvuwDb4F/gVkKh6zGiD2I0J2HcEY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88267},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"2ed67a6eef6b134c0cc10a3cc25f05ccb713d568","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.0","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.20.0_1686317374731_0.20975021711966324","host":"s3://npm-registry-packages"}},"1.20.1":{"name":"@mangata-finance/sdk","version":"1.20.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.20.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"b93cdef63825ba082baf4ebf28b89fbdccd4b611","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.20.1.tgz","fileCount":5,"integrity":"sha512-5dY/fdtVCZJewGoEaW48dREUi279ahq4Xye1uAHGUtpoMJG/8SKxEnmEKFmFadfslTcuUFdyeMYgAQwNbNw5lQ==","signatures":[{"sig":"MEUCIQC/ivXV5T3SSquUA0R903yLckACQOYpTrVVgOa1Tx/UIQIgb2CnOj3J+hQV5DnuyzKFTIYVtc1/qKx357Pk8xQeHB4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88209},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"b4504395166d951110678a8fa142080506d684aa","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.0","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.20.1_1686560569795_0.07153035230806948","host":"s3://npm-registry-packages"}},"1.20.2":{"name":"@mangata-finance/sdk","version":"1.20.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.20.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"26f88644e0d2fecdba1036c4f1d1c3cf4dfdb9bb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.20.2.tgz","fileCount":5,"integrity":"sha512-1MsIxvb5nermDJ4uOdKKRzrsMayIsYE4a3hjLIQeTJC8/Fzzh+D29bFk1U0XavNTkU4xKrEXS+QIOJCchmix1w==","signatures":[{"sig":"MEYCIQDW45ZuVHdYip4cVuZSSX1fIgy8XadFKZcIGzGMMixXqAIhAN9yN8ZlhUULlU2rXXBaazKUYzgiByfcwXBOnmIYnsgQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":88405},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"600820dcfaafeafd5c38473bd551fa6b1a7ae39b","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.0","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.20.2_1687169201570_0.0047557012912067265","host":"s3://npm-registry-packages"}},"2.0.0-rc.1":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.1","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"40cb4153b9ed3abcdf2560f133d49a3ac906e13f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.1.tgz","fileCount":119,"integrity":"sha512-w5+IB0jyUY/Oy42ms+l9y53erzEsHFli3QERSdzMnWxAn4uW8/jZX9ZFW634kgQi6fJ6Emm+BK9PzH86/lyWvQ==","signatures":[{"sig":"MEYCIQCqcHHMCbzUR5U6kDWHBvkYAOynPlaZIB7GMsGGYtB4ngIhALeWkZl7FxBkGe/CTs9+U8YT/mazEnLqe3uwofVDNFA3","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":682834},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    Mangata SDK is a toolset for convenient communication with Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nMangata SDK is a first library, built in typescript that provides easy methods for buying and selling assets on Mangata DEX. The main purpose is to save time for builders of client applications, primarily for algorithmic traders and frontend interface builders.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ce65b5ee13cbcd6c77780748d6376696dcd02095","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","start":"NODE_OPTIONS='--experimental-specifier-resolution=node' node dist/index.js","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.0","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.1_1687171709210_0.73921192355598","host":"s3://npm-registry-packages"}},"2.0.0-rc.2":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.2","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"a96f1c1569c4ac508f7230ab8fbcdeddc60cc8c0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.2.tgz","fileCount":118,"integrity":"sha512-cuUqUkD1rY6aKWbjdDbEtMl4IBzIkLObpd4I1nIh76lq0yxjKY8MpDnfHKmHdG3niAI3tcNUnYNmYLQuJkBxfA==","signatures":[{"sig":"MEYCIQCkoqwr/jGjI0GGR8cWbuc31eaqbGhV5m3AwFUfdBSpXAIhANQzFoI6uHFV6VYtdEPqpuOoqH6FjsaPLWJ8TsT3Y+X8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683195},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    Mangata SDK is a toolset for convenient communication with Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nMangata SDK is a first library, built in typescript that provides easy methods for buying and selling assets on Mangata DEX. The main purpose is to save time for builders of client applications, primarily for algorithmic traders and frontend interface builders.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2491e6bfd351db76a444061af4c0d71be911acf9","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.0","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.2_1687248980273_0.8348327492046148","host":"s3://npm-registry-packages"}},"2.0.0-rc.3":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.3","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"b5b481d806e579a369f35d596e153365063d3cbb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.3.tgz","fileCount":118,"integrity":"sha512-l2JCZCrYJIt69tSGRrldlMVluVM8DKiQHFu4+PPn/0cUeNUvHJgwszFtqHqlKlvi72BWGJ+fJcTspWThNygLIg==","signatures":[{"sig":"MEYCIQDY7R/bIfF5hI0H74KayB+jccZkk6gO1Pf5i3OJ8asStQIhAIjRgDeznntgHIcWGd667NHAb/rcHDACUotqEqm16IuF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":684062},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    Mangata SDK is a toolset for convenient communication with Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nMangata SDK is a first library, built in typescript that provides easy methods for buying and selling assets on Mangata DEX. The main purpose is to save time for builders of client applications, primarily for algorithmic traders and frontend interface builders.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3ff11796e26ed23d140e53cca6825e0373b744a2","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.0","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.3_1687269657211_0.1870247958085871","host":"s3://npm-registry-packages"}},"2.0.0-rc.4":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.4","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"eaa18d41681945f08b6aaf935945a84135cdf93e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.4.tgz","fileCount":118,"integrity":"sha512-OLOPUtpXfoKbDYVlS8CpVfkKm9iFUgSh907W0b96m9sufe5XUxUqOYVc2Tdi6tt/31RhercdGaXFq4LmADR5gA==","signatures":[{"sig":"MEUCIEFRhalvxfOcEVXHcLpQYEwIvi5SdJUnz7thXrt3PL6lAiEAtzt+hSkJ3rgOoPY/MwtZRJGZuw2rnMtyvu5evKhztl8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":684270},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    Mangata SDK is a toolset for convenient communication with Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nMangata SDK is a first library, built in typescript that provides easy methods for buying and selling assets on Mangata DEX. The main purpose is to save time for builders of client applications, primarily for algorithmic traders and frontend interface builders.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"19eba5c1e379578f966b7fedae757c0e96eb8b02","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.0","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.4_1687374270899_0.73606549960388","host":"s3://npm-registry-packages"}},"1.21.0":{"name":"@mangata-finance/sdk","version":"1.21.0","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"c6562cf04996c2427272d075d95911c3f1ae86b5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.0.tgz","fileCount":5,"integrity":"sha512-GnRMIm3WdE1bcQyYgM4y472atO6ie+Mj7eWwVUnNPg2H7WLfzf0Jr9mAydLFaB11SGIT0Gg7QU0O24lrRUuv+w==","signatures":[{"sig":"MEQCIDl6meJl4zoSfuq3oTaLEvUgLXF19E5wxe25+179Z/5+AiAiuhA0tBzve/5hpk1m/IPaC/YAErB2DvIqhZ0G+H1RAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":92693},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"c8c1e02e99da274d824416075e867207506d8304","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.0","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","ethers":"^5.7.2","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0","@moonbeam-network/xcm-sdk":"^1.0.3","@moonbeam-network/xcm-config":"^1.0.3"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.0_1687778474687_0.9786808401869971","host":"s3://npm-registry-packages"}},"2.0.0-rc.5":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.5","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"3008e565d3937b16cbf4becbbb9c17270d363401","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.5.tgz","fileCount":122,"integrity":"sha512-3L7i7yfVb2RUIbepKcQBsyQJJO0HKdyMwxzQ5u9HdJsQylSNu/jaRQSumeINaMIju5WRlEW9jd3ohcinnkvE1A==","signatures":[{"sig":"MEUCICwj/trmiuXQNwHitpYYSosSRSwtJnpIYhH+yy+17RRyAiEAyiQdmL1BJzmlVJJjSJ0whyNg9C19G1dFZoUGMlXMdb0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":696587},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"207da02d48323d99fbad9656b899d57af3e63551","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.0","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.5_1687859185453_0.9441566191197552","host":"s3://npm-registry-packages"}},"2.0.0-rc.6":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.6","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"4256ab10892cce3d0a54c05a8f3ac83f60e19d2e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.6.tgz","fileCount":124,"integrity":"sha512-uwaxE2FYx/bSEqwi2+5I3fDidLuildo+r5lyicqoKP/bKaN7uR190nD9IWvbv1a3QeM4PK+5PV5GQMtLDzC1qg==","signatures":[{"sig":"MEYCIQDkHtvGNlltEhaRpglw0yUc8QHi7deSm0IC51MMxIlFPAIhANFe36dXmpPkc83uiqTfdprDJ9KsIlVnra0d41eCHqxr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":703342},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"555c7bbecdb4c9f2f9385aa86e2630e861999ca8","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.0","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.6_1687866463204_0.7612678207421588","host":"s3://npm-registry-packages"}},"1.21.1":{"name":"@mangata-finance/sdk","version":"1.21.1","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"8bb682105c08262570d4928adb31959e6eacb112","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.1.tgz","fileCount":5,"integrity":"sha512-2fhz5GfbGhabmxSlyaGE7GmVn2OeRaoH4zNDIcOWeJFk4Cc50lw8G6+WflKS0lm/0Q5KeurNGG9g0AEKMbu2bA==","signatures":[{"sig":"MEUCIHwJFpHznw/i3mX1jHctashs1xiKiLZmCKHuAUwoQkfBAiEA2VhuIZseWN/9b4KSKS3ntDHn+UgHimd/4KKHkXFTtsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94223},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"1943eda0aecb139e1ac8b10051f518183316aa36","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.0","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.1_1687980812776_0.22076224160284919","host":"s3://npm-registry-packages"}},"1.21.2":{"name":"@mangata-finance/sdk","version":"1.21.2","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"08fc296e4fa92b1ebe5d0d844b07ab3b1d13ad49","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.2.tgz","fileCount":5,"integrity":"sha512-DO84Yf86yWqknzazgqUQCSePcnVA3OWlMuFADY5PUIyK7Of3XzEh5pNkkaIEUiES93KiHL/CMnc3sv9NIrWg5A==","signatures":[{"sig":"MEUCIQChy4kqKSfbb9YPkjnbxUiLyeWCait+3XOpTOhAAYiXbAIgWhAZIQ/KmCK/EuXp+mFntUnwvuh1qSpX/TgGiht4aws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94249},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"212df80b2b3e3324f3bb3e477268ae7e3dc7987e","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.0","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.2_1688022106312_0.3641212233852589","host":"s3://npm-registry-packages"}},"1.21.3":{"name":"@mangata-finance/sdk","version":"1.21.3","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"82f54dd8c840790aee716ae1e7c63b39d25d9e1b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.3.tgz","fileCount":5,"integrity":"sha512-XSIp8836x3aO9yhPB9vmF7TC3Ym3AXG16PFkWg+3M7A+QOizoVyQNo0tx4cMsVVJEVLkdTzbTLEDmZC/wuWoCw==","signatures":[{"sig":"MEYCIQCzq7tfPv1Uskacag3h+/81xRNz706wIWgCK2IxRwhyKwIhAOCmEq9eQMjQoVCtt+yUH5Dfi0EtDDwj0nGGSPPEwfbS","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94275},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"2e06ddf467ab5d47cbff5d584e969c1c458e35de","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.0","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.3_1688022386860_0.3501627084125789","host":"s3://npm-registry-packages"}},"2.0.0-rc.7":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.7","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.7","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"d9070108a8ba8ee8d5f43b84fdbfcaf75ed944a9","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.7.tgz","fileCount":122,"integrity":"sha512-tFPE38K1e/TPpFIkmRbx1eGPqrFGBb4nl27tlikXQ2KVQWHJa59P59uJDZHjBY7zAvD+pnwlHeC1kEyDlX2g8g==","signatures":[{"sig":"MEYCIQCRxI9gmlI5UCkRSG6RLUUZaV3Cl9Lv+ZnhMqU2uHTO9AIhAId9g+jGEkx+nCozbaPdeslOGntWWPKlo921/JazB22y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194529},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ad6a8f9885013623e5a4f3715fe3f5d4a1e2eea4","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.7_1688029759949_0.23455316420827366","host":"s3://npm-registry-packages"}},"2.0.0-rc.8":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.8","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.8","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"ace1c17e0a659727763c4009e6ce6f77193f92c0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.8.tgz","fileCount":4,"integrity":"sha512-P0ot8Op8Ea8CwZO7FJJBqCDWUS9b/KpmdJKBR3RmjyqNFBWCkSEDhY2/mfn6+IRCgwtjUCQMMV09Kc3QIWgfdA==","signatures":[{"sig":"MEQCIEXwUw1rx62ofxBRGqDn/ks3Iqs0Qt/XWxck6nqSakItAiAVvjIvzua1CeMEGyD6+KnUljM6UBLFZE0+MFTesvp1iw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":515598},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"bcff90558d962bd653a6a613f79a2047581c761e","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.8_1688032299928_0.8831015477975204","host":"s3://npm-registry-packages"}},"2.0.0-rc.9":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.9","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.9","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"f750813d1f3d69d79a084d90a3e4826ed4036b58","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.9.tgz","fileCount":4,"integrity":"sha512-sjm19WacK0SnItknVoHNjuvgvmFMvj/z9Ifz4odva+PA+oTofHiy+tBeH8IJL1NgFooAXz2juSOfD0zTnwznQA==","signatures":[{"sig":"MEYCIQChLt3PhAirdBVU/xoSjshzO6n5QdQN5EFNxJ8hb6+XxwIhANdA/3YXRlgffR1764PFbjNQjsg2ozllZY09Krvvma4d","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":515586},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3f439cfff285efc94d1f51ed32f677654af48d90","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/types":"1.0.0-rc.5"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.9_1688038702862_0.8705266975614467","host":"s3://npm-registry-packages"}},"2.0.0-rc.10":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.10","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.10","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"1ee7520fc42b19781e06445447b783eb010c9607","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.10.tgz","fileCount":4,"integrity":"sha512-zHrBway1DVFNhnOu4Li7x8QIHUsh8Hu1VUfqgHGncn6mNaaKPWvc1ViJ3IX76pflI9h9KbnGaiRqqP/K2YEvhg==","signatures":[{"sig":"MEQCIH4CvvzCPo9CGusc9Zo8AHrk3rrPeoxNQbjYRsbOTNJuAiAQpDhSrUGRF/sQHsY3nJKPQWiXt/NW0Q03xcGCT02xWw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":516570},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"8114f9ffd648f54b355a33190536a20d32a030bc","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.12","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.10_1688416294343_0.32564922999754886","host":"s3://npm-registry-packages"}},"2.0.0-rc.11":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.11","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.11","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"7b3d1d710156407b15ed5f6377f12d440e02564c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.11.tgz","fileCount":4,"integrity":"sha512-7JMwCWd51P8P30jkdFoaknvgLxcZ2D7lutvH5CJqR54asF+SlghStpdvEcSKFhMQB2Oy+jHEAEhxscOZ80FlUw==","signatures":[{"sig":"MEUCIQDOoxYcEAHtTm9iX4X4CKoJyijrhogPwWZ52JU72JCyVgIgcKV7A0RvC1tPe3Txsi4kJ4BU06ezaWnfYp2ZoTBqIW4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":513360},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"08d696c51ecedcadeb2d9963919de9aa82d8a7e5","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","rambda":"^7.5.0","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.12","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.11_1688473541370_0.30147276274629564","host":"s3://npm-registry-packages"}},"2.0.0-rc.12":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.12","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.12","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"dcef9bec9961ecc2ccb50116370c45e9a311f0d3","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.12.tgz","fileCount":4,"integrity":"sha512-Uh9BhveDb/uQG40EJRbfSFe9/vDHt0n3rOPlO6I1ZOpZujFqbBrU1IcRU6mktMjN8WQ8rNN0wLQVbHydavkEtw==","signatures":[{"sig":"MEUCID09fqOZ3cS/H4+D9vMiMTjf0T31ifCIEIF4IRl+jLz2AiEAoqlVYsn8QewGewrTCXMApXw60TSeg3YkqeYSOUHCXso=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":513187},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ce3c5c180b3254a1ca7398f90b021ddbcb94a8ec","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.12","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.12_1688628985253_0.7292781067092928","host":"s3://npm-registry-packages"}},"2.0.0-rc.13":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.13","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.13","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"9cddb303152a017eebbc25976be9d69c1d95740c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.13.tgz","fileCount":4,"integrity":"sha512-r1Caj71X/Y409IL389CJptAVlMS8o6JPyWwVvj5Jo8VA7VeageisrAGLqJ7YZG1j6uLHfyYi1osWvSCBMptxsA==","signatures":[{"sig":"MEMCHwsRVLIejeGpwp/RbIx53VIVlaBxCM55FwRiSHszHBwCIGUPCyRbGhaC4BeLHwkFTGn0B8p03kcyDKDwfNCOJ9Ik","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":510311},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1eda421fd17102814790d84b568c1c434dd7af75","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.13_1688647061014_0.533526659926326","host":"s3://npm-registry-packages"}},"2.0.0-rc.14":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.14","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.14","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"80abc57264878d98199761a170d29c42426336ce","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.14.tgz","fileCount":4,"integrity":"sha512-Yl2bfXffyZ0iuXaUIjyfAeC25tkg1+MHjt6aaFscrFds0yy1Esx5yeFE/cgrPnu24SdLlXX8fJSZJNV9+e+//A==","signatures":[{"sig":"MEUCIQDZVtIAW1Pe1nNeTmtkW90BZ3ehrInoSR9VfWQt4AfObwIgJtLenpasyNFJva0vAA9dU6aZpncWH9KkBNxD0q96k84=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":510403},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n```\n\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"26617b5a9000d44535171f18709b80f01b6248b8","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.14_1688896751359_0.5167965359240172","host":"s3://npm-registry-packages"}},"1.21.4":{"name":"@mangata-finance/sdk","version":"1.21.4","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"08115c875593cbe2857b961bf0bf174058982655","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.4.tgz","fileCount":5,"integrity":"sha512-G0NJDCRKNGpHzNfVldbl3QHIK6pa9IBAK0hQqnQmv9d6MMgG+FPu6o7kdsZPWA2cDIo3b6nfiQZDge7WfBgeQQ==","signatures":[{"sig":"MEUCIQDuHVh447tv3CkdEJ23qTFPSECCrWcfyjHj1t1lXFAW3wIgLFxDBZZtfcXNNvXWAQrK9gZ8fXpJaISufg5xhkVE0P0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94395},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"aac38f3aca66a36a21cfbe32ecab35ed8c5dfd63","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.4_1688900005364_0.3207454310140554","host":"s3://npm-registry-packages"}},"1.21.5":{"name":"@mangata-finance/sdk","version":"1.21.5","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"402a9fa0772ce330672c22b9d00551267ce61afd","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.5.tgz","fileCount":5,"integrity":"sha512-oDdlOUczyJSJXkDX07HoDi5p0u/bNrV6PHkhydf/zrw1mZW+EAD+E/RMeHKfEVUEPVNinpoh7uZQa2lHQgFlIA==","signatures":[{"sig":"MEQCIGwc0zgQ9zM1KsRIJHsPC1MeXyp0Co8+WY7tgguaSYlPAiBEwmt5fiEGeXnEDiBjMPyFNscLL7TaUfGdZXuxuVuQGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94485},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"d9202a383211211123b764c99abf91f1fced61cb","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.5_1689060987075_0.4725926438566008","host":"s3://npm-registry-packages"}},"2.0.0-rc.15":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.15","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.15","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"b7898a4273bbba37aa82ef3e1652eb6abf619146","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.15.tgz","fileCount":4,"integrity":"sha512-P+buV1Ts3oo0LSc+1cfilxYIzNwcZio/BH9l6NwVJxu8wF2zJZOlphR4eHdKrklLTovXax96+ds6ZPqNIL/6IQ==","signatures":[{"sig":"MEQCIBDfCgTjLrxMA4Z0dDz8fCCu8wPx21ZkNl2iAy8L7dOqAiAL5548PLCgB32Q6yCdjesK2NlilkPjcB1wRc65HzS9WA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":518112},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"5af451ec4a785d68aea979fb53cc6a04bf5938f3","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.15_1689080829069_0.7852276104155356","host":"s3://npm-registry-packages"}},"2.0.0-rc.16":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.16","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.16","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"021d7f9aebfff1e7b5d8e63ecb3809e38ab619a6","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.16.tgz","fileCount":4,"integrity":"sha512-IqCCtuS78owxt2YYNoG0mqzexx5pQT6c0qY3MysVoDt/HPTztwq6ffmR2jkvD+ALgzbz6KYzEPVgS9uKT40ggw==","signatures":[{"sig":"MEYCIQCDRHwOdjg5kXir6QgWLlGlmWaPfYfISalqJIk5KMLdEQIhAIxSMRs6k6Rv35loDkDPGhVor6iSNsZJNACzKob2kNxo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524237},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"193fbdd3a142dd540a68b8c5c69a7e0a72fc0e86","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"tslog":"^4.8.2","big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.16_1689248825894_0.690974543908071","host":"s3://npm-registry-packages"}},"1.21.6":{"name":"@mangata-finance/sdk","version":"1.21.6","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"a0a379d3b1b28169c245e71134b5544e6eda6f9f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.6.tgz","fileCount":5,"integrity":"sha512-6Fyo0J/dM2mB1BHvq20wPFBGC3dCSLHr0IeJKV4GHeYF5P4jFqci7FrQwsYzv1YQH4Nj3hUEQqbiE4gLM+bobA==","signatures":[{"sig":"MEQCIHfaN91M8jIQ7tuuDSYiivLyQLov2h/QEVTRhqpnZqqAAiArSfuUtzgrqi8UMdt2blZNstKzuYixs+JVq+cKC2F8jg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94514},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"4034afd9d501a53b275e171d14944dd23b92c999","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.6_1689346960684_0.7498125948590473","host":"s3://npm-registry-packages"}},"1.21.7":{"name":"@mangata-finance/sdk","version":"1.21.7","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.7","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"ab3d01964b40ec15acb717e4aa9cbc278a4547d1","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.7.tgz","fileCount":5,"integrity":"sha512-lxZeAcSi2dv4pc8akyW23XzFF1PkTitU1nwrEpj4tV1lIFMMqYFjMkassr6qtk1nruOda6HKY6QQfIycKCA9RA==","signatures":[{"sig":"MEQCIAtioZKSV0L0gIxnevRZik0SxHeoNbqUguiub+g2of+RAiBBE45YlTZFXwks53cH0O9Uea+GTIXvhZ4LQ4wkP+cA0w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94543},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"35f1d0fee876714ea19c7295acc655df45f6d84d","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.7_1689347321692_0.032110968261466644","host":"s3://npm-registry-packages"}},"2.0.0-rc.17":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.17","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.17","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"df9fd0f2e7c6e788c34b795f2bfa672eece031da","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.17.tgz","fileCount":4,"integrity":"sha512-zkdtG8Zo37IQxGGp4JoAWM4pvqoG8vusQxOOmSdCjO0mKc7mxPtjUfZVBwHaEfN3t6YzVUSbOpe6MKasx2cPug==","signatures":[{"sig":"MEYCIQDFE3TkClLX9bVgmtW0jwQy3crQctZoMwMwUxQC/0kzSwIhAO8BNhyowCqBbu3+Yu7payE/Wu5/0lKVy9puDJOI/N6Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524295},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"58cf3ea102b24bfb9587de3b85f36a7450051586","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"tslog":"^4.8.2","big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.17_1689348905793_0.36729411742446305","host":"s3://npm-registry-packages"}},"1.21.8":{"name":"@mangata-finance/sdk","version":"1.21.8","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.8","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"8664a94fe4781efc0e47db07f08996866ac9fd78","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.8.tgz","fileCount":5,"integrity":"sha512-Hgtu+fHwvMwIffzVKPmpKOugMPtNdZN9rhBihCezis422VQ3Fn3/bBRLM1nFGS6P43aeowOk5eI1vFaVIv5oNg==","signatures":[{"sig":"MEUCIQDS7YU4tf2UMFcYfJ6KRExr4OKQUuz31XEr6Zkd8OX2GAIgc483ExnNg9bPra2/bAULd+eG2rAiMUgnf4bpMcAgXM8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94547},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"132745399a294a1601ac05672d3b9ba235c3b90b","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.8_1689671674351_0.1633768096922441","host":"s3://npm-registry-packages"}},"2.0.0-rc.18":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.18","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.18","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"47429ee164465eac32bc6bda3e0408caeec10936","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.18.tgz","fileCount":4,"integrity":"sha512-VXrasI5PwA67b7Fpvoi9sjtP7P29RFv+ADY6bI6iS9UH/2xAC2AWVQSheVbLTtbu2jYgKnBxjsu8A8YjU+DPSA==","signatures":[{"sig":"MEUCIQCzW6Bj5z+dJXjND9ns+zfsIGhPtrfNTqmslyH3potnhwIgBiLo5PIMXSZpupyqBgf37jFK7vOWBAYfI5Uhh7zPOvo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524297},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4ec5494cf109ce566c4b6291bf3393010f824f76","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.16.1","dependencies":{"tslog":"^4.8.2","big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.18_1689672680622_0.6492516750704773","host":"s3://npm-registry-packages"}},"2.0.0-rc.19":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.19","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.19","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"0f96faf5e58cbde111b05eddefa84b9374804ec0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.19.tgz","fileCount":4,"integrity":"sha512-pKs7gAXWCDcnIb5BM42mTv1q8+51tO9TYmiwIaZw8GVxWmCcEuM8h9Eq7QO4lVLlaimXznlvXCeX1novWTaoJA==","signatures":[{"sig":"MEQCIGDJUyhmFAOSRV741xjQ3POF2OKgvheJxkogHcw1lrLZAiBpc2wf1Lc4vQCnb63fGu1GY9x4+yQAn6dTB2uCQnMkew==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524297},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"457d36caa4a6ef16d1bfd64da79c11b1dd3ddd12","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.17.0","dependencies":{"tslog":"^4.8.2","big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.19_1690363711399_0.9648807718553754","host":"s3://npm-registry-packages"}},"1.21.9":{"name":"@mangata-finance/sdk","version":"1.21.9","keywords":["typescript","mangata","parachain","sdk"],"author":{"name":"Mangata Finance"},"license":"GPL-3.0","_id":"@mangata-finance/sdk@1.21.9","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-SDK#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-SDK/issues"},"dist":{"shasum":"d33fbdf9681d648b6c0a29812fb9a706998ce726","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-1.21.9.tgz","fileCount":5,"integrity":"sha512-ElxZMbhFFTE2NN7WJ1mmD3cpIi9eScDqDD433siBjN13t+yjpyZ1QBnxBM3Jz/z2cNHkLaZXi3acf93/9CJqMg==","signatures":[{"sig":"MEQCIA1kbmGd4fknzHY5d68TO6I5psylgyYdOaCU3KDKheYCAiBIVT7RuEgl8hTnocq8eIJbcktfkloxUVaqTAeH3R7rfQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94645},"main":"./index.js","types":"./index.d.ts","module":"./index.mjs","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"}},"gitHead":"d8b46fc319b038da254924e9bf0dfe237935255d","scripts":{"test":"vitest --config ./vitest.config.ts --run","build":"rm -fr build/* && tsc -p tsconfig.json && rollup -c","start":"npm run build && node ./index.js","eslint":"eslint --max-warnings 0 . --ext .ts","prepare":"if [ -z \"$SKIP_HUSKY\" ]; then husky install ; fi","eslint-fix":"npm run eslint --fix"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-SDK.git","type":"git"},"_npmVersion":"8.19.4","description":"SDK for communication with Mangata node","directories":{},"_nodeVersion":"16.20.1","dependencies":{"uuid":"^9.0.0","big.js":"^6.2.1","@polkadot/api":"^10.7.3","@mangata-finance/types":"^0.23.0"},"publishConfig":{"tag":"latest","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"husky":"^8.0.1","dotenv":"^10.0.0","eslint":"^8.15.0","rollup":"^2.70.2","vitest":"^0.25.6","process":"^0.11.10","ts-node":"^10.5.0","typescript":"^4.7.4","@types/uuid":"^8.3.1","@types/big.js":"^6.1.3","@commitlint/cli":"^17.0.3","semantic-release":"^19.0.3","@babel/preset-env":"^7.16.11","rollup-plugin-dts":"^4.2.1","@babel/preset-react":"^7.16.7","rollup-plugin-terser":"^7.0.2","@semantic-release/git":"^10.0.1","@typescript-eslint/parser":"^5.23.0","@semantic-release/changelog":"^6.0.1","@commitlint/config-conventional":"^17.0.3","@typescript-eslint/eslint-plugin":"^5.23.0"},"_npmOperationalInternal":{"tmp":"tmp/sdk_1.21.9_1690898409134_0.037603272760999173","host":"s3://npm-registry-packages"}},"2.0.0-rc.20":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.20","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.20","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"c445f4d517c05562c44b0e401cc41a9944a87601","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.20.tgz","fileCount":4,"integrity":"sha512-JVUBmKnNe4ZnzPGFOlIP/MEP7FdxjBuFPW3Igv4Kr4xh5/fnhaTZuORqGsvRvJj++RDMxQ7OhFCYZGN1aPk9eA==","signatures":[{"sig":"MEUCICc1B8tIHH8Mf2Hw4WypfKOKddXgnZJvohWr90mY3ZVTAiEAp3slWXHMyLkzIof0RCntyQs9nCW5hz1IcCeHWyr25ys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":526826},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b694278a0c90e3d715d9894e8da83c4489062184","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.17.0","dependencies":{"tslog":"^4.8.2","big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0-rc.13","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.20_1692192307041_0.9376118203408776","host":"s3://npm-registry-packages"}},"2.0.0-rc.21":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.21","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.21","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"b5e63ee24951969eb59f63d2fe1436acca799048","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.21.tgz","fileCount":4,"integrity":"sha512-ga545Cn7qs4ZJr4znYh3aAijOJKBBIQTMgai6g0f8JGWZKCpMFs+C5VdJlEvHd7GN4COnHi0Ltx37YRqquRgWw==","signatures":[{"sig":"MEUCIQCrUxc4wefOMV6XTcG7iAjABjXtSA9r1FKwQrkaI0jDagIgE7mZZBibCfXIvtKUn5tX97SSuIr65q7Npwv/tCmdg3U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":528249},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6fc3ab9deb1e9142eeb385b49946f635d8bd3f1c","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslog":"^4.8.2","big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.21_1692781956415_0.24276673711795338","host":"s3://npm-registry-packages"}},"2.0.0-rc.22":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.22","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.22","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"84f6d6fe87fb72e79a0d9f1948e760c348807a3f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.22.tgz","fileCount":4,"integrity":"sha512-j4/JvXdZC8caoFEPFP3qjXp3LbtC84riYyzqSPtcIKiu0ZJ8jBM5CEd+Bkcv+MC+oLjhPn9AdzYypXAADsWvOw==","signatures":[{"sig":"MEUCIQClqUeHwJLglcohJyOsrs7rEEDIXeI62rvf8zKsxVTKMQIgXfMa6a2+QU2Oq+4HVQjbTcwyEHLfQSBmj2Yhg5JmvQ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":529317},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3b4a238745106c18f180458cbc1013310494547f","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslog":"^4.8.2","big.js":"^6.2.1","@mangata-finance/type-definitions":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"^6.6.3","uuid":"^9.0.0","eslint":"^8.39.0","vitest":"^0.29.7","typedoc":"^0.24.7","type-fest":"^3.6.1","typescript":"^4.7.4","@types/uuid":"^9.0.1","@types/big.js":"^6.1.6","@polkadot/types":"^10.7.3","semantic-release":"^19.0.3","yarn-add-no-save":"^1.0.3","eslint-plugin-tsdoc":"^0.2.17","@semantic-release/git":"^10.0.1","@mangata-finance/types":"1.0.0","@typescript-eslint/parser":"^5.59.1","@semantic-release/changelog":"^6.0.1","semantic-release-export-data":"^1.0.1","@typescript-eslint/eslint-plugin":"^5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.22_1692785337942_0.9169052732514991","host":"s3://npm-registry-packages"}},"2.0.0-rc.23":{"name":"@mangata-finance/sdk","version":"2.0.0-rc.23","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0-rc.23","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"30d8e14a8fb0bf17539c677fa2a4a0d7b087f2e5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0-rc.23.tgz","fileCount":4,"integrity":"sha512-yBj8tbLTm38qc/+X0mfl3taaPEwB8FcbkXjvm5SVATJVn5upEyX1N2S5ghzyIsbAoYp5aDfC+fcWVKaw3URd1Q==","signatures":[{"sig":"MEYCIQCecKfnDamTMAvQU99wPIMxLHGlAFyjJH9zkLZLGfs8rgIhAOAIHNgpWGWVcTsHBSoN8CfVt8v9mt4YDpCxBo+W116k","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522961},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n# Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2a29f465d13408d8838476bfc47ba6f383c275e0","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"1.0.0","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0-rc.23_1694963127429_0.6435318323542054","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@mangata-finance/sdk","version":"2.0.0","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.0.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"4d81df2812bf065b691561283a32ae23a4d428ba","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.0.0.tgz","fileCount":4,"integrity":"sha512-YmXzkWc/tvZfWkAkO+MJthFNBbtHPD2Qt/1RCgdCFG3pKR+geZgRVRgHwy2yZP8qmbchlWjY7hAvC9/CmUUXEg==","signatures":[{"sig":"MEUCIBvGM1hkiSAs1Av5LWEo39RB14DYIN2LMAhLxu9Ekn3GAiEA/mLso5VQ6PaTmLbS/x5ax0O38F6cYVx97mLM0GvHbM0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":522956},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=16.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"cc6e643eb0fad899a70979d8c78aceb1362ffdeb","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"16.20.2","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"1.0.0","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"^10.7.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.0.0_1695196521365_0.2363368072962666","host":"s3://npm-registry-packages"}},"3.0.0-rc.1":{"name":"@mangata-finance/sdk","version":"3.0.0-rc.1","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@3.0.0-rc.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"8a38bb71f053542e201fb221f9f441143e352d24","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-3.0.0-rc.1.tgz","fileCount":4,"integrity":"sha512-sUkvpVMSk4x1hGPo7c+XAE2XyEpOIz6zD7FrHzlStAGrRT9+wkh+fty0CPzM5BqQXkv1BhO5IMPAjjmF8jPEAQ==","signatures":[{"sig":"MEUCIQDXfuM66+HtuOdfb0fuO5DJWUnXYdArlfOGrLlBlJMEDgIgDk2BU6aH4YmL35pJzJxnrx3Jm9m8wa71I9SzEBZYZQ8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524252},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4eb0051aa775087c7e858a7f2540d90a500e363c","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0-rc.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0-rc.3","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_3.0.0-rc.1_1695652439070_0.6755629183253657","host":"s3://npm-registry-packages"}},"2.1.0-rc.1":{"name":"@mangata-finance/sdk","version":"2.1.0-rc.1","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.0-rc.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"ca8a81d2e9beac601920b37876c25531511a854b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.0-rc.1.tgz","fileCount":4,"integrity":"sha512-bCoP5vtdIM3lIrpIb0jb5pCc4wMUflB8Daec+JUEMa5dUtWUdwfqnd2vKPA+bJo4mzsh9LSJsMNF2F7iRwkJHw==","signatures":[{"sig":"MEQCIAE4aBMRzlMSjZ1FvULNePY0TwM7yG8HKKvJbDSIZSFUAiAGCd78T1RCYzw5kCR8GruibtAMaP7zkAlb77W2NTGvfQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524252},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1554732896c74e57315d4ee15e6dd2e129d453bf","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"8.19.4","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0-rc.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0-rc.3","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.0-rc.1_1695672730796_0.6191202987891498","host":"s3://npm-registry-packages"}},"2.1.0-rc.2":{"name":"@mangata-finance/sdk","version":"2.1.0-rc.2","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.0-rc.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"a4018707694ab3d142c328ece691534f52962da5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.0-rc.2.tgz","fileCount":4,"integrity":"sha512-F7LimC58iC6eXB+xe54ePDxjvmyqVaK4yu9uMmicP1I4/ayuD9rCuSezzpx5dtzWJ+syjoOR6Y1hSG4xPk+ibg==","signatures":[{"sig":"MEUCIQCZERah5mH37h3pW4cDBP/v+oH+tJ5thdLB6cBfVIRe4QIgYW6IlrZOmruIv4bPyMxM8mgiUaLsTw6poj5Tl7fj2nw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524252},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"9078fbfd61c6d4b7efb6944d2676a33560f57278","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"9.8.1","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.18.0","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0-rc.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0-rc.3","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.0-rc.2_1696841652249_0.034946704016666885","host":"s3://npm-registry-packages"}},"2.1.0-rc.3":{"name":"@mangata-finance/sdk","version":"2.1.0-rc.3","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.0-rc.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"217b5b8ab80e9b2969c72c6cd3f9b477db22c09c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.0-rc.3.tgz","fileCount":4,"integrity":"sha512-Q70rbjp2pu9gtn4P/wiYtxBNXP4IO3qyGBMTgHLRSBGtdh+FqS2ZWqsLeQMD0wCFZWVPuIcIymxvnrSwGe55FA==","signatures":[{"sig":"MEQCIDnjtNnjFx2m7XsDL3+78nOEff0ddxD53SeQ/EajhGY6AiAe0kIgjP0tSSvMusgcAHMzH7sxDPdJa2cFotFIYM1u5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524434},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"f148ea6f092e1dde0f71cb27b249a78831e614c0","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"9.8.1","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.18.0","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0-rc.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0-rc.3","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.0-rc.3_1696931424300_0.33554837321123765","host":"s3://npm-registry-packages"}},"2.1.0-rc.4":{"name":"@mangata-finance/sdk","version":"2.1.0-rc.4","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.0-rc.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"7737ecd505de1d855ee030b1c512fc714a9bf19b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.0-rc.4.tgz","fileCount":4,"integrity":"sha512-BPBnfrOibpoieLBM4wru7CQiHWq40hxTpwXxPf1/f4jCgzKPdC2qyOrKZT2jQSVUDP5RlNFWPw49Wk1hgUc5Zg==","signatures":[{"sig":"MEUCIHENhaMJkoG+Ji+3WFWirn818dRUR2S18SeSLOhMGGMwAiEAiNdFH9/ydnQtI63k4cGrOoC5ATfiiq4IZ6Zu13gYDbE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524252},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"64f803ccb1e7ed144c7c96c71099335f7df44da8","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"9.8.1","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.18.0","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0-rc.8"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0-rc.3","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.0-rc.4_1697096445287_0.648146327432775","host":"s3://npm-registry-packages"}},"2.1.0":{"name":"@mangata-finance/sdk","version":"2.1.0","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"5a49b9febd4e3ef7d01e567bbf950b6927f14531","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.0.tgz","fileCount":4,"integrity":"sha512-BKWcUBFflrMTTkrx7jYZ8AofcVn9HK2LQKz55QiLYe1gnUXIivK/Zy04QqSuZ695gFTyEzkmryUt3XrJQrJIiw==","signatures":[{"sig":"MEUCIQDGJvq+BhIToEFcrrKWwzZXTMSb5mSqpvBP4m3b4fE0SwIgE23z6Rg+PTKTf3Mr8UFWb2FHIpaYLWvJRm/s3G+cGSs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524237},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7095d83d36bc3ec3312d729af5d181e80c425a3a","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"9.8.1","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.18.0","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.0_1697115520433_0.12414051988551278","host":"s3://npm-registry-packages"}},"2.1.1-rc.1":{"name":"@mangata-finance/sdk","version":"2.1.1-rc.1","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.1-rc.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"f9e6be3ffe0b88489a99432ec1132c07b07dee84","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.1-rc.1.tgz","fileCount":4,"integrity":"sha512-houj+maeOn7AJPxAxGcI5aiT0wecb7/kpcgIS8trSnpafTZmJsV3gDnSb6mxpBDRkGMInbMoByrZZTYFQxcQkA==","signatures":[{"sig":"MEYCIQCiL02myEMtDHt4FGT8VXRIT5xJcm//IU52zgISzJtGGAIhAMZLM7rvqg2GqnYW9dsWio7AmpmEXaG2VWwumus6DqyI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524314},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","readme":"<h2 align=\"center\">Mangata Finance SDK</h2>\n\n<p align=\"center\">\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://docs.mangata.finance/sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"06624554da5bf2d9f62e213e9a115c634963d53a","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"9.8.1","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.1-rc.1_1699526883220_0.07409388387092242","host":"s3://npm-registry-packages"}},"2.1.1":{"name":"@mangata-finance/sdk","version":"2.1.1","keywords":[],"author":{"name":"Michal"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"dist":{"shasum":"c35720d156da4c56ea06176dc631f4e8f25d427b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.1.tgz","fileCount":4,"integrity":"sha512-Sbge0swlR2oFTi4QR6my2RjZ0T01SbKICYO2NOgT2ipUcva3gbpt0B+O/FJ7WfckrAYVsiTUmBmQc76euAgxxA==","signatures":[{"sig":"MEUCIQCR4wJBBvV7ll4m16rUkKEUXvmrtTRr0L3+tX4TLAScbgIgSzy6A9HKBu7ngsk4/QVGFh7reaczYq8BwWjOKIB/kDY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524309},"type":"module","types":"dist/index.d.ts","module":"dist/index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"f241ddf090ef3b47a71b275d019c7ad6c634095a","scripts":{"peer":"add-no-save --peer-deps","test":"vitest --config ./vitest.config.ts --run","build":"tsup","eslint":"eslint --max-warnings 0 . --ext .ts"},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"_npmVersion":"9.8.1","description":"<h2 align=\"center\">Mangata Finance SDK</h2>","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"6.6.3","uuid":"9.0.0","eslint":"8.39.0","vitest":"0.29.7","typedoc":"0.24.7","type-fest":"3.6.1","typescript":"4.7.4","@types/uuid":"9.0.1","@types/big.js":"6.1.6","semantic-release":"19.0.3","yarn-add-no-save":"1.0.3","eslint-plugin-tsdoc":"0.2.17","@semantic-release/git":"10.0.1","@mangata-finance/types":"2.0.0","@typescript-eslint/parser":"5.59.1","@semantic-release/changelog":"6.0.1","semantic-release-export-data":"1.0.1","@typescript-eslint/eslint-plugin":"5.59.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.1_1699617249828_0.6985692499246658","host":"s3://npm-registry-packages"}},"2.1.2-rc-sdk.1":{"name":"@mangata-finance/sdk","version":"2.1.2-rc-sdk.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-rc-sdk.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"4ef6cb1f6c0e2649ca3a6b88d5c8f834c0fcccae","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-rc-sdk.1.tgz","fileCount":4,"integrity":"sha512-2mu/eRfAYF5ydQjtLOo0J+fqZOYjCRMHAS2XGlOaisvPEH43w1p4fbb91w8ZZ2v4U3RsOhuyP35GDLqeZS85iQ==","signatures":[{"sig":"MEUCICUiUAqEkH6ufZeBik7Np4JzycP5oWnAwyp24k1WqxZaAiEAxfurUVi4u4sMo6ZygkfbCsCP5bIH7v2hqcx7iMd/uj0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520852},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"3616a0c2442d2e67fa259192f8f5de5288456299","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.1-feature-3rdparty-rewards-merge.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.0.1-feature-3rdparty-rewards-merge.12"},"peerDependencies":{"@polkadot/api":"10.9.1","@polkadot/types":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-rc-sdk.1_1700600790488_0.5807787794874113","host":"s3://npm-registry-packages"}},"2.1.2-rc-sdk.2":{"name":"@mangata-finance/sdk","version":"2.1.2-rc-sdk.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-rc-sdk.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"852643780a4aa96405935a5c3dff132b4ca4e94e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-rc-sdk.2.tgz","fileCount":4,"integrity":"sha512-+EzXoIqcH70jstQ9YarybZZ+5JSulsSYoFhP1w4Xw5ynZxbPncq255hgAnSouGtJrpFFbNa0GMBU1lRV053QuA==","signatures":[{"sig":"MEUCIQDrdVpNZn7v/3VMPNGNWbeIcw5yoqF+qyGCS22nXtY6/gIgLuBQ8zDEiGs2D9EY3b18UfX0s9AItRjD2h2nNCYiyUE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520836},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"23a05a330c23b65d6e2e92fafb7be61853a8fb3c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.18.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.1-feature-3rdparty-rewards-merge.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.0.1-feature-3rdparty-rewards-merge.13"},"peerDependencies":{"@polkadot/api":"10.9.1","@polkadot/types":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-rc-sdk.2_1700648595001_0.16268366274350132","host":"s3://npm-registry-packages"}},"2.1.2-metamask-test.0":{"name":"@mangata-finance/sdk","version":"2.1.2-metamask-test.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-metamask-test.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e2e5bf31e983021ac15e3c44c806dd33c8da9009","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-metamask-test.0.tgz","fileCount":4,"integrity":"sha512-RUdA2Ihd+/GYv5gl3sGoUKpopxB7f1xr4PYeV207Y1EbaxhxpMJrnZpcQl0MTgwZUfmpFx6fQEEZm4JhkXNdpg==","signatures":[{"sig":"MEUCIQDynBtIBeQGGvR1sdaWZWZV+6yxKHJUFDepSkegrtVQfwIgXx2iw2Z61BvwZyjSglv43LsDVLvFJaJrzKg8RhKa/wA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520843},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"23a05a330c23b65d6e2e92fafb7be61853a8fb3c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.1-feature-3rdparty-rewards-merge.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.0.1-feature-3rdparty-rewards-merge.17"},"peerDependencies":{"@polkadot/api":"10.9.1","@polkadot/types":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-metamask-test.0_1701865905633_0.025502280315508496","host":"s3://npm-registry-packages"}},"2.1.2-rc-sdk.3":{"name":"@mangata-finance/sdk","version":"2.1.2-rc-sdk.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-rc-sdk.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"4338d29976506ec3c48b255d6ea1682a2b0da3ed","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-rc-sdk.3.tgz","fileCount":4,"integrity":"sha512-M0K9rVy6xwFPKj2YC1lZuYbxIEJj9rLn432uUYWj9TjbCbNMzs/DXAXr41ALpN6LPerigfgbglluIjQxPKZk/g==","signatures":[{"sig":"MEQCIBK7EbqHdL9b7NR20E/hhaaWcbnNEVpOGOZyg6b4SuItAiA7EeprclALveZEXQHo1lWdaq5cXjNmWkdiu9RZb1JP3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520869},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"165838f0317cbec64050d3d7ddf4572a15ba4d10","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.3","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-rc-sdk.3_1702475020838_0.6004298256316689","host":"s3://npm-registry-packages"}},"2.1.2-feature-metamask.0":{"name":"@mangata-finance/sdk","version":"2.1.2-feature-metamask.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-feature-metamask.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0e1c51f716ded80e8b5a828d7bc9db2b84f9f028","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-feature-metamask.0.tgz","fileCount":4,"integrity":"sha512-6uqLSYnySMGr9ivizMKrpImr1TWmnCb4z+/MgPtIJHJcfwcZsnW8DCC7HWlBuC0c08/mkHIU0vSkU5BKpLRY0g==","signatures":[{"sig":"MEUCIHNXFmXG8H6JekfzUl9Lcr/5fwNuh30HYynnVK+B9bwqAiEA9IzsYsxcY6eBsoWPjDLnQuPRAjp6L6ubC9arVEthwZM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":526308},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5c0c309c8c8022a23b403b6cd6db05a35d88903f","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.1-feature-metamask.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2-feature-metamask.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-feature-metamask.0_1702629299386_0.04359365138272464","host":"s3://npm-registry-packages"}},"2.1.2-feature-metamask.1":{"name":"@mangata-finance/sdk","version":"2.1.2-feature-metamask.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-feature-metamask.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"056ff230a39ebd2c3807064160adcc3b7194374c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-feature-metamask.1.tgz","fileCount":4,"integrity":"sha512-AhGUN/WJ46OXdhuemG5NCuhUPh6vRC70j5oAtXojQxb/WmEr5n8U1wAlSNBiva32RTXaH8NpTh/ILLQG+d7xdQ==","signatures":[{"sig":"MEUCIQCPbXq4MoGT9+YCsC2LKdlVUq05Jc3UGU/KvYE5PMb0igIgPXPKkMaherh87hA8jlMsBoCmxsgblmG3vw9vyzNVMDA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":526308},"type":"module","types":"./index.d.ts","module":"./index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5f4325796b2f80add87ce9a2e08c8dc3edcbe6be","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"21.2.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.1-feature-metamask.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"@mangata-finance/types":"2.2.2-feature-metamask.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-feature-metamask.1_1702630407532_0.3996309267527278","host":"s3://npm-registry-packages"}},"2.1.2-feature-metamask.2":{"name":"@mangata-finance/sdk","version":"2.1.2-feature-metamask.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-feature-metamask.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"4acf669a1aaff9a662c0cb416c6f29096bddb66b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-feature-metamask.2.tgz","fileCount":4,"integrity":"sha512-1w281/AMbESQBgUx4dOXgXZl0jBdDEjRv4REzJHvTm2XqIv0qEOFk6gzjQHQV1P1bKNEmRUkcLUGsMXxVO4AjA==","signatures":[{"sig":"MEUCIHQz7btdmMmYSIa/tYhtTGbiAe5M5Gm98F0+FQSUe0kTAiEAxhKeirILgk1HIr87UdIKDmFvJptxWM4pNmCpTvA1y7g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":526308},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5f4325796b2f80add87ce9a2e08c8dc3edcbe6be","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"21.2.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.1-feature-metamask.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2-feature-metamask.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-feature-metamask.2_1702630471888_0.3999110086963209","host":"s3://npm-registry-packages"}},"2.1.2":{"name":"@mangata-finance/sdk","version":"2.1.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"fc1eb9377e2b119add96333c6dfe91ef871caafa","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2.tgz","fileCount":4,"integrity":"sha512-kmrETwuK8XlQ5hwk0S8Uf1pear0slcQAbnASzJLrbHVSLFes8bQkQ01a4b3yJx7ECYkDR7/n7QPpYiusnXtiWA==","signatures":[{"sig":"MEUCIHOz1kVXeZcmIuUK+MAw13ttQnINgF70q7u1n2jqGNrlAiEA3VB/dpYNs+wfVVMkWYW3QoRdCoNhtdQmON5bEpJK/dg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520313},"type":"module","types":"./index.d.ts","module":"./index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"894535251d7f8ba865b1ee9ab1b46b50217f2bfd","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.3","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"@mangata-finance/types":"2.0.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2_1702975479049_0.7106014315901859","host":"s3://npm-registry-packages"}},"2.1.2-rc-sdk.4":{"name":"@mangata-finance/sdk","version":"2.1.2-rc-sdk.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-rc-sdk.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"8dc16f97f389f54723ea28cb31549a7c240ddbd6","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-rc-sdk.4.tgz","fileCount":4,"integrity":"sha512-zafGdiJ/TfMK5CkioXPlflRvtln8rjejF7e9yvVI/saa1jLc4LGCih1TSvjaDXrZqyGzS8AztAPBgKC8bIph5A==","signatures":[{"sig":"MEUCIDIBX9WV23+neLBx1k5XhqtibD4hd8e+DBM3qbZA3DpsAiEAnqMyjrpSZH2joPCnaORWk4+xOzUFBdGMd458P0diEzg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520869},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5c20dfd9a3cddcb5263b6f8f0276961ea0a55a5b","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.3","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-rc-sdk.4_1702978797120_0.36475087927762884","host":"s3://npm-registry-packages"}},"2.1.2-feature-metamask.3":{"name":"@mangata-finance/sdk","version":"2.1.2-feature-metamask.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.1.2-feature-metamask.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"bb0be183115ccd199cce64c33d534f88e0aca232","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.1.2-feature-metamask.3.tgz","fileCount":4,"integrity":"sha512-mPC5KK3rguRjAov5XSG0irtiVnyFrE4MG8DNSsnFBSZxpEUR64IHOhsPaWzGjB/AefdsbwazyxHLW/QNzhA21Q==","signatures":[{"sig":"MEYCIQCPtHitWpAeD90Or6SyyP2MNp8HjE8KgKZk4QkyNe+g2wIhALf/ROABnEw8o9fgDXVIM/Ijd1Ihk8vyKEVPsB8W3iOm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524781},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata Substrate node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"da774ff93f93cc0cf04152bfa00eb2752a64a920","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"^0.14.1","@mangata-finance/type-definitions":"2.1.1-feature-metamask.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2-feature-metamask.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.1.2-feature-metamask.3_1704974202211_0.2542903643980099","host":"s3://npm-registry-packages"}},"2.2.0-rc-sdk.1":{"name":"@mangata-finance/sdk","version":"2.2.0-rc-sdk.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.0-rc-sdk.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dd2cd0dc42a0e2dcc2aa5c7bd541d2aa6c848ef2","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.0-rc-sdk.1.tgz","fileCount":4,"integrity":"sha512-jcpmVO7lCAEFTVHz5Ifyo3Bq5z/lK0sg/9B/G4pCwR2bItxmN77Iq25q8guLXk+RlfWZg5FXvOgPceI1np/mUA==","signatures":[{"sig":"MEUCIAmkSIjJI/Cd6uxyU1gfJF7dv0bBaiuEdRtPYe4S4TafAiEA2CgoTy3RONaX/IUCIQLjKW5CsKA/V4bJGAC+fyeT4ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520859},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b49fb41bce3960cf4915872c46260cf0d7916c4d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.3","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.0-rc-sdk.1_1705061548019_0.8297059411492542","host":"s3://npm-registry-packages"}},"2.2.0-rc-sdk.2":{"name":"@mangata-finance/sdk","version":"2.2.0-rc-sdk.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.0-rc-sdk.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"92ded9d4f040ed6ba345e7b4f93c66eec5a8ea5e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.0-rc-sdk.2.tgz","fileCount":4,"integrity":"sha512-RCihl0IoIMoLQOZXcurBlOit8fGJwl06CqI0aaUgKDoXdC8debryTCmU3C9CuFDoiXiTT6mCALHSixwrX4Eb6g==","signatures":[{"sig":"MEQCIFUZPfjKNWykQ/Gxb75NMRvwO2uZ/f26D+dc0Dx/pANqAiBRZAj0Q5n7PdAHM4teYPUVvixtn55+PIAXR7dehOyc8A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520859},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"ebc1a4c1efe21fd063d9efe46468e589394584f8","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.3","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.0-rc-sdk.2_1706003210187_0.3345623909832913","host":"s3://npm-registry-packages"}},"2.2.0":{"name":"@mangata-finance/sdk","version":"2.2.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"a1a17f1e753ca9bf84d85bca683b1abde05de308","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.0.tgz","fileCount":4,"integrity":"sha512-TDM6W8nL1c+laq14YwL+uiNAxKFkVBRnRh5ezsqQDoAsLt9k/fWNEYl1KEASptTD4oXpZfVcT0ORrULW3ogzTg==","signatures":[{"sig":"MEUCIQCSnsHGUaySqWyp8Jgqla6fz6PXwy+PneVzxmAdWm8WPwIgRiOrxx7UmXQWFYZMwbWRm+TYLdZJoVlvT0nYfszrPmk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520850},"type":"module","types":"./index.d.ts","module":"./index.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d139731ae0763e93db833be9fbac77a47c0f41f2","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.3","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"@mangata-finance/types":"2.2.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.0_1706170522003_0.755916491113295","host":"s3://npm-registry-packages"}},"2.2.0-feature-rpc-method.0":{"name":"@mangata-finance/sdk","version":"2.2.0-feature-rpc-method.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.0-feature-rpc-method.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"074f4642f92b9a47033b958c6ebe9ba02970e77a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.0-feature-rpc-method.0.tgz","fileCount":4,"integrity":"sha512-FlljiPJ2xtw/79Zrkn2jvSunsTAMjRRJv0b/u2mh+Io00YjcmXgSAC5yMDJj1naIBc+OPbcuD9VwVRQrcIP4Tg==","signatures":[{"sig":"MEYCIQDGGtJ3ZQhb25RNebDRhXDurXwmggxDioEo1GZdATlj/AIhAPUvWsUY7whhMEb0OPrb9UwhmQ8Tk+/DekUXTodUzB1D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520913},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d139731ae0763e93db833be9fbac77a47c0f41f2","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2-feature-rpc-method.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2-feature-rpc-method.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.0-feature-rpc-method.0_1707910555248_0.78492260577039","host":"s3://npm-registry-packages"}},"2.2.0-feature-rpc-method.1":{"name":"@mangata-finance/sdk","version":"2.2.0-feature-rpc-method.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.0-feature-rpc-method.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"5f03cba02dea86914ba332cfdaddf7a44e17bfa9","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.0-feature-rpc-method.1.tgz","fileCount":4,"integrity":"sha512-YzyUB/tajyO2HVGGRuFW+EI5OvVUasYIgwPXJcbgapflpPrh83VJZKg1lcWXJjlp9pyLnFDT8TfWNQAQ9szZ7g==","signatures":[{"sig":"MEQCIEeWZYWpJh/HlYxwIgxhes5EIqJf88Ykd+rD+70Iti2bAiBmqsyhimdK0jJNE3Xuk+Jt8t6Kj4KRnBRCOgkyF2NQGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520913},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d139731ae0763e93db833be9fbac77a47c0f41f2","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2-feature-rpc-method.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2-feature-rpc-method.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.0-feature-rpc-method.1_1708069798841_0.7941468710725736","host":"s3://npm-registry-packages"}},"2.2.0-feature-rpc-method.2":{"name":"@mangata-finance/sdk","version":"2.2.0-feature-rpc-method.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.0-feature-rpc-method.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"bb1593023a49fca34e0debc50d8b4f727e2f161e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.0-feature-rpc-method.2.tgz","fileCount":4,"integrity":"sha512-dqW1RYSIf/FvXgJ1Vecpc3jXn7T9GWXazdgCnpkgF3tvdR9p/YcyXglwLFE4Nx2U7GO03F7vnxFNT6Tcy+NnZQ==","signatures":[{"sig":"MEUCIQDsYE0X1j4QdTmGl9cjeRdnxsRAj6y67KVSyQm6BWbRvwIgHwRDSaDC6dwrvwaUrrT2V49012uoRzLLtFOCKpsEqX4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520913},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d139731ae0763e93db833be9fbac77a47c0f41f2","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2-feature-rpc-method.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2-feature-rpc-method.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.0-feature-rpc-method.2_1708074002197_0.7793219127769622","host":"s3://npm-registry-packages"}},"2.2.1-rpc-types-generation.0":{"name":"@mangata-finance/sdk","version":"2.2.1-rpc-types-generation.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-rpc-types-generation.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d2d07deb1dc597ccf3bc224e74a9a85049181b9a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-rpc-types-generation.0.tgz","fileCount":4,"integrity":"sha512-ItDWiKkZ/lpvvWzcygWD9nk7bo276FfklYHWoNr97QDSnf7WAw6AD6cxJuf3Ywi3lfIr7Yqn2e/C6AEnGh86kQ==","signatures":[{"sig":"MEQCIBzDTMsQvzOPUC0O5tyYc2tNfEiFoeoKy/UPvVgGIhzoAiBOH8EodFfNwzzjBeIjPTVDEbMIpbBvTcVucmLPLoqEEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520873},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"21f798a6f174c8f4c4a499bd907f3984db2fb855","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-rpc-types-generation.0_1708597004948_0.8653431049617393","host":"s3://npm-registry-packages"}},"2.2.1-rpc-types-generation.1":{"name":"@mangata-finance/sdk","version":"2.2.1-rpc-types-generation.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-rpc-types-generation.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"a1763a6355bf629d741c3086907f8a929cb6285d","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-rpc-types-generation.1.tgz","fileCount":4,"integrity":"sha512-kV61J41JjW2pJCMEK1YrSiTVRUIe1ZQjrhfLmpV6JIp5leKd4Wss2D9YWDyo0D+6/vn50LLm7l0GwcLuyhF6rw==","signatures":[{"sig":"MEYCIQDLe2Tx2SpMiNIXhYIz6qERb5bCGXKSenxdDNQLI3fqUQIhALzm5jdlGpnDFCre534J5AKkxEGm0FC7RwiPpZN08U34","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520909},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"cda21546ef8530c0bf6c56f4480d9b27ed694e71","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"branchTypeDefinitionsVersion"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"branchTypesVersion"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-rpc-types-generation.1_1708599149948_0.4505461737800516","host":"s3://npm-registry-packages"}},"2.2.1-rpc-types-generation.2":{"name":"@mangata-finance/sdk","version":"2.2.1-rpc-types-generation.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-rpc-types-generation.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c742585f496a0aaf13c4328714c649582f69c66c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-rpc-types-generation.2.tgz","fileCount":4,"integrity":"sha512-A7W7xsKrj3DP4+j9EtdSxsnLRGY5Q0JXiujZC4X7e9gye8DSOZ+gsVbMFF1cVfA2o/X4ZJFumX5V+GMxUh4LDQ==","signatures":[{"sig":"MEYCIQDVhP9vQj7X1qA3L4jummrh76saSkWWoSAoe2W812HP2AIhAPiFpciawdLc6/RpqCH+KWkKA83n92vduwixneS86Auy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520919},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d69a1d573e1d6c53d2d445dc11817ab8021d5d9a","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-rpc-types-generation.9"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-rpc-types-generation.4"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-rpc-types-generation.2_1708600005821_0.34983479410077645","host":"s3://npm-registry-packages"}},"2.2.1-rpc-types-generation.3":{"name":"@mangata-finance/sdk","version":"2.2.1-rpc-types-generation.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-rpc-types-generation.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"5cc5cde49865fbab454814265da040539035aac5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-rpc-types-generation.3.tgz","fileCount":4,"integrity":"sha512-JQg/Fyw8/xKw8aiFuw5VB3PRrTgORTugU7Z2yLf9TasDxCQhgSx6eoCAtdHqK/CBy+/KFUYXL7Uf7UtbHdlEgg==","signatures":[{"sig":"MEUCIFEBaTpLWv5fFra17MUG0eeeTWia25ny1yzhnjLjuPVnAiEA14Yr4L6/KaSaJPsU+AvP2KSh9gUc1FLuuXN/uj8JAdk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520920},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"8c436796bc98a21764ce84b39cf1bea8a9305d81","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-rpc-types-generation.16"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-rpc-types-generation.6"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-rpc-types-generation.3_1708604285845_0.2927285330493472","host":"s3://npm-registry-packages"}},"2.2.1-rpc-types-generation.4":{"name":"@mangata-finance/sdk","version":"2.2.1-rpc-types-generation.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-rpc-types-generation.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ce569d873d2eb8b06fba85cd0fcb357893232b55","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-rpc-types-generation.4.tgz","fileCount":4,"integrity":"sha512-VZlQLEsrJw7Tzzc3hVp2v3LCTf+sz9L7Ntg9Cz+f+roKOd0RKjNf6tWnN+oWoBgC64xig2ADBkix7iDBCVVz6A==","signatures":[{"sig":"MEUCIEZnL1yZTqpYmuUhOme8tWeBV0/pqKRdxHqvQoJt/2aDAiEA/V4DUuh6RaQnz8MFlKFAEc0dCK56LX7rnewQ5031L0I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520920},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"e24a9ea47ff72a37e1ab75f922fa386e34c1518a","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-rpc-types-generation.19"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-rpc-types-generation.8"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-rpc-types-generation.4_1708680965969_0.5834267760493701","host":"s3://npm-registry-packages"}},"2.2.1-chore-update-ci-automation-types.0":{"name":"@mangata-finance/sdk","version":"2.2.1-chore-update-ci-automation-types.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-chore-update-ci-automation-types.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dd0ce2d066a771b88a5a3738d33e767c97693171","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-chore-update-ci-automation-types.0.tgz","fileCount":4,"integrity":"sha512-tnqT0RKaeoruIsYp/PhKATK8bAkF8rBmLzBOl6gjWMqL1xUvmmukDUHxkg0GFq2iKguQI5miT1nM0GpORpzFDg==","signatures":[{"sig":"MEUCIQDnuWD4eHdLYiujKBoc+gXfcJ/R4Rx2/LLEbujNiQ+SJgIgToP0jm/qhEwd2hM7xqaXwd5w/adN2cZxSIxMvC+0YN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520955},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"884dc751e9bf4d4f86008aa28cc241c26f2b97ae","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-chore-update-ci-automation-types.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-chore-update-ci-automation-types.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-chore-update-ci-automation-types.0_1708943877118_0.7631388960925027","host":"s3://npm-registry-packages"}},"2.2.1-chore-update-ci-automation-types.1":{"name":"@mangata-finance/sdk","version":"2.2.1-chore-update-ci-automation-types.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-chore-update-ci-automation-types.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"78cec43868b2cffe6d4e67481fbc2dc23593a1bc","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-chore-update-ci-automation-types.1.tgz","fileCount":4,"integrity":"sha512-id/EgEFnjAYG+l7Y/x4n7FNY5107xkLX4uYRrKEIP7Cb5+pMfoZoYKbvpCUjGX+178hSnAngWSzUDsM4/OC4LQ==","signatures":[{"sig":"MEQCIFYSoWNh+ohgGdOXCVBFnDLp0WOdclVwkGY0uIkNzlaJAiBhuHxlH1j630TYMAd+IqzsqRkLA50aSqrK4wy4gSgPIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520956},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"062ed781eb5512774362f8b4c18f8bcb1f9dc344","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-chore-update-ci-automation-types.20"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-chore-update-ci-automation-types.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-chore-update-ci-automation-types.1_1708964057000_0.2506445821314107","host":"s3://npm-registry-packages"}},"2.2.1-chore-update-ci-automation-types.2":{"name":"@mangata-finance/sdk","version":"2.2.1-chore-update-ci-automation-types.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-chore-update-ci-automation-types.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c8f5209551e263d5743563767c20bd55491a8296","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-chore-update-ci-automation-types.2.tgz","fileCount":4,"integrity":"sha512-zHfs1u/L/WPDj4nbTa0rz3DXQ+hGB97RPcOcsq/R49QT2Xep2XniXJlubd02YxXGvtGWmnQQdE0u0m9y82SdcQ==","signatures":[{"sig":"MEUCIBfX82yyw0IGD49PPhmWWmT2VhaOZb7nhiLzhvxRykCzAiEAzLnJ+L9RRzlYkRnkbduMcGikNb40g5zjxZ403cZ2Djg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520956},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"97af9b16108d8b59954d8f4649f738050327987d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-chore-update-ci-automation-types.21"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-chore-update-ci-automation-types.3"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-chore-update-ci-automation-types.2_1708965376105_0.995726784498238","host":"s3://npm-registry-packages"}},"2.2.1-feature-l2-side-withdraw.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-l2-side-withdraw.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-l2-side-withdraw.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"4982d05a447d739853ee57b55c57e9d1c64e051c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-l2-side-withdraw.0.tgz","fileCount":4,"integrity":"sha512-febC/tVSAp30JhbjbDDtUcYCOwRdBSYneZeIXoM+I8D+1lCiRQ88x9CgGb8dXDXDDf5Te8gOqRINztho0HuGpA==","signatures":[{"sig":"MEYCIQCvh9e4txdP0DgukBT7Mukc9qnx4nXnQWoMRxkFX48+/AIhAJMYieOjRCUeM7lBbx7MBlsxYfBcvsZescSGX/y8NQ1v","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520931},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"1936e6e5ded21db652b76152a40bccc6eddcf325","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-l2-side-withdraw.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-l2-side-withdraw.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-l2-side-withdraw.0_1709154842001_0.9321966910097959","host":"s3://npm-registry-packages"}},"2.2.1-feature-rpc-verify-pending-requests.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rpc-verify-pending-requests.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rpc-verify-pending-requests.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"2aa336f91a93f211630539caf18d43934cea7460","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rpc-verify-pending-requests.0.tgz","fileCount":4,"integrity":"sha512-YyD7PbNAQf5qhI0fSvD7C+ilJGNPmLwHUrzwVSnPiuCShvN8EdF4t8R/78l9hvqHW+txnGQI4n8TCv8+2bj6Bg==","signatures":[{"sig":"MEQCICjBeyO+eoiTecxT41SUYiQ0GQpPI6TmTMa8QCcOIF7mAiB2C1vkqhal+n1NkqDaA/K7cwZ6h0l0pwWsmKKwOWx3DQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520964},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"bc7845204fffcf5355fb6368dddec0df3c769d66","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-rpc-verify-pending-requests.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rpc-verify-pending-requests.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rpc-verify-pending-requests.0_1709210468678_0.3105655082699641","host":"s3://npm-registry-packages"}},"2.2.1-feature-rpc-verify-pending-requests.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rpc-verify-pending-requests.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rpc-verify-pending-requests.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d77fc34bb5feb45b45a1adf6c89be9323806d827","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rpc-verify-pending-requests.1.tgz","fileCount":4,"integrity":"sha512-j5pd6MJieU6LaqWFLuZw02l66FXUILo5++UrkQof13z3cLrtY9Fg2FmG/jn59kjT9pp6BFSH+uU90d7tzB8B6Q==","signatures":[{"sig":"MEUCIQCe7eLzmbNJmXRWJYnG9hic8nbZUyVu9BdNG0IfFs+0jwIgC5v+rO2/Lma5od/wARDPUGHXfUyqwvCK7u48rp3KSCs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520964},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"20c6361f96c5058645319b14ca433ae48c827ee7","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-rpc-verify-pending-requests.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rpc-verify-pending-requests.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rpc-verify-pending-requests.1_1709286971266_0.6877574412498915","host":"s3://npm-registry-packages"}},"2.2.0-feature-metamask.4":{"name":"@mangata-finance/sdk","version":"2.2.0-feature-metamask.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.0-feature-metamask.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f1441ff59e81c1c43694e7a7bd14781e76b20386","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.0-feature-metamask.4.tgz","fileCount":4,"integrity":"sha512-MlPPpOM8+oh7S+cGcK1Uz3diJdUM6PTO3FIDPS6r6AdFcaeIgnB2qYaqpJIteocE6eWeUySVdc+Vw1ZXrCbujQ==","signatures":[{"sig":"MEYCIQDtOGalIct/3GusdXdYucy4vFITvf7epmfutrp5ARP6nAIhAO/KDLi2MrI7UZi4bagYWzM2eqkCejaWyGdvwYkG6CZM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":524716},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"ffad415da3cd0b2dbf959a881842e9c3c3767001","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"9.8.1","description":"Mangata SDK","directories":{},"_nodeVersion":"18.17.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"^0.14.1","@mangata-finance/type-definitions":"2.1.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.0-feature-metamask.4_1709290177525_0.9348274290221861","host":"s3://npm-registry-packages"}},"2.2.1-feature-limit-number-of-executed-requests.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-limit-number-of-executed-requests.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-limit-number-of-executed-requests.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ca8d360a0d9783c3752cf1991506fbbdde23fd7c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-limit-number-of-executed-requests.0.tgz","fileCount":4,"integrity":"sha512-nluRV+lh16geGGi6rkOCgyQiTy5tASqks+la5amIwJEeKL68yrNw1hQ4J77LEPD9tMXF2qlKmrhNi7zY0TBvOg==","signatures":[{"sig":"MEYCIQCf49gJtebiGlC8w2IX7q1TygB6lp9zx2/r7PKrzu8vDwIhANQjd4gjr9BVwW1/2ewuh1kg05GtGa5H7jXF3tk5qpAe","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520982},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"3fa844216c63f9d7c4321eddd0d44be7ac9d979d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-limit-number-of-executed-requests.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-limit-number-of-executed-requests.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-limit-number-of-executed-requests.0_1709583539223_0.2864954452711004","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.0":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f90988c441c215b68ce7f869251d85b4618a9cde","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.0.tgz","fileCount":4,"integrity":"sha512-x5nukhAdojXWfID02En5IwhMzl7gpFOXxvSltnzVyMkePbIk+e9u8Ck/85/56ztt9+af8T2xESM/2Nnq7H6YRA==","signatures":[{"sig":"MEYCIQC790uWhSaybQrp2iHd7PFykXvFloouxwMpKe+WMBXkpwIhAMKATrDWbLZg5iS9mNydgteBqG2nbOUYGMymgbPcqFbj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520913},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b43bdfba9a4cd555cede94162c5691e4f6505001","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.7"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.0_1709626153776_0.7479471621814666","host":"s3://npm-registry-packages"}},"2.2.1-feature-rpc-verify-pending-requests.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rpc-verify-pending-requests.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rpc-verify-pending-requests.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"8a4f6ff76c425c4bcd644cf4b4ed6feb088e1ac1","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rpc-verify-pending-requests.2.tgz","fileCount":4,"integrity":"sha512-I+sFJN3SIcnoy76hdVkkWbUydJhfBwUwDW3pYwjnyYOUrh9gl3Ptj7nQUr/7PdG5WpSaW/4F8CStqoCSE3/G9A==","signatures":[{"sig":"MEUCIQCviil4mTX/kHILU+o+vU1Au+xeNwRvtcIoeU9hjusAXAIgJzFbY0agZApfD1YhUav1gjJNjJPO0tcf5IPNKfC6eXU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520964},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9839fad19514e9de4f1ab811fea34ca76b1667d6","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-rpc-verify-pending-requests.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rpc-verify-pending-requests.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rpc-verify-pending-requests.2_1709631958574_0.9745716320405347","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.1":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"71d194df7ba3c5ed86232731beaca7dc7a94c54b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.1.tgz","fileCount":4,"integrity":"sha512-VJPANSR2+dZYn7Js8QCUQGBlDNUiQAycaw3TlOw3H3aJqw0WrzXEfgxgoE4Zr8vVjpB+cbEK8aSo3oFZFwt/0w==","signatures":[{"sig":"MEUCIB5eGc2O2NkZout9ncuJMY3glcF4QpCZRvQ+d2QPan1OAiEAnI0NoyxPSten6SkZ3Ii0B+cSg0nRJF4Mi+4NJLA55IM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520913},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"00c773048d00bf2a47be90b57652437aaacbab66","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.8"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.1_1709632774673_0.5466217229436126","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.2":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"4e1e3c494422c3ce8123ec2024a1b492c67fed27","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.2.tgz","fileCount":4,"integrity":"sha512-vXr/0CdHzxVRBePXY08DGrrH/5kHlle9doP7zeZwxUR4cd7CaARxTYEV4JmPTC/EC0gV/goFGB0VLBkQk/ARaw==","signatures":[{"sig":"MEYCIQDcUvjmgWr+BlE4vLSDc7idu9mmgr5tM0cvaytb8zSqkQIhAJqOu0nwZq7JOUmrV40Z9ueNThNr071R/gC0jSWUxl40","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520913},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"7a113671abe282dd7ac2ec08e205c246d54acd33","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.9"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.2_1709633691637_0.6945306351151306","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.3":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f41ab6215460c18ca539f5f6bf1f3c5eb76d5c87","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.3.tgz","fileCount":4,"integrity":"sha512-xjqBd+Hy1yqu9DvnzQfZKN4ngnLZd+z79j2bsQCzfnwEtD/wajUSwLS6MpbhWX4kVLuV57EJmLKer/N9Ir3CYw==","signatures":[{"sig":"MEUCIQCvGyKPT7T77ui8YBWxGjiAQSgZkHpK1mmPs8GAuNovagIgX6RRHISXLpDApwBAYis1Vr/dre0nqGSZ897oh7Uj7jQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520914},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d7d2b705e92d74205b28a0029b1bedd586ed4e12","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.10"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.3_1709638715927_0.42723891960969285","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.4":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"cc0f0a0857dfa1f4925be93b7049e6bf3d3cd002","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.4.tgz","fileCount":4,"integrity":"sha512-yXqZXY58+hZqb6wLPFwotLo2cvUs7huR5MaRNALVJW+2cFdi7vWD4J6bhKEQCWD59DQFoUl51l2FsH4niIGvBA==","signatures":[{"sig":"MEYCIQC+yj8wvwfO7JghU5BbBfQ2Ow8/xXA8xYrQ+RwTP/OmIwIhAPBND3/dREYGWDbmhkxtvLJNTu0hehDbtREhA6vH606C","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520914},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"236fabbd95bde186b7c412cdc68fa88612bbb523","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.11"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.4_1709641259643_0.693387818827605","host":"s3://npm-registry-packages"}},"2.2.1-0":{"name":"@mangata-finance/sdk","version":"2.2.1-0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"322effe55b940222307994aacbf205df837990aa","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-0.tgz","fileCount":4,"integrity":"sha512-8J5NThN8pZeOZnr//cke9vHPR1+ujhBwwe+T7/gJdNuT2jumvO8EqR69bPBb1mO3d/NYSAJ3RCH5NfD8RvgIpg==","signatures":[{"sig":"MEQCIAiakmKCi26ED40EMgosg8gmR/gn5eB9ZpjpzDjenc4AAiBRKHb6Zrn0LwwDGsKXi5qUOT/Skcxgomos89KEWGanQw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520842},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b1418a16dbf0d1456af76d6f84f7037bb5dfa05b","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":""},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":""},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-0_1709646329486_0.9885887355154896","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.5":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.5","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1407fae027226affbeac256b01a499204d911454","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.5.tgz","fileCount":4,"integrity":"sha512-XDvAjT7PWFBi7LOI9d4vpWSOW3ATaD6Y81knQ/hGbIjY9uoSUz4geBGt/Bzfb36tGsn5JbTqJA8aNqHc7HU94w==","signatures":[{"sig":"MEUCIArboEZVF+a6ckfHB05EsN8E+RfeSrkloUKeLICCZZtBAiEAk9YsHxSd60x6cB7KnbgxHcIgDQqALkAZ9vDeIFPi/Ts=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520914},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"57595cbe94024fd0bf6f06082578b677716f3680","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.12"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.5_1709653744441_0.9987675071964879","host":"s3://npm-registry-packages"}},"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"eaa9ed1fcc8048e11e8aaf11e1ce8322b4fa2a20","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1.tgz","fileCount":4,"integrity":"sha512-GtfTtYS75ErDTOEsVZdPtA4dnZihumUhp1SZmPZbXjN6t1v4R/PG049csMC5tglSpgNsYxaXGqUVvm3D69hMow==","signatures":[{"sig":"MEQCIHYNbS1qX5338DyCiFMrHU/NUxil1pEWR1vs3XkqxitGAiBkDKclQhnkSScb/UmPB5MV7oZxQonrmDkzHSboWmH0Ug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190328},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"acaf70891be0c90be2d6847e13ecf0613cbaab2f","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1_1709730678936_0.6901162893825243","host":"s3://npm-registry-packages"}},"2.2.1-fix-rpc-verify-error.0":{"name":"@mangata-finance/sdk","version":"2.2.1-fix-rpc-verify-error.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-fix-rpc-verify-error.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b41e5ddd4848a9ee9d9411228230fb989a232df2","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-fix-rpc-verify-error.0.tgz","fileCount":4,"integrity":"sha512-T+4wDdgczncGT5NyY7haQIvy10+DSNlSZaVSCqz0NHTm7Dyn3Z1DXMBvp7IM3jZKhNxV+aiJha/3cIBhu5/H5Q==","signatures":[{"sig":"MEYCIQDHI66f8D3rKiX53UT3JLWP7eJ6UKff67meVCYe1QgooQIhAIF3P4IhVJhL5ZYP9bFLKqnms7Ntk0W3Oz5jtEgmdje8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520919},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5fa01bf4ed5f881eb3d88458244cc81ec324714b","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-fix-rpc-verify-error.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-fix-rpc-verify-error.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-fix-rpc-verify-error.0_1709732790908_0.9880054418947242","host":"s3://npm-registry-packages"}},"2.2.1-fix-rpc-verify-error.1":{"name":"@mangata-finance/sdk","version":"2.2.1-fix-rpc-verify-error.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-fix-rpc-verify-error.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"31f7f88177c843643ec49961041916789b08909f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-fix-rpc-verify-error.1.tgz","fileCount":4,"integrity":"sha512-gxMUR4TAGmjXNGvvZuuGNPmbu0aOkJJfy7ClvW6hvUFSLv7AsnuCjfjZ30wIVh9a6MPaEVhHElMM/OGmFTybDw==","signatures":[{"sig":"MEUCIQD1g1sdtxyCgUUPplK6ryD7vYgrS07Zq579Qt2NZs29FgIgVLmmMcFbIeG7j5Um2n3dx9GkLrpMqtIFko+7K4yIAxI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190233},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5114eb6b78ad444302a4ef234843eef057b05691","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-fix-rpc-verify-error.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-fix-rpc-verify-error.1"},"peerDependencies":{"@polkadot/api":"^10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-fix-rpc-verify-error.1_1709744984706_0.09632939551345343","host":"s3://npm-registry-packages"}},"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"9044313a7ebbdae8536c52f5617d58adf8892a80","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2.tgz","fileCount":4,"integrity":"sha512-esYc6DeiBezu3RwHLu7b7C+WrbR139vg3StwpcpPFXxcj6of6JzIUosdopA0Y2LcBVKF/Col5Bk2Mz90Yz/cTw==","signatures":[{"sig":"MEUCIFk56LgbpM8rCCVYYQ0enxkeAhEYa5PzzQigMppzscLzAiEApl45HIgl8gc8So+UsG3UZKKXgBKKB9GBWGNtRB9+jXA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190328},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"27f6b00afbc299ff1a3229ccde1eaef7d3edadeb","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2_1709757800646_0.5930714677050462","host":"s3://npm-registry-packages"}},"2.2.1-feature-fix-ensure.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-fix-ensure.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-fix-ensure.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c2c672689cc629a3e4667a8b81e0647fd6bffa14","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-fix-ensure.0.tgz","fileCount":4,"integrity":"sha512-bwlHSa/TPaThEwQ+Xebg/BnTZzNJvU2Ryhs4RHdJaF2c9lJqoMDNsPz4X6gUWyvA8mcP+GtZztcsyw4T0b0QLA==","signatures":[{"sig":"MEQCIFLunnVPjMMtvQQyKQd/I7iFdN2Y615rI5HuePYyjpzaAiB/6YnhwjtSIcodFyHtMgjqKUoH6gyYjDfYwOR6jjktPg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520913},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"716fe3fcfa963b77e2ec2de4ee2b0cdef0d834cc","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-fix-ensure.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-fix-ensure.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-fix-ensure.0_1709812954559_0.04909937437973766","host":"s3://npm-registry-packages"}},"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"8155695859d5ee62d4d5bd558d1a43401fa395cd","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3.tgz","fileCount":4,"integrity":"sha512-V/FXMjJggR1rPxrfAqrs3fgn51DZJMdUWGlWZpKQXJYo1SLm4oSUxsX0L+GnPt6Uw6YwDI7eEqhMNj11kWugAw==","signatures":[{"sig":"MEUCIQDQLJoN5iIGo9g1n5zl4ngE5T7cdCJTBkAvzCWX2QdRjQIgHmjZ3T49o9uOJgcUyrtMzTRdxl+USjHQPk8upVxv5Z4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190328},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"68175567a99c5aa3d672de0c3d4358f0938584f1","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3_1709815495338_0.15750612817632348","host":"s3://npm-registry-packages"}},"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c1e755106e163cb9577ca0a0f24ee0c5f6f553a9","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4.tgz","fileCount":4,"integrity":"sha512-p+rRlaY9C6xsCXHXypsoeJO804Z3/cen9XVp/JvSgFb0SnZD8Iacm9Vlwd3pBuqmn2SpT6cvlHxsF98Uva6n3Q==","signatures":[{"sig":"MEYCIQCYIt6r2zj3xc5UM1r4dYs/al5FRgnZjLlw8rcVWmJ5KAIhAL9/QazoPPBGm78maiwtchTVuOJrhsMF2Tvn7KqCvVa+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190328},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"26844a4ab0e0a2e8a3e5e2f91b3b296fee69daf4","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4_1709819957585_0.03623455670377984","host":"s3://npm-registry-packages"}},"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e48effe5f1d11f4e4b5089ea97c365f4c89b989a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5.tgz","fileCount":4,"integrity":"sha512-gGbSqiJUztszep1yKWuAlGv3jzcJISW1lkXUePHxhazjg2Hr362kUjnY9IKo+mi6iH+HK+9dDm9MA6ynBsPliA==","signatures":[{"sig":"MEUCIG/L8sTSXwL2GFjM2qoP02RlHd1LEwScYN7YmFlOH+P4AiEAli6LIaBRfRPzTyJ39QiNcEBVY1YBT3U9Cxoxs26HrE0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190328},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"aa1e386a63a212c90424dfac8b02e096c0f94073","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5_1709820587697_0.5380226307915343","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.6":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.6","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f40d2f334bc33a0fb4450fdc5900331aa4410297","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.6.tgz","fileCount":4,"integrity":"sha512-gccz8EXF7rRM1rvo1ELlArhjRrEZGgddXJNgD7NriOxYkEsN97T6u0FmWkznKgMyIiANvaA6Il/ExzZDIzHRUA==","signatures":[{"sig":"MEQCIAldJfmrDFqOHUJ0c7oIsLsCxlAjGqGRsVE+ENDRzX3nAiAJ0cOZ0/tDfGoNGdYgq5W/sbpyk0AimVYyMZnVLUgOxQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190227},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"a032bbf2de5c6c8f8565beda4cc59f80f55845a5","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.7"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.13"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.6_1709821189537_0.8260063012259502","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.7":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.7","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.7","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"8c75b7aee0f4da00420f539a901d3227196429f5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.7.tgz","fileCount":4,"integrity":"sha512-SNw4S0xAMBoLwzpWOve8Pcx6YGHP9jr5b2FSkFmkKMZwl6zd1Wzq37bxjlOmwsEjPGgiiOCn6jh3uBgyj16v1w==","signatures":[{"sig":"MEUCIHLfD0FarKSDCDg5AMxcSdSkwMxlBOJpkUIfi8af7n72AiEA25g0RgJiv4NjfemGyMz3WEnF1dhQNret8tSAVKbCe9c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190227},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"bf2fd69054eb5ba4a12ef07b6fea444bb3378cd9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.8"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.14"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.7_1709823518100_0.8989545704586408","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.8":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.8","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.8","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"467e20a2383a39978cff876c47a587c26fa76bff","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.8.tgz","fileCount":4,"integrity":"sha512-2gMW/FBMNMIYXT6Bb3o5kjOuyISc7SstmPB98t+eV1oTug8DiRIk9ZIRSDRZuTkYiGkKwE50ZvmGc3YKE6lXGQ==","signatures":[{"sig":"MEQCIFlFyBVgQZpHG1sVAa0Wphd20SVYnl2R4pTuwwWrVP8lAiBSCOQsNSYHTR1Uu80uRl6DiGIpf2gO2xnsKo1EdMsPpQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190227},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"982f4ed7c20787e91137e23958bc21a23c1662f8","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.9"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.15"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.8_1709899420723_0.32149771585627684","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.9":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.9","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.9","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"3fec95c966250fb78278111c9265694d56752b67","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.9.tgz","fileCount":4,"integrity":"sha512-hay95aIgpz5YTxnU20sUativ6d8yOXU9M9X0cEF9dWJWXR22TqjZBVJy2S2hrSlVW/KJd8oobwVZTTr9xIweHw==","signatures":[{"sig":"MEQCIFUQ6/jwRobv1PsQ0LjCHODc816Kqkgkn+tElr37kkiQAiA9XKbfaomcT50D9y5bQ2Sc7weknyW7UzrcKes8KoK/Xw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":507746},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"3cef2a2610b4c4e9c10c5fd7fa29bf72f22a7e9a","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.10"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.16"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.9_1709901615962_0.9198020932185051","host":"s3://npm-registry-packages"}},"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"3c27eefe8522024346d4007021364185644b4152","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6.tgz","fileCount":4,"integrity":"sha512-OhQNYqKCUlRKeiUtB8Ljte0SM6Eo4yNs+846IdhnUfr4BweCEN+gvulNrCcZTtdb9JwZv25nE0LEXNMsbqrrOg==","signatures":[{"sig":"MEUCIBy+fVy8h6SGE6S5kQbfKQRA3/AvvqmTisljfK4GmJIvAiEAqVLX0m3+OU2tB9U+Xuo3FdqqbC9Kvf2nlRm71P8dCIU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":190328},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c4c2c20cb90cab9cd81a0cd0824ca750bdfd4bb7","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6_1710168241815_0.45746043174394524","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo.0":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"bf263eda2dd950a2315886ac15364cd8d4b42074","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo.0.tgz","fileCount":4,"integrity":"sha512-7NecP5ZuaGnf9payLUuRTcWqFItEKAFAID7NPgJ9qgxza2/KDJd32tvfmak8Udo76+pKsHgTNO35gSO2W955ww==","signatures":[{"sig":"MEQCIBP2TBF5tdtMGmcHurXzmy+P2RKuDsZBOfn8e7dHL6otAiBTjaAQyFnKcEx3OL+Hcj+kfwl7oIKdHxu/itpcUg7Btg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":507759},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"48d09f4cf9ed9344acf2a4706d437c1745c3034c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo.0_1710169943285_0.6684561036548755","host":"s3://npm-registry-packages"}},"2.2.1-feature-requests-blockhash.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-requests-blockhash.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-requests-blockhash.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dfb97e8912b08ee3e73adace7367442b64125989","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-requests-blockhash.0.tgz","fileCount":4,"integrity":"sha512-QuKqO8MZp1io06X+IZxZqMQs2+f46mojiZ0Kwt/Kk/3nqC+wpevWGqDz3GPtyLC6+KzAbiml41rTSV2Iw4Ld8Q==","signatures":[{"sig":"MEUCIFD/MdpD5rYNxol8vlk1JX0tDJ/IDhTN2XtBUlML0a4cAiEAwZkk4JNoEDq6ve+zMcYC0CNedyNlEsjZr0F7tA/bqVw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520937},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"151bea409cb5ee009e3739f0a0162747d7ca0bd1","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-requests-blockhash.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-requests-blockhash.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-requests-blockhash.0_1710243373306_0.4470598011567444","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"6e72d597eabacc073b7654889432b7dd97ca8a3c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.0.tgz","fileCount":4,"integrity":"sha512-B94gGrcitQjLztM8mMtA8QqDaCl4/Rb6pepRc0/xxYKSbzQjYoE+UYoSaL3kgJuCfdIf3Vjd2IIAAGHUmB/ENw==","signatures":[{"sig":"MEUCIQCxt1DzRjNxoPYpFpJLb+VDtygDeJ+GhOu96P9NqiX1FgIgGE8ODYg6WJtIWDodwgjhoAJJq9DtiuVDBIfYhCuDHTo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520916},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"aed416fc7843b4a6516d290e542ae668f1a9c879","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.0"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.0_1710368091751_0.07479051856404673","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"3c224b0ec1f63ba3f5c51efb4b44ebebf0f7190e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.1.tgz","fileCount":4,"integrity":"sha512-cnkjSt+0HXJkmwd/Inwo1AN7w3SZKwOjuzm0bu0JQq/+hXBpzUQ9+Zi74MOVDGWQbLYzNW5ZgfDPxM9F2yhcBw==","signatures":[{"sig":"MEQCIDqoDauxlp/9hgwE5kPj76XecAbJHBLYRSWzrBYDPhaGAiAx5N+yvcMpVMHcXKJx3+NQTM3G0wDD0swanRt419a1TQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520916},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"a5311761b70b9c87d9d033f9a09ab17b3d21072c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.1_1710439968764_0.41203687381489207","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo.1":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"66dab42ad3babf4d56d04f835d2ec47dfdf4fb74","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo.1.tgz","fileCount":4,"integrity":"sha512-4ngpmnAWn7xh5HXkckBZ8iFoyqUjfPOrjPIZhRJPtepzs4mBJ0r3Sff/wstRgzbaMsRHuI01BWFDXJRLbhu0hw==","signatures":[{"sig":"MEYCIQCwt6DO39sKUdCu02kbv1DFopw70DZr0GeSEcNsy3QaGgIhAJ2o4nzonR12K3OVf7BPN129wAn6qDFO2SnZOqQchZ8h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":507759},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"f729fbb3f7a4590dc7124c4a07262b59ed969441","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo.1"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo.1_1710445124185_0.2752218150954304","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo.2":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"20696f55c68c1cc41c502ca0c30c51d6cb5087f2","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo.2.tgz","fileCount":4,"integrity":"sha512-pgyh1rjg/DHzCojdf8KXRLLBz8va1K1qYbghUf6/aGCZZgXq/RkYcjWDwExTkUmLLKn68u09mv3IO9U9Fx6gNg==","signatures":[{"sig":"MEUCIQDjGFo7UU5rcO+keQC0OatMbkIs0/oY/r6bgxTww+1evgIgKDKB3pycpiTr4gaVp0bZlMtaG8NcopI69HOxyrN//O4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":507759},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"88736a895c536a90f1e23748569034d275f25579","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo.2"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo.2_1710449494367_0.17005860910450932","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo.3":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d4ecdb25e12d6e392b710417a7f6eb19d0ef3a71","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo.3.tgz","fileCount":4,"integrity":"sha512-S3eSBAERDMs7dMsMZTFeRxl/SmmxawenD62jFozr/nlonPo4BY/BWuGFiIZ2rrpH7WOPpD4rgT/idAhr6GbERw==","signatures":[{"sig":"MEQCIADaDkO1QPPFSXimHFSV3v25g3AqjCZATJgJKDHH3Io2AiBlnqP+xJ2IrvlemoP2bjYkeRUHMa0pJ/xaFMNyyT0Ipw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":507759},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d18b3ea1156141c510579a83c13b2a1753468ba5","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo.3"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo.3_1710454337906_0.7355080289475395","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.10":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.10","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.10","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b960c6f30a8914499d390478d92ba9fffb07e25e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.10.tgz","fileCount":4,"integrity":"sha512-xIryHEvlAMKytY/QuA2abGm8VKx4p332fRSyR8SOm8Ikf8eVTExvI4k9n5RsOBgk9XmZTzDhKgiRJhq2RHDj8Q==","signatures":[{"sig":"MEUCICwMBoscQD4O12/n289GSxmiyYBZMNcnZD2/kkgw569wAiEA/ow26PC4Ewurqnp4ntvZnEKzd9YKeqWeITHRCaIjlio=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":507747},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6221e12574936f9c0fee6c831640dfe17dd7f259","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.11"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.17"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.10_1710486934584_0.5652418886192221","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.11":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.11","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.11","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b0fda4d8dfd76a28d90a6c7f2c67dbe4ed73c232","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.11.tgz","fileCount":4,"integrity":"sha512-7OJmThHT9ByioauYx3JURgX9yaOWzmwfiLy7EYy037QQJflWRDVFL1CqDaSMY8j+pdBaKTWcMjG2SerNkx7cLA==","signatures":[{"sig":"MEUCIE/drMag2VP6PyDzEKyjjlfPDyvLIBWz9nPa9BZtM+5tAiEA5NcD300jY+AG0Tvsp+bx4EJ5Qzxw46ant+LxSRPvkt0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":507747},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b13e226b600d720343a431991550cad7b3494182","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.12"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.18"},"peerDependencies":{"@polkadot/api":"10.9.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.11_1710539383740_0.6849121901753321","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"15777dfe31eba46e8ce814092cd186a8fa19cea4","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.2.tgz","fileCount":4,"integrity":"sha512-X8J18rY+VzsTvgfXF6yXvwaM1Xkv9akwWljNiS23U22p3JN+WeiOnEFB77+6meKMW9AqtP1++8ufRLrlOD70IQ==","signatures":[{"sig":"MEUCIQDOwJN4wYk+P7wn0lE4bZiabegs5xg2xWgfLgfouKhgTQIgEj6phNVSGLveoUV3RWlQpvduBxaCIpS4Zfq3iUP30no=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509085},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2e8ac79056c51af86f0058a12d7124ecbf38b879","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.2_1710760337403_0.07966596543693938","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1598c183a7ae2856005150ae8bb5ec353fe113d4","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.3.tgz","fileCount":4,"integrity":"sha512-OV+CWeRM4h9PeFq8I1cgq5c5x64RaZXd3TAtL5HD+6Gbs8gcHUzw+vS636GZ16ZztlprlZDfOXADG8JF/HR2bQ==","signatures":[{"sig":"MEUCIQDBo+g0Gtysma60TDrvTtifDrkXIryl4sl9cgm3X9XQsgIgL2rQbFfOFISndTz0UaJvkyDtk4psFnXj2btcJuMrcxM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509085},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"1a6dae454af81c510e487be1c5447ff1e1ffef64","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.5"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.3_1710764456789_0.1842144227761222","host":"s3://npm-registry-packages"}},"2.2.1-ci-fix-fungible-envs-deployments-MGX-944.0":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-fix-fungible-envs-deployments-MGX-944.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-fix-fungible-envs-deployments-MGX-944.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c28b6d5dc3f52d7dcec148054c6e16c9c38d2e09","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-fix-fungible-envs-deployments-MGX-944.0.tgz","fileCount":4,"integrity":"sha512-obzlDpR0TkhOLaPssd2CyGSTqL5Zg5u3ELKyrNz2zVDPfA8DjGv41m8yMr0UMo7bSPJosN72Lv2366rjVeoI/g==","signatures":[{"sig":"MEQCIF/Y0cCAiJwr61Mj/3fWc2MMGm587HF3G+o9zKuD9DT9AiANNcl7aavaNsDvZRdkOS04Bpqz20FAMXj7J8BxCeqRQg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508568},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"94472fa622ca7d77cefce6812f8cf57c1cc44ba6","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-fix-fungible-envs-deployments-MGX-944.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-fix-fungible-envs-deployments-MGX-944.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-fix-fungible-envs-deployments-MGX-944.0_1710774405870_0.4852673357932582","host":"s3://npm-registry-packages"}},"2.2.1-feat-raw-update.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-raw-update.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-raw-update.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dae451cdad5a5ae3d49ee11e4723934734de869f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-raw-update.0.tgz","fileCount":4,"integrity":"sha512-ZNn3CIO/+1BcIFJiS5f8ruYrKtzkRZkCm7LBNYvN+ZBb2S433zLGQUuM1y85Kjp471fC2gaefVgGnKvEpk+nfA==","signatures":[{"sig":"MEYCIQCodtYWOdvl1Fbe4ChluMEdAuCQ7Ofzx9tTLNnjrpGdrwIhAOHKDyizPNqWj5itmLqRU0ARmDkSaBbwOCHsQ7ZkZCkw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508493},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"e7c16c3162e686f345486c8939be11540b5a4713","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-raw-update.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-raw-update.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-raw-update.0_1710775262379_0.8524195670365808","host":"s3://npm-registry-packages"}},"2.2.1-ci-fix-fungible-envs-deployments-MGX-944.1":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-fix-fungible-envs-deployments-MGX-944.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-fix-fungible-envs-deployments-MGX-944.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"6f659b3defe60be9f56c0224752cd42ffeed50a3","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-fix-fungible-envs-deployments-MGX-944.1.tgz","fileCount":4,"integrity":"sha512-3C3sJxhW9LyTkv22dKb1XS3fijFnmd3WlsXJYfF/RqKzGaMVr7PCvKTOI7AEaCN808lytm8FRKv5l3KKf/xvXw==","signatures":[{"sig":"MEQCICLLlWRR7XX4ejnjo5yGZiBfldP6JU5VLqkOiFBFuvi9AiBlPnnP+/tp/7QPuIOuql9qIAukjHhmjooBajjVRD1IJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508568},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"61901ee1a7cb2a26e408c08dd9f72fb3de085bbb","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-fix-fungible-envs-deployments-MGX-944.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-fix-fungible-envs-deployments-MGX-944.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-fix-fungible-envs-deployments-MGX-944.1_1710776251104_0.7842746495162061","host":"s3://npm-registry-packages"}},"2.2.1-feat-raw-update.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-raw-update.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-raw-update.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"322937407819ede3effe69f0dc80ce29f3ace64c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-raw-update.1.tgz","fileCount":4,"integrity":"sha512-jC6NPAm0mALwQLye3QRC23gvGqWH+f3rh3jMttMz3f20s40KlL3vnBKI1ZNbSLYovJxVqqi9cwoEkHhQ7e+kWA==","signatures":[{"sig":"MEUCIH321Q/PpIDcXM/Z6LIW3oDStlWGe1uAQAPvfRsQlBUEAiEAyL+JyGhIbXlkscGTkWRsJohmXpwtCR5AuDy/NIc5vvw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508493},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9be6a26dbe5ee41541f35c22ad02c50449c79415","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-raw-update.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-raw-update.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-raw-update.1_1710783820053_0.4207180436080824","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.12":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.12","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.12","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"cea654bb83ef1fcaf1879a8cb62e4d36062ddb99","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.12.tgz","fileCount":4,"integrity":"sha512-CxZmt6nnu1keyGa0WfHfTMMdN9fi5hQL+QukQcOZXC9wYv99EuN0iCUwSc9xUrvbf/qNtDx/fL6H8NtxT9u5Sg==","signatures":[{"sig":"MEUCIGSHRafNz/FV5qhZmrbuLHjyumvGW+xMQas/+b28GsILAiEAg97ZODSjc4a8JOjZ0L5KHFDC8zooFulFoH4f0U6/auU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c881c43d0f789923746bce34b5cd2c8586bfa188","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.13"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.19"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.12_1710792916660_0.7668202901356878","host":"s3://npm-registry-packages"}},"2.2.1-feat-raw-update.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-raw-update.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-raw-update.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0d950c089243027705071cb046b0ff3711857d8b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-raw-update.2.tgz","fileCount":4,"integrity":"sha512-T5haFqR/d/zgg2hg/hFvHhpbPuJOL/lgiGgMiG3rs7IISdXBov5+jD4f34SlJZqMIBqM0cS75sdLYV+OWp8lsQ==","signatures":[{"sig":"MEUCIGRddbCOkdX3BqiMo8yrCzuz7tkcM4QeDG3abpuDtz/PAiEA/pmJuU8fatB2l34WXsK83/XRceepMiof3UEMqaVhcYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508493},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"89fae751dacef91a022f92d4d961d423ebc15009","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-raw-update.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-raw-update.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-raw-update.2_1710850740793_0.5594018927397844","host":"s3://npm-registry-packages"}},"2.2.1-feat-raw-update.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-raw-update.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-raw-update.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"487ed0614d3f7578456e22bb7aa7aff38c48bf0b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-raw-update.3.tgz","fileCount":4,"integrity":"sha512-H0T6KHFo0TCEsZfoYc7t3V6bfMrAaU6qNahP1lG5N4m1eeMY9uUnLwfC6WqhXoLhaKHCniVaxdCleipRxe6LaA==","signatures":[{"sig":"MEUCIQCepLKBC1a9rERqiv5IEiOsSOhadpvSb3mJCjALbMcK7gIgb7t8zOgimHO2OdSe3j8tOmt9AMvJ6VQZ4njXnOX30xM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508493},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"8e67491fcc870c1cd63f774b5acb9716fbb8c97a","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-raw-update.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-raw-update.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-raw-update.3_1710925068672_0.8322388184082332","host":"s3://npm-registry-packages"}},"2.2.1-feat-raw-update.4":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-raw-update.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-raw-update.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"2fc7d52aa2b1e5d7028cef7de317f4c916068545","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-raw-update.4.tgz","fileCount":4,"integrity":"sha512-+NjnWBhn8lB7DgZeCN8teZlVWsBKhs5nDw0O/Q5vu2X75jnR7A7CUmc4+7TxkaYT5CcxIh+IQkqN0OCxAaQ5ig==","signatures":[{"sig":"MEYCIQCWABBgStcQx3KDkkKjZKZndsSE7h4GEMMOpJLfIcIjhwIhAL4O7/DZwfo7ohFb+QCrW0Jx/LvWEKLpTga06htuIYvt","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508493},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"a5e75c151b6be758b56c78d0ef6d3b4582601d81","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-raw-update.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-raw-update.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-raw-update.4_1710929755880_0.8718935173394107","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.13":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.13","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.13","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b812c794c1b057da515240389b7ae86e0ec0d562","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.13.tgz","fileCount":4,"integrity":"sha512-u+vddJjFubFaReIZswXv11TrtPY+pKY9J+PMmXhYCYKBRCXFg/kJXiLsQksppsPnCaDHFVoTSrlkvV7qTpSV4Q==","signatures":[{"sig":"MEYCIQDwSlLOCuCwaRWHTASuAtjE/d1TbBhlGvCiyt5xlKVeTAIhAIOo8viVKriSR9A49XbUUxjjkRy+45aJs6y/gbhKqPsM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"57a3c6bcd743f65fbbb6fe5d47a27e8595138eea","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.14"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.20"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.13_1711005076653_0.11426868191141915","host":"s3://npm-registry-packages"}},"2.2.1-feature-consider-withdrawal-resolutions.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-consider-withdrawal-resolutions.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-consider-withdrawal-resolutions.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e4494bd14373b20aa56453e4304bb8fe5be98f3e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-consider-withdrawal-resolutions.0.tgz","fileCount":4,"integrity":"sha512-JIVBgtA3ppLitlMSbo7iGOI+Iy5uEfXdU7DQ0KpvZVCzNkA0eDOdfe5tq4NnqhSXhVZnGac8Ioq+oBMmZgvvCA==","signatures":[{"sig":"MEQCIHCHMlc6z2/QuZRe7az71uNDM0Kl6ycLofPD/Kk5FJ6+AiBnUIIKJ7PTxSBVl3TGxuLv2Dz0t2qIdEVMbZYWYxgVtQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508565},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"320675e6547421920584a33d1234af9939e26d24","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-consider-withdrawal-resolutions.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-consider-withdrawal-resolutions.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-consider-withdrawal-resolutions.0_1711048134909_0.9089317232180245","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.14":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.14","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.14","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"8f7b58c10e93189781f78c81a95d6b875e38d1e3","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.14.tgz","fileCount":4,"integrity":"sha512-pWIrMggYWMBzgvSJ7WUTkxyPanzFWygyzUsnwMLkKt81GD0Z2a7PFfZfbN7qz2T/UQrrNrTa5ZlyxWSjOVWhew==","signatures":[{"sig":"MEUCIQCTX0aY7CyBEX7Y6BXRCBLkxUr5/js/BKMdS+VDyhgSJgIgIqXniEKnEKvCInrsU6wOaKJ8RgVshi8kfZXc4vm6uhY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b2235e083a3600f2971df071479c63c37f94c1d8","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.15"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.21"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.14_1711048998740_0.4034569089382867","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo-seq-mod.0":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo-seq-mod.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo-seq-mod.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f3351179ce7dc99542b20da26f5b4014a217723c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo-seq-mod.0.tgz","fileCount":4,"integrity":"sha512-VQZZf/F0YrOYwiGwYKnkwpsmJ6rsVcgJo9J5syjSmXzzAnqZYJBD+/koYP3zpygYcJ1E1vJZvfGrsd3zS9ik8Q==","signatures":[{"sig":"MEYCIQDt6B5X0bu6+Yxl2xTC0jgKCB0fWrBl4i+ORoTeSi129wIhAKkScvBdyc055RL2/u3iPE5VaiANHZ1KU3g01uu81cKv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508541},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c2eaada665ed10f20da94bd3ad5d282804e60b62","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo-seq-mod.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo-seq-mod.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo-seq-mod.0_1711054859176_0.5866544672524612","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo-acc20.0":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo-acc20.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo-acc20.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0aa90384a62e8d22278367b7cdbb765e13cc2d68","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo-acc20.0.tgz","fileCount":4,"integrity":"sha512-NFC8C4hjh2j5Gd/UOxWVqL2WByX0lKrf8g/I2p/LMoLwnWAgozSE/3zpbyBqb3z6ROdIKm0pY4vSq3OONK+KZA==","signatures":[{"sig":"MEQCIDXlyJaUq6LDklWytHW2dx2pKQvfylFdO//mQFaaL55nAiB36oPaUtnFEEVl5juGuNEsosILTiEEIheMQzevSjIPWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508535},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6894e5e6e48ba63cac030202798efe4a3833ae1e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo-acc20.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo-acc20.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo-acc20.0_1711155634256_0.12559677962188243","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo-seq-mod.1":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo-seq-mod.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo-seq-mod.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1e985d0f9a3f6ca1819313154f241c4dc0d74ff1","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo-seq-mod.1.tgz","fileCount":4,"integrity":"sha512-lJUbPFgI0RhCsl1+qC9CudVQRRG+8XfTvygRqqGs26vNddmsYePRYhxBeQEYyfPIWQtGDVv/eCWeqxewXmIgbw==","signatures":[{"sig":"MEUCIAXdYtBBdWpLug5ud0QpZiW5qbyjuwyAeokW/YCMDUWWAiEA8HmatPHUA7wkLiwwKbHirDYMwMvAF89zT6g+lrGIZuc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194013},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"ae7b22509c404e2caa1b9289caf92e932f4d32c8","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo-seq-mod.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo-seq-mod.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo-seq-mod.1_1711274741998_0.7872799154225201","host":"s3://npm-registry-packages"}},"2.2.1-fix-storage-hasher.0":{"name":"@mangata-finance/sdk","version":"2.2.1-fix-storage-hasher.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-fix-storage-hasher.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"15c9f10a5485b64b6cc5fb4d0b4c375d188a4e01","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-fix-storage-hasher.0.tgz","fileCount":4,"integrity":"sha512-rA3XvVSKjcGmGbYdSk6x48fTspzQGYih/ZofgY/nbYMgMHG69TCSsfO797M5c76ecY7SjVZlMnF4WFi4VC4hqQ==","signatures":[{"sig":"MEYCIQCAnRVgrtT9zLhLaeYt+NpoiLoNyXso6Xw6D7uJuNpi+wIhAKzx7MD04y9//RV79vIOhGD+fWGEey6S6oaYEJ5vSu+H","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508502},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"faace62753b86aafb58c7cd65e16209e138eb68c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-fix-storage-hasher.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-fix-storage-hasher.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-fix-storage-hasher.0_1711365501643_0.421888645091256","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo-acc20.1":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo-acc20.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo-acc20.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f76aa036d1076438b814cc832877f85c201a54d8","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo-acc20.1.tgz","fileCount":4,"integrity":"sha512-sQcyzU2LHWibOid4LOXw3tx5yTMjPy0CW4SrlYbZLU8p33pYzj9nOD9yXxqbMULceItENNqOedN8S8Lpvj4Izw==","signatures":[{"sig":"MEYCIQCOzFth8uOaLweQT4gjgoX5gV3mJH3K343qqqEmQ+SijAIhAPH5+NeAz53qRQOfbKEGd4Jsa2EuIbwUDDahD5MrXy3I","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194007},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"85085fa7d8002ee3723ee8fdb58c86528842c239","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo-acc20.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo-acc20.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo-acc20.1_1711366644305_0.4986523399211018","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo-seq-mod.2":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo-seq-mod.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo-seq-mod.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0d742b5feac6b1545fdac49d5223b9714227bff9","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo-seq-mod.2.tgz","fileCount":4,"integrity":"sha512-EShy0/lfi7LmzO7jAeCrg9hsB3+uxmQVqjnefTSQ4LhRD7Us8i1Pqs1Po1dJYbuWpipfdWIVzDqFYC4k1ZvR4A==","signatures":[{"sig":"MEUCIQC7aiFTqxtn27YSNs9Wg9Z5GwccXJgWEUXUhcMRtmJ11AIgVjs35DK8NX6uzIzCpDd5ny00rJgu9DNwdXhGq5IE0k0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194013},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"3025a8975af38ca1b9aace99f09797ee968af507","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo-seq-mod.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo-seq-mod.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo-seq-mod.2_1711404303304_0.7036721209644492","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo-acc20.2":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo-acc20.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo-acc20.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1ebcbf5f14ab949d041fea193c0d232923ae2bb8","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo-acc20.2.tgz","fileCount":4,"integrity":"sha512-KyP4VJdcYl9iNTKDMalv+259N5pM1eGHitja87430j+qc54M618B9Un+MhNd7KXmOEZVE0rMtmQEmLFYzZmmQw==","signatures":[{"sig":"MEYCIQC/okgFTrWbCtRsVW0QXejjEuCBMzYnUkl2bskdlPQuEwIhALgbgaECwU8L962Hg4ddcPLDk1EiQ9t+v/jGJCEPsQUE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194007},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"a798a8b79166112fdde3a3fb787129b692e3f872","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo-acc20.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo-acc20.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo-acc20.2_1711537508713_0.005455102530435907","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.15":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.15","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.15","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"a09c75fc1a10484a773ea355bd0593e2e431caf0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.15.tgz","fileCount":4,"integrity":"sha512-boGhGFeI6a13AUYC7PTHUc1RtN5J+YhUtu7fEPejm5Azi+Lb9r34wUD13oqzmIG2ypD/NQGv/aoEuN3KdlRyBw==","signatures":[{"sig":"MEQCIGObTU6xLZN2G9AvsjEBJFFaQZM9bMC76pKf7JU2zKqgAiBaAiiFKf4O6dFnQAjkfNdVsHf+gQzV2CeX0p77+1rbzQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b3f2d422e7825a53e61afd831f3bb6b3c4e7279c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.16"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.22"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.15_1711538350178_0.3786683907653916","host":"s3://npm-registry-packages"}},"2.2.1-feature-timestamp.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-timestamp.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-timestamp.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ee2561be188958a6288016c75635c8caacd16009","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-timestamp.0.tgz","fileCount":4,"integrity":"sha512-Ir+cVifOBj1Lq5XoW+LOiusottbJe5FvaoFbQ2XSBduudh36aUGbzB5xUvOWtZGVylzao5KRLQWfWd/SzLIbmA==","signatures":[{"sig":"MEUCIFzojp6Lxwc9yw+OrG+q9/fnFpxfK4xwRkaZqjBinF3CAiEA2MqvKogyzayh6Hkugr9WzAH/UEJcfpxSE3fssRfthog=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508499},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"4760957a4935b201cb4ca49e3cbc643f336d316c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-timestamp.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-timestamp.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-timestamp.0_1711538920546_0.19864263042236674","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ae1767d64f398868987bdbaddd0002b87bd5599c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.1.tgz","fileCount":4,"integrity":"sha512-M7b1XruEU9zMrukOLhEA2Bl+uhztTO2SZ8EV0oYb6R+t9za8njP19OptxkYzoS+3w043yffRUUXe+/uKI35tlQ==","signatures":[{"sig":"MEUCIBG0Rc/5ZPlICabWwkjj0apxahfug0rtQQkVX5Asm3G7AiEA0uH+gmM0UiR4l1s3LVCfP8aEqxBLq/Xt1f2lKFQhSc8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"bcbb32374e1284f79cf5503e4f17e420936eeae5","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.1_1711539513590_0.567419594220788","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.16":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.16","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.16","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ee5fefb3cc2d3289f240f55dfd0be3e7367d4ac2","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.16.tgz","fileCount":4,"integrity":"sha512-0C0qgfPlqizaKWfyR89f+WQ/W4Cj6CeulM8RHMHuqiApaSUxxL8Z5WD9zyBSFoDeT2pUcvwIO3cMFd+4f1INpw==","signatures":[{"sig":"MEUCIQDGssz8BgWtTYhqzmlVAzeqLFmtDuGWDc+kDRhu6G5XkQIgIuHwrwM7uTxtj9j6GykE8nxdJbIY/SCEG55ctrE8HvI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"448291589357bff9bbf39d66e7f4d71f825241e9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.17"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.23"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.16_1711545506782_0.5207585787835238","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop-solo-seq-mod.3":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop-solo-seq-mod.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop-solo-seq-mod.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"9834c555fbfc49648d30abc0e74ec8d133798f93","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop-solo-seq-mod.3.tgz","fileCount":4,"integrity":"sha512-c5tk4nzPIhslhcxMakmmMYJPGfJB89HEkhK30oMBoe+1PFVYxugosgWJt6S5RNzoAqpj9h4v3At7F6tuNoKUEg==","signatures":[{"sig":"MEQCIEHZbYoRPxXzJmNDyc5GPmKXchNVXPMgFrJm6i0aPAcBAiBVtnos+sflyGj+7XNHVY9gj4HvXdFnW82x9rx3IWhvGQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194013},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"216104c432bd93299fc157ae0acb5baa64f9c144","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop-solo-seq-mod.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop-solo-seq-mod.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop-solo-seq-mod.3_1711627367199_0.5167987365281601","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"7bebce3547ec1e8bfd7800e6119fbd2dc7b38ab5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.2.tgz","fileCount":4,"integrity":"sha512-GrSdIRA1qrPj1f0GVDf7OtQe1TgAdVWPzg4+/d1jAdF+qlDGvC7PEgh17sSWTOySulYEWxDT4rr9lPCmwfxUGQ==","signatures":[{"sig":"MEUCIEcNeaytOjqSeuqMZgD9cB2e4A8+odNT0ib9Jj5JHoeoAiEA+9aoSpeARFzMPrWOTfS7N2Y2P206yDxWbwIuyP65zeE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9c137acdd4b90a2d609adac002f34cbd6a6dc9bb","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.2_1711631536349_0.5454379825482727","host":"s3://npm-registry-packages"}},"2.2.1-feature-timestamp.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-timestamp.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-timestamp.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b484bf264823fb97e2bee85909053edc7c806e8b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-timestamp.1.tgz","fileCount":4,"integrity":"sha512-Uj8ZWdxqCp9Nu4c26gOR44xm1GvNINM1nXH1Vo2wXVVTbTaz7DhmwNZZnuF4D0HBR7CVdl2XKSjQirDl0Xg0sQ==","signatures":[{"sig":"MEUCIQC6oxvHuZCZlFj9DTTMKoQpdPyRYRxO5cKRgRFzuw7e+QIgOxanqtBfp6qYDJBn0z2bf0P3yILzH/kBX148UDo0eWA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508499},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"bad1897a62a406d82cc9bb7b2af1647e8da0f112","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-timestamp.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-timestamp.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-timestamp.1_1711705345493_0.14536587364304188","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.17":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.17","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.17","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"5ba53b918b20034fcfac64e75dd3ed75ef810375","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.17.tgz","fileCount":4,"integrity":"sha512-G92nUI5xYAKXKhEYn4TqnPWowV29tip5+H/9kiTCgtGOhfltl8pPZu7bo8CDTbCtAyDluOq2Ednw0r8hWNg1ZA==","signatures":[{"sig":"MEUCIQDM6no9Qtigk4oG7nbT9pO/d+OEePVeEvsLFatXDw8zHAIgXE9+zHHU2uTrT2C67aXciBRaFZ8/5QEzITtFMePQk4o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"04953af292a1f7ee0f0567b55e3cc014ed989b4c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.18"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.24"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.17_1711711989948_0.5774574634562659","host":"s3://npm-registry-packages"}},"2.2.1-feature-timestamp.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-timestamp.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-timestamp.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"50137b39696bd411b935fb0287f1b5b6a7ece6d9","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-timestamp.3.tgz","fileCount":4,"integrity":"sha512-B5CVnjoGldad5Hl9a26xrccvzd81UrneMiYMo7fhUf9QFZP2no4+pckoqFFNbc3jP66IMAmpfvY9fhstCkD+Ng==","signatures":[{"sig":"MEUCIC3j8O0acZFapVRW2DJJwkvfbyp8GCzd2gie10T1L/uNAiEAhC+ODVyOFPR4nsiK435mu/8oR5AjInjSROtays9PQPo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508499},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5f7d942e9797d32fd81ab03af7037ea1b5dbc5c7","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-timestamp.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-timestamp.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-timestamp.3_1711716009398_0.3872729018110379","host":"s3://npm-registry-packages"}},"2.2.1-revert-714-eth-rollup-develop-solo-seq-mod.0":{"name":"@mangata-finance/sdk","version":"2.2.1-revert-714-eth-rollup-develop-solo-seq-mod.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-revert-714-eth-rollup-develop-solo-seq-mod.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c3ebbfab9cad456aadaa9470920da365ea42d3fb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-revert-714-eth-rollup-develop-solo-seq-mod.0.tgz","fileCount":4,"integrity":"sha512-NuSrNe4UNqd3biZMAn6VlMi8J9uKvHa0prFphPwIZzRytGEPnD6D7SqNTwOcV7UwVJ4VcoXvIefYm46jHK3Jcg==","signatures":[{"sig":"MEYCIQD0IYknFbCGuXX3WYseyhIz6SRQlffVpdvAAbEB2wpasQIhAO0brwVW1cZmETXEKmlYcuWvGWXTJawaMQxISE3gW45S","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508574},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"86dae972a45fbffa07dec180f358f06ecbdaf7cd","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-revert-714-eth-rollup-develop-solo-seq-mod.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-revert-714-eth-rollup-develop-solo-seq-mod.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-revert-714-eth-rollup-develop-solo-seq-mod.0_1712042644322_0.8443738856744576","host":"s3://npm-registry-packages"}},"2.2.1-feature-fix-single-sequencer.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-fix-single-sequencer.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-fix-single-sequencer.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"8e4bf8ac1cf50385bc84e708e6b43f5d561357bf","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-fix-single-sequencer.0.tgz","fileCount":4,"integrity":"sha512-hLCN/C/d1yto7nMLBZpQbaatFFt5W4mlHW5zRBTrHqppZFLaXvt8UKuVatOiS3DJ8zlUiGQ4Og3cPMTm6k5Iww==","signatures":[{"sig":"MEUCIFVvP42EydRuDlR/+II1gbasHNGxFFrjYYprUF63AT1DAiEA2Pg4YiB/Xe4YzU5bMgaXHe9p1B9E0Ojp64PWte52D7Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508532},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"7eb6bb225e13af060eeb0cc3e335f156c1f0087d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-fix-single-sequencer.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-fix-single-sequencer.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-fix-single-sequencer.0_1712123155258_0.4871034276217554","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.18":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.18","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.18","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0871e87640574fa5c7fe72d4ae629d133f19145f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.18.tgz","fileCount":4,"integrity":"sha512-0oFhEu5MaxRTOuEa6pe10sm7tmEStVAIK2ipgMnLHtAvjz02HLw2Bb2zBZ0cbV27Men0Umy0QDefwsDrC50YIA==","signatures":[{"sig":"MEYCIQCKfSlfK+5Nk5sT7WXyijJhea5P7xPCeSm4ASwqq5CQ0AIhANGWWPycpPpg6CjIrnth22eeK0OOfmVm6Yada4X6e1QY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"3789863a40d6fd9929d234dab5bc225504fb28aa","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.19"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.25"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.18_1712128128942_0.2502940310397863","host":"s3://npm-registry-packages"}},"2.2.1-feature-timestamp.4":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-timestamp.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-timestamp.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"a7d6bb39e46c64912c3f1efe18237b3ceda75c00","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-timestamp.4.tgz","fileCount":4,"integrity":"sha512-BdOXUVTncvuUo+jrRkhZpw/tSYDJAunh+qp5ugZRP/2wkGX8OlL5j/L3gM7CsU9mBTNZ5mD88Xe4dDcF2umqeA==","signatures":[{"sig":"MEYCIQC6NEPoFPZnrJjWHgk5GLUkRkHxvHyL2xermkMgjuVFbwIhAIOyB+1xfVZmYBTvr55VZMx+mHnMaTcWbScWgDhU7Eng","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508499},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9e3939c299db2c9f025bbb5a700f8bb2a228c1f6","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-timestamp.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-timestamp.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-timestamp.4_1712134618271_0.33628114762085515","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.19":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.19","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.19","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"43946670ef72d1b2151b3ecd57e154d80638322c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.19.tgz","fileCount":4,"integrity":"sha512-i9r5113bJmrSIWdD2oUmY2CgMQxiwIe1HAd/8cNGNV4Q+BO1CWw/q2W7bpo1v3Dux8hqGih2OHCJ0KasIDMowA==","signatures":[{"sig":"MEUCIQDadzEVj1BBRmpFFBM3Ne0a/2gMgjovYR4ll57P2lXakwIgGlSXZhclQMayE08V1UvWb0MT5zvtb1CSOC79p3NUFew=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6349139ddc93d7bd0b18c4bd4cd5eca466a06d9e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.20"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.26"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.19_1712155044961_0.35936882666617675","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.20":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.20","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.20","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dcd37ac4fa7b3d18c980b88f0929447145b781b7","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.20.tgz","fileCount":4,"integrity":"sha512-D1W45x21AXJBRIc6x/f24YIfZ5YTIjZh+IyqhYSLNrEEgy0kTuIjgD+5sVaDo6AmFw+ujr2PIXeSeg0ln0G0qg==","signatures":[{"sig":"MEUCIQChbsreHxvkc/mDCU3XR45MD/OMWb7giW4Fd/GWHh6smAIgcgkvDgjKFNV+d5iX+GmHUylMC0ycBvxj0zNUMBWjCUc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"e030a959d7fe8361b39e503f60e2b1fd4e69ee1e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.21"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.27"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.20_1712216738414_0.6985634506025131","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"2f5348d34c692c354fa3a0f5604417a377de2d2c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.3.tgz","fileCount":4,"integrity":"sha512-L/AqW47sIkIWp9/sw32ZR6ls/PVWzNjy0A6W8uUBqLdB8dCl9jcmuUK3T8O2cPQs+UOCAt6Dvv2DkPnclm9vsw==","signatures":[{"sig":"MEUCIQCZ5VJOym3qb6KRXRfF1DlJ3S8gecpq1NSMBhY5Sdoj/gIgewhTIt3U0Jg0OSxIDg36XCz/QW/qfiN+4VGKE1VMkZ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"3267de1d068c5e5ce9c099fbe6d6206dff2dc1f1","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.2.4","description":"Mangata SDK","directories":{},"_nodeVersion":"18.19.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.3_1712229369610_0.6327163395075772","host":"s3://npm-registry-packages"}},"2.2.1-rollup-feature-stabilize-seq-rotation.0":{"name":"@mangata-finance/sdk","version":"2.2.1-rollup-feature-stabilize-seq-rotation.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-rollup-feature-stabilize-seq-rotation.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f033ebe3102ffe5961a35da268e2cece0c943e4f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-rollup-feature-stabilize-seq-rotation.0.tgz","fileCount":4,"integrity":"sha512-lYFP7iOmvzsTgeq7bTnkkKEbTLo1Xx2y3XY3Ns80Gf9EIur4qyCpY1AxlGl5iFQcw4vOGMuSbG29++NncaOwRQ==","signatures":[{"sig":"MEUCIQDTrBOHaZ2HE6BHdlCzgs7tlAMdMF3/KU4Pphdozi1NlAIgZkHg7Cjf8kKqj7wJE1STW67em+c/o4iCiJOSj6iXRvc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508559},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"ca8dca0c01f491cf455188937e94878992e9e39c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-rollup-feature-stabilize-seq-rotation.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-rollup-feature-stabilize-seq-rotation.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-rollup-feature-stabilize-seq-rotation.0_1712522736549_0.6232518789664989","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.21":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.21","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.21","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"de4737c6a8c9f375f8197f00e310a27ba45f3b53","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.21.tgz","fileCount":4,"integrity":"sha512-fV7wg0ECcDn5cKyrpy3YLYTF1YIL7M/WpyVJ1l5rXxowpK4ShliZuNttDbat8uaT8BF6wuraX478ou6abyxE/Q==","signatures":[{"sig":"MEYCIQDypyCI+JNABVCySVNMvtVgugzV7jJxBPkXLcgj7VlOIgIhALC0J5yYYeY89hZl+zpYSdGwjGtHcpHopC7Jirn5h5cB","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"ac26514ef73e975c11c4be85d3ce963f6d78addf","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.22"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.28"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.21_1712562124619_0.2255456776811524","host":"s3://npm-registry-packages"}},"2.2.1-feature-native-eth.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-native-eth.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-native-eth.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"09e21afa8b60ccaa645abb89a1a5062b18d33d34","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-native-eth.0.tgz","fileCount":4,"integrity":"sha512-K/jQ6x/VZBoCb9FygFBvDClMAtYU2/Mi2MWs9tYFl4G2pBdbW9JlZldwJe8W2Gi1L5CnNn8WB92NDopoUuacBw==","signatures":[{"sig":"MEYCIQDdUQ2QbzLEJLQOyJV7IH2H6G5kOyAlyxMksg04PR0u9QIhAL68/QxS5ysQOD12h7PrOzHbXg7Z7EMA/bUKvCOEG5Xb","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508502},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"bcfa62b86d967fee80786cac30e1882d2f9e06fc","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-native-eth.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-native-eth.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-native-eth.0_1712578988845_0.05728659434978889","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.22":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.22","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.22","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"6ee4607804f0b7ea771090f29798dcf021b28852","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.22.tgz","fileCount":4,"integrity":"sha512-/JcY+gIg27AisW6o95zZOMZjnXG7Xhp2oBLwbfv37J7JlnfPLnkPQfIR6hAw1qUaQ0yigVy9PNcIUsONVcYf+A==","signatures":[{"sig":"MEUCIC43JfBc/fnYAG5nW43jwuK79E9Mrwg+it9/y+9hI9cQAiEA7Wfs1GccyAs7PcuNBUBS80zg0VM2XGYbdK+4k6nr/08=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9165586a0401d6ed06ba7d30dbd573beb6a30adf","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.0","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.23"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.29"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.22_1712581929408_0.3613647542889731","host":"s3://npm-registry-packages"}},"2.2.1-feature-fix-compose.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-fix-compose.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-fix-compose.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d82045968c9eb885a3d5145f8b7572f4ff31d6e8","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-fix-compose.0.tgz","fileCount":4,"integrity":"sha512-JdkPhkb5vghVKxtA3UjYk5BsXV0qMtAsTE/BjvMdE2mdbX3qmXG/7czSNOHs2d04/U/IXoZn05ih2QYQ6rZxEA==","signatures":[{"sig":"MEUCIHgz6oRcyNBImBrtA9dHStd1um6SpfhvE2KXavd9bPBfAiEA/VeYwH3AMzBK+CD9NaX6w+OVbVnn/S/uYMTtsQ0H0A0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"01e201bbeb23566895173d427f20b12632be2314","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-fix-compose.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-fix-compose.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-fix-compose.0_1712663289485_0.8338400982808267","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.23":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.23","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.23","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"21a7a0f52a534324a9abd6a3566b231f9ceecb1d","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.23.tgz","fileCount":4,"integrity":"sha512-HAtLyIldMpXrdivMMcbkSz56jg0ALVtr4AZklJ9S450mGSc/2sCaARkMVueJXIe16hR29l1byovsPjrRwXsROA==","signatures":[{"sig":"MEYCIQDuXo4DDmJ/NYJX9MbMBk8rlnwiKMN+UFUo4/Ji7EYrOwIhAJlPXmiE2tsaKhsc1QTOxCBrdjvqBFeoR+g9JkB2ct/D","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508505},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2b55356cd22542097c55c9d749253e9007abbb24","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.24"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.30"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.23_1712673537737_0.33117803227292253","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.24":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.24","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.24","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"4c27053cdd117132398c4bd58aa6171a1ec1e7c0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.24.tgz","fileCount":4,"integrity":"sha512-yhrHeN/ep2CmNNyuvukm/IUY8rvKTh187yRIY7Qw/XNnCuj9x7R9iCE4XDN1FXDayhYgIU4sg2S5deXxtcXWQQ==","signatures":[{"sig":"MEUCIQCqd5n2I0PZ8I9OuVnkmY0ia3/o2degXej8Rep+oGzLtwIgGDT3F9B11QjjJtLk7NRUyCAon0OfZrftfcbJXxpM6vw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"67e3cb24e4e4b7e15e28d9f2a1b50e801ee5b26d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.25"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.31"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.24_1712750158319_0.5941339116732551","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.4":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"7cbab7f603c78db42fb78c978f980f58a3415b9b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.4.tgz","fileCount":4,"integrity":"sha512-JSyxE4lGLqQPnbDkvBzYZavk7vw1Ylahcq7+q9jqR7aNBDuY/blGABaDS7K8lXWGFMxsw/d4D1GJ6i5UXqN3QA==","signatures":[{"sig":"MEUCIQDbVv2YMPX0dfcocIdT2Bixn0ZxeplzZm1gXJSJkwBMawIgRnBXBjdoZQMt8eFxGiW1TbiiS6OkHJ9CgeZgs/grrbM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5f8f124f83dc3efee3043fe4fb8f40fa1e537550","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.4_1712838769183_0.5906605162802181","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.25":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.25","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.25","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"8e93bc0b984c49d755770127fea004379aeacc91","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.25.tgz","fileCount":4,"integrity":"sha512-ZPBxrfVCuOBqteCTcf2ze46LqZuIe01LEilIW8At99gkfVZV8ZWyZ/VK5rgo5YtGxkpm4ToiJlz1dhz4zMb9PQ==","signatures":[{"sig":"MEUCIH/OKP0qp8aa6P09TtXu0fS2Kc0gN2q8LsMoxYKAYTrWAiEA8rGg0fvLhwY+FDWuDbte/QaOEqJKULBEJk7bDy0gtH8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508485},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d432fb36ffea3aef608a953d4406eedcd2bc8f95","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.26"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.32"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.25_1712838987445_0.0007161392083951945","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.5":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.5","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"eba59d990ff3b87e1c58b66dabfa96f57c20897a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.5.tgz","fileCount":4,"integrity":"sha512-w5pjCZ2q/4xOw43b7uZfLtWdoN+5+gQdruCh/pxgoapTRxyMQ9k78SU+ggelYIuH93+EzdoKw1STjAawc2wn0g==","signatures":[{"sig":"MEYCIQCiKwikhlcbnCg0Z2yENt/iZr51dXlZ5/D7b5RavN0j1AIhAIlNLtlQfH4O+odESI5G503PZm8F5oqeod8cgIulo4jY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5b56b565eaf618409f892945d4eeaac78c43cdce","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.5"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.5_1712840966355_0.6418798280821196","host":"s3://npm-registry-packages"}},"2.2.1-feature-testnet-fixes.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-testnet-fixes.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-testnet-fixes.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1132de42944b9009a15745b861abc7c900b3bddd","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-testnet-fixes.0.tgz","fileCount":4,"integrity":"sha512-oZBs7lyzr/A7QzAkUBnS+ygkdvqvF2yH+uIOlcLenDK29TmI7uEFt8dNyP+H3kkWuxE/Q4Yerngovr/0m5Dfxg==","signatures":[{"sig":"MEUCIQDWJOEObpts/AMwywZXfE34b6sgFQlL52ao6MQPdYffZQIgIocMT4h+Q1EOeejjLIWHY3a5Gpt8NEVexIWoUHbYL1c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508491},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"aaab6be5968f6126ebf78a6ea52df07990fdc0fe","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-testnet-fixes.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-testnet-fixes.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-testnet-fixes.0_1712856869553_0.745904183728779","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.26":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.26","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.26","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f0e8af4dc232566d98a7b3e27b035a804327c76f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.26.tgz","fileCount":4,"integrity":"sha512-kr4Gwk06lBSaloXMiimiqj3P9WlcExV4+U3T8Xwn8h3EeRK0sD1qMVHg8+SmHbHV6yUfAx7yOknXdKC7IBGv9Q==","signatures":[{"sig":"MEUCIDwcn1wil6jeAmfeIccZZOcjgys1n7JCtViBaerlY5hfAiEApV2CmNqpAIDz8PBAwWyswnGi64pOQvMBU6LLGqm1eDk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508485},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9f83ab77fbe138e67ccdf83a36d18fdc10cbf1e6","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.27"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.33"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.26_1712859215917_0.023290848452827362","host":"s3://npm-registry-packages"}},"2.2.1-feature-isolated-testing-crowdloan.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-isolated-testing-crowdloan.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-isolated-testing-crowdloan.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0801cbf57b7c0e3c52e003ed32816dce6144ac0a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-isolated-testing-crowdloan.0.tgz","fileCount":4,"integrity":"sha512-L22/gpcVmdEXh8HuLeX83mHz3JFa3pdhQKqIglV/j24Lr1BiMwkzWGJAsaTsHJi/zyCSyq+PSdYxMNfwVB550g==","signatures":[{"sig":"MEUCIDm737DcRkwX4D6c5JcO8Vz5Ht4K6hO7rmVdwbsfDurlAiEAjzqAIJGA1I9yZi32LpSuPqRrupGXpSz0aJa8ZOT0pSk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508530},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"632cb662906a3dd61f7a2a49401982fe68cf9ad0","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-isolated-testing-crowdloan.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-isolated-testing-crowdloan.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-isolated-testing-crowdloan.0_1712908158321_0.22247541058361597","host":"s3://npm-registry-packages"}},"2.2.1-feature-isolated-testing-crowdloan.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-isolated-testing-crowdloan.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-isolated-testing-crowdloan.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"4bbd98710ad40731f234699348ca25924fe23d3a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-isolated-testing-crowdloan.1.tgz","fileCount":4,"integrity":"sha512-p2DfcC49yf38+2oJiFl0dJ3OOZlPY6pbe+8UVnFfDaWfU6WHa04Dp9aMsYKJiCKKFM+ymtDv4cVywfsBg7UEEQ==","signatures":[{"sig":"MEQCIDoSn9l9g2x4dI5ZFGXPlJS9gh6tMJh2vBjZjQHL0cSRAiBNekn696ieVlPqgfxMRbayEUy2ZKeq85n9/bB89RY+oQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508530},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"88427a7ebc1b21473bba66ef11250fef41a7e310","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-isolated-testing-crowdloan.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-isolated-testing-crowdloan.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-isolated-testing-crowdloan.1_1712909257844_0.8384694118491849","host":"s3://npm-registry-packages"}},"2.2.1-feature-isolated-testing-crowdloan.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-isolated-testing-crowdloan.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-isolated-testing-crowdloan.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"329a37a7c5a080cf47940ee2fd2dfbbac1834563","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-isolated-testing-crowdloan.2.tgz","fileCount":4,"integrity":"sha512-5BJ52fkRyCS5YdxpnzvrixGclPZJzy0Eww0zq5Y8l5Nh9PRtR/rylNHdJtwT+UeF3oROPPJ2Se5BLJerGK3XCg==","signatures":[{"sig":"MEQCIDZRRWvpjGvAXTpxW0+HTXNdDO0i+y6fTV2ebAOFVujLAiARKe4sHmypscGktsHqDk13/DiJgI5DMqSVmdboJ5o56A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508530},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"f49de1229a6c266222eaa0857631613dadcef889","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-isolated-testing-crowdloan.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-isolated-testing-crowdloan.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-isolated-testing-crowdloan.2_1712909598995_0.8826925633427567","host":"s3://npm-registry-packages"}},"2.2.1-feature-isolated-testing-crowdloan.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-isolated-testing-crowdloan.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-isolated-testing-crowdloan.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"50abbd5ead2d082bcc3a88196a35dd98f84da64e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-isolated-testing-crowdloan.3.tgz","fileCount":4,"integrity":"sha512-gETAYaJxxgi8z9htXncQdfsMNaJuLZAuiuOsYH16pNWVaZ1VRtT8A/RqWt/oKc4ihoZDC6Z7816eVgo8Rt6uZA==","signatures":[{"sig":"MEQCIDK2oVMtox4udj+2tYySNukLPXc/JOMZQkF6qScfXE9SAiBJPib7tutwSvoVsqNfzPAcLffbSn29UkJ/TsnuT2e2VA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508530},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6c1e296eab15ea55352a49d3519a067d3602f9fc","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-isolated-testing-crowdloan.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-isolated-testing-crowdloan.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-isolated-testing-crowdloan.3_1712910260549_0.0031909601229309636","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.6":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.6","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"89a83cd2259e54fc0bfe77b0a75d8b570add6ce3","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.6.tgz","fileCount":4,"integrity":"sha512-+5VczkRwrgYJ5yaIXrvOQaz4QQU9WAoPs1atLqDJRap4kGna784Rk1LOglAWA6N3KM5B5Yik88r4z1uHvw3EBQ==","signatures":[{"sig":"MEYCIQC97xEFmAz5gUSuEEYFnjxdmLijwlrM+T5sb52/ftQmrwIhAOOk1iU+Jdj+xdOqrOESxvg0BP/Z49NcHsZJU6TdSJcq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"f16abd89f9973a96a51b352bd91a44fc36ab7ca5","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.6"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.6_1712919080135_0.8534556188378233","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.7":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.7","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.7","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"5e8e04ede3cac44d96734ba5c6d662bfc3880299","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.7.tgz","fileCount":4,"integrity":"sha512-/tefmo8W4+GKAkCBZR6AzT4VH0AfKfVOqmeWm95wx84rn+2ostZM7mAtu6IIwp+f3Tij+37qfl4bkRmV7kJrTw==","signatures":[{"sig":"MEYCIQCm6wyNFjDJzdH8Jyd6jLPqrUJd2flC8CM4MQYfD349gAIhALRvuUxLUIAcGOh7CY7Ash+HND09/bHYLF10yrmv2I6V","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"96430b86754439f314938b51d9d645106b286092","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.7"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.7"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.7_1712922518009_0.5285533089421608","host":"s3://npm-registry-packages"}},"2.2.1-feature-isolated-testing-crowdloan.4":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-isolated-testing-crowdloan.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-isolated-testing-crowdloan.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"6fe40d2bfe784f710a4debe26c9ab1327ed93efc","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-isolated-testing-crowdloan.4.tgz","fileCount":4,"integrity":"sha512-s5n0s4UbkW4FlKk3FDroQGVBsNgNDEVJ8YLcZNM/6DiqQQc6AVdmb1Sqip1exEsvvNnHpgHEqN4ngRRC1QuktQ==","signatures":[{"sig":"MEUCIHyACw73X8VKXf0k500xOGE1U8mTeyH8Tl4cIo8HRA39AiEA3JgX9jBDihDRqJeTDUOs+cBwfsJRHEzXnlaUQ4dC9D0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508530},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"7c9b3f30499cace919349460fab910999d3a1c74","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-isolated-testing-crowdloan.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-isolated-testing-crowdloan.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-isolated-testing-crowdloan.4_1712923329160_0.49477503594170735","host":"s3://npm-registry-packages"}},"2.2.1-feature-fix-typo.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-fix-typo.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-fix-typo.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c655a45047c8b164bfc13ab0890693e24bb0109b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-fix-typo.0.tgz","fileCount":4,"integrity":"sha512-t8Iik0O8DfUEGk8yCFYHExG/NYwFq52xVeMnT83EE7UZkUtQJHHlt59TymfN5HOehYXRrULolgImrR8vFhLvyA==","signatures":[{"sig":"MEQCIDEf0onSbXLxxmpEeMTQeGXeh2iOTwPdYHD9rT1Vj7YOAiBiPc4QsXjO8wMmodikXSpjxyQd169fTG9nbeO8+UeL3A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508476},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"49e6f074047572f2bc0eb43728441a047d5c552d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-fix-typo.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-fix-typo.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-fix-typo.0_1713169162962_0.501211880918901","host":"s3://npm-registry-packages"}},"2.2.1-feature-run-ci.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-run-ci.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-run-ci.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d4d9b484b163f075c06d7a623a521bf106cffc54","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-run-ci.0.tgz","fileCount":4,"integrity":"sha512-RGeX/UwH0apmsSkdyWpBYI8vM37KYgLUJhobKcw88ShOmVlwBsAiNN1rnTi2OVJu1GjTJD+WryKeM5HGf5lylQ==","signatures":[{"sig":"MEQCIGkUzogmTBpOs84kv80gVxX5MieFLRMau9XBrz4nfHPdAiAqq3vaZrfX+9AoShx4YmMoAvY22smx4mHqIIaqJlqnLA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508470},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c84410210f2eb644133ab4709a68e4d3e78dbe97","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-run-ci.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-run-ci.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-run-ci.0_1713172670496_0.4771599449603354","host":"s3://npm-registry-packages"}},"2.2.1-feature-fix-fail-liqId-maintenance.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-fix-fail-liqId-maintenance.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-fix-fail-liqId-maintenance.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"65203832b4f05b43fcfbf1223576e9ca46a3b442","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-fix-fail-liqId-maintenance.0.tgz","fileCount":4,"integrity":"sha512-C6ZE6+s3unaraXKlAg8ko/1oiMj6U/cxFgfLjD438wAYlSgm6qItZfQGCrcJumpE9tz9U569qaC7ahgQYrjtyA==","signatures":[{"sig":"MEYCIQD/C5dpF+0ZsfHJ/wKdDG3zpJgr9km4bKoj2/MOdEhzSgIhAK9yhhnGbBe/966IER2IPAnCipGD6KRtdUZdGJRL8ymJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508530},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"ad824f92fb161d9bc96dfb57e221d949455916e9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-fix-fail-liqId-maintenance.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-fix-fail-liqId-maintenance.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-fix-fail-liqId-maintenance.0_1713175399037_0.6043164950811057","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.27":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.27","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.27","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"72fa9f4d2fba7e90b34e953110a50683d6b344a5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.27.tgz","fileCount":4,"integrity":"sha512-JS1BP+OryPgxvdEyuSmVigygo+E4HslIogEAUENGuB5etkd+iA6E2rSDKbtAi4Os5zRUw+3k0IP8aWwsVo9Lrw==","signatures":[{"sig":"MEYCIQCCA4BakIOdeVg0HqOm8nnkCO3dXP4PXX0MWOV91KjxPwIhAIXZV0sVolgyWxKliBRfi83PEk/r7BJn2PTzn4aPAJmw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"696f3ca80790d57d31fcc9afff4a6c72799ea899","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.28"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.34"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.27_1713252548533_0.7767388311201366","host":"s3://npm-registry-packages"}},"2.2.1-feature-fix-typo.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-fix-typo.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-fix-typo.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"3008f625754d82cf3a559cd3fa0a879dd202ace8","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-fix-typo.1.tgz","fileCount":4,"integrity":"sha512-UHKTITAs1PkgeTNNE+0ZsGCTwgUXsTFUjynUv7h8ldqsDl78VyQX2AGCICztN9q0HoAuIbBsxFznxfhOeQw1bw==","signatures":[{"sig":"MEUCIQDmRNqRRAlp2AbseiRXFoF0v3op5uwHVO1ha+REJq74MAIgfz0zPnJJlUjgvo2QT4X5+IJrMftMKHHeHq6/PQAnMrY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508476},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"117282708f39b1a64b42fcf8864f0d86dca7b935","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-fix-typo.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-fix-typo.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-fix-typo.1_1713268666229_0.16072913679231005","host":"s3://npm-registry-packages"}},"2.2.1-feature-fix-typo.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-fix-typo.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-fix-typo.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"59d47de55d207dae23c0548290e77dac8254a68b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-fix-typo.2.tgz","fileCount":4,"integrity":"sha512-TPmI2AvK/7/eY2kJqIdI9Crl4tjIve1bijIPFZjELgugV7rISXdlV4H5RKqLJEzw/uBGWFP28nRQSLa+RwtGTQ==","signatures":[{"sig":"MEUCIQCwvc1SZuwgLyGydyulw/UEVtVKKPGiBhCYdX3mNBB53wIgGFuKMl7vf31myamyNl9CNeRZht4koIjY36J7coy/yjk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508476},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"75363059c48c39595af1b8b580ea0b00153925e2","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-fix-typo.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-fix-typo.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-fix-typo.2_1713341320202_0.5340585328749732","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.28":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.28","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.28","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c8ae8eec09391d279520d4b06fd5eb457b012d66","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.28.tgz","fileCount":4,"integrity":"sha512-Cne7qNi5pGz4Liwt2QDhPrOA80rlnuZMihGkLzAfkEazNo1OutRqscT/21mQouclrW7PfhVTYWGDIEDyVcN7CQ==","signatures":[{"sig":"MEUCIE62U87uOxFyZkvac7FPWGFBPMFmhCC+xMjMTgGvON1FAiEAjEhPQRmQe4StzrBCNMxQl3iCPjWHU+yNL+Gea9OXoLc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c53b66e3cd43c4dcca08fc8bdb16b2644895beb8","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.1","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.29"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.35"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.28_1713347610747_0.7972129871453506","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.29":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.29","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.29","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"6194f5a81a75e1b71f77b675e249086bcdbfdfe5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.29.tgz","fileCount":4,"integrity":"sha512-no1R9TL2zMB998SViRZosRYCF3lOiWq88BpgiPYad99VtdA+MfiR3Fob8a43tWnDBOgcBCuTHgtz3j8WLCZxGA==","signatures":[{"sig":"MEUCIFcsCfU8ytLZoDGW/vRyyJUhL8n0vzvJ0otJ4Ve6nBvrAiEAq8zHboXJwoFWxntCdJvQnmcKempAxcHLztSsFfWNZ10=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"f20779862021e7525f1cd27ac119c6fe2cdd0a0f","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.30"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.36"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.29_1713353247940_0.057682861749767333","host":"s3://npm-registry-packages"}},"2.2.1-feature-seq-staking-unit-tests.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-seq-staking-unit-tests.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-seq-staking-unit-tests.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"448f93a569bef6bd196778922c8ca0cdc095a34a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-seq-staking-unit-tests.0.tgz","fileCount":4,"integrity":"sha512-BlR0Fq2P8e+TKyFYzQ0wCkdvBfOkYqqTzFyU1FI+wIKauCu50DMTV2hqz2ePbIBRrLDDiMCDPGtBLVU/VtaOHg==","signatures":[{"sig":"MEYCIQD57VVmMGnEW/65kfPjms2FeRLw1Xdd8DFGHe4KkUyHdgIhAKbQAIplw+eFEsZNe00sE9oYl4H6fBFBQfGHAEbqs5dV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508638},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"da61cc264c6f644177401b4ca49d26a8d530c5f6","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-seq-staking-unit-tests.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-seq-staking-unit-tests.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-seq-staking-unit-tests.0_1713386080667_0.8969142152389977","host":"s3://npm-registry-packages"}},"2.2.1-fix-remove-eth-from-genesis.0":{"name":"@mangata-finance/sdk","version":"2.2.1-fix-remove-eth-from-genesis.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-fix-remove-eth-from-genesis.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e7d1f298b6080d8de4d579bd07440b055d6a7374","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-fix-remove-eth-from-genesis.0.tgz","fileCount":4,"integrity":"sha512-gheQKzW48nlHPZp+r5pMHgJPG49rg01ONgIKPh5SfusrmGABgqXYAWVdTIFCnx5JMmxovVBzdbh9bKOXdpzfCw==","signatures":[{"sig":"MEUCIQDvba0cyfvwq0/rMSRnSxnrnDWLuCkxS2gHuXXcEXuWTwIgFglTnA4DHgEe8cCi24oiFizE++3SoLsNzwUeyADaBbI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508629},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"591c5dee6e01199fb08aea38ce41df1d908cbe50","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-fix-remove-eth-from-genesis.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-fix-remove-eth-from-genesis.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-fix-remove-eth-from-genesis.0_1713386916810_0.3431518891678049","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.30":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.30","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.30","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e9a89e7e73ad5b776a17bfa528d1dad24dfaa859","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.30.tgz","fileCount":4,"integrity":"sha512-t4ugsLQ+8wSl0e7/mc1sLFyRrWG4A9y8uWSULS5ygmnqY6O/f8XGy3w9o8ehM6jGj6R8SlRfJgFR0bkXLV+LQA==","signatures":[{"sig":"MEUCIGFVZCbVXFRUSWTCuz0o0Ys4dDdolQiykH/kk5kTlCg7AiEAozKXFNx1qV6CqJ0dDNSZNpdrCKc71Q6kFc9zlYHV9t8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"0a66dfbb9fc23f692db467e327bb3d4ca901a0c3","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.31"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.37"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.30_1713809748510_0.5929431558113709","host":"s3://npm-registry-packages"}},"2.2.1-feature-rolldown-mm.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rolldown-mm.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rolldown-mm.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"cf48bbf6de31bc1faafe620408085494d26da6a5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rolldown-mm.0.tgz","fileCount":4,"integrity":"sha512-v6bVghcFhnPd7fF/xnBMbZzFmECRSpdg6eyVcjqeQGGew37Xt7ZnDJc03BhMKSYGOpY+T2xCWU8SAPNxBpNDLA==","signatures":[{"sig":"MEQCID5BmhtAUkR7v7d6+pKHy20ICFPhHJVQt3KFiU3XFlIsAiAu9lzwa1EqeG/y0MmWPx988E3Qm0x6yHncZbP1A+AW5Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b193e7ef1601624b589e4e22a016c5f4ec8bd44e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-rolldown-mm.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rolldown-mm.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rolldown-mm.0_1713870078551_0.6299485887418699","host":"s3://npm-registry-packages"}},"2.2.1-feature-debug-print-call-for-context.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-debug-print-call-for-context.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-debug-print-call-for-context.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"44f7518f39bbd92c399791642bcd2eb3b2d1754d","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-debug-print-call-for-context.0.tgz","fileCount":4,"integrity":"sha512-zJZJTGbIoIfCka7avOVaLmQBEzjXFLTaiNZpKriZHp3LATfFtAj+EApitVAA8engEQAs86hLraP5zDL8dVLSHA==","signatures":[{"sig":"MEQCIGKMxNgWgdIInjv9i3fgJQMkPmnb+cs1e2OIVYdcul3FAiA3Ur3T3q7saZu4XHXgWAV5mMe6G/IlT9BQCXHBGbBfgQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508656},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2e244efc752de10904baf1fda2db2708116314c5","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-debug-print-call-for-context.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-debug-print-call-for-context.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-debug-print-call-for-context.0_1714109746402_0.3794988125132024","host":"s3://npm-registry-packages"}},"2.2.1-feature-rolldown-counters.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rolldown-counters.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rolldown-counters.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0fe4f6444a258d41fa9a8951c868b7624de64aae","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rolldown-counters.0.tgz","fileCount":4,"integrity":"sha512-qwvPwDjcZSOe5A/JHZhPtfGHOSefAPaYqJxEXKA71GrXwsfUDU8tNFnIXGjyDae7ogCOw81pjTD6RtRnRgoVFw==","signatures":[{"sig":"MEUCIGfOFqGKWtnEy/ZjOcZa8OAvAHOTThskFL0v7kpEj9DWAiEAqLydAjwfz8TOf63uSKdcdKaWcpHe7VrnSoWf+nIIrGI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508623},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d10ab4524bf8841f592051dafa41f064d3a3f993","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-rolldown-counters.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rolldown-counters.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rolldown-counters.0_1714120972797_0.7994946504727902","host":"s3://npm-registry-packages"}},"2.2.1-feature-mtx-upd-seqgasless-bootstrap.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-mtx-upd-seqgasless-bootstrap.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-mtx-upd-seqgasless-bootstrap.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ebe633f7b67ed3f8cb76c7c5ab2ebf9dd3eb9733","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-mtx-upd-seqgasless-bootstrap.0.tgz","fileCount":4,"integrity":"sha512-ZOx0fO6N+ex8fI5p2L6ncSePjCSeSAKHDNttc7ceQZxRGLQ154dbG3r4575gUdVN9NluiZ1vpugy9yxyku068g==","signatures":[{"sig":"MEUCIQDeButFNn8038aL0yW+dV3jJ2OM3HOpI1+HNx0s5oWdXAIgC0cLQxfokDZ4vCjTxrXNqV+gbCEmgrhM3i1YpOmUIZ4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508656},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2bba9152fd85a9c84359daafd07aa69650492161","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-mtx-upd-seqgasless-bootstrap.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-mtx-upd-seqgasless-bootstrap.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-mtx-upd-seqgasless-bootstrap.0_1714122503707_0.9745835152359521","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.31":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.31","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.31","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"bdf7fa7e5023164410971953aa3a750e62b275ac","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.31.tgz","fileCount":4,"integrity":"sha512-5OALbILxcnEQr/OqbKUGrKvVMWPIW+6h+/7LzplajbpePHyvdranleJrU2DD0aCQ4QuFST6+hxoX8FrL2AF51A==","signatures":[{"sig":"MEUCIC5kw3TN1hEs8qm4n9F4+PehCIkHq2qoFxqPXmzjPVQUAiEAzTt2BvrUWcoMJjuF1zDXZlZb8kLErRUWULIyJYyItUA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"906988f25aafe4b363103c068cc081044487e0c1","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.32"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.38"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.31_1714125103939_0.4456652647801571","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.32":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.32","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.32","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"24b1725cf92ff4345c924a035c4096a4d521262a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.32.tgz","fileCount":4,"integrity":"sha512-7m1qVwaF4uFfjt5XzXwRq74Z+GC+5XIC0K2PuDvCxT7mbqF+yITRtu4gCwJHoQ+wqBXXSTqu0BaTxIryFoQ6Zw==","signatures":[{"sig":"MEUCICHQKsyGGoVlC5iM4ymXCT4+aFwylcS1Yip1oP0V+TU1AiEAwA2M3h+e+k7oPjn74AuZa6gpPlrstUYDZe4wYmLwkQ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"73d6439f0db90b25167fad4518146d8218f77c91","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.33"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.39"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.32_1714135083483_0.7223849979041725","host":"s3://npm-registry-packages"}},"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-ethereum-as-relaychain-for-crowdloans.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"86ad58b825028ae3f8d2185a4341cf57322f1fe7","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-ethereum-as-relaychain-for-crowdloans.0.tgz","fileCount":4,"integrity":"sha512-0VZ3Q4Z/J2eRjV6pWaUUIh6vjQDJMpLaRR54NwCe2tDgCQBx40Kj1jZgK8y0VsOtPAJPq1Z844jP05qoJgi5EA==","signatures":[{"sig":"MEQCIDCDiF+K0ivd3thZn4K6ZZursc1vv/x71VRxbSVj5u4jAiA2rzT9+nydNoWMJjGMNXDt8xKwbFtyyOalFG1igeezWg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508683},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d1e6a073aa1a2a6e4883a99005d62fac3c98d255","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-ethereum-as-relaychain-for-crowdloans.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-ethereum-as-relaychain-for-crowdloans.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-ethereum-as-relaychain-for-crowdloans.0_1714156697116_0.48948030625275707","host":"s3://npm-registry-packages"}},"2.2.1-feature-remove-dummy-tokens.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-remove-dummy-tokens.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-remove-dummy-tokens.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"3a863fd32107063dedfba94e24155e589e3f1a37","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-remove-dummy-tokens.0.tgz","fileCount":4,"integrity":"sha512-1rD+hCrex9cDNL5Mn+W5wh/Z5Bbj09eljll5UqUwT5NegP1SK0jU1DLf6J3xO7W5y72ICMeKEPussTD3KnS6VA==","signatures":[{"sig":"MEUCIB5U+LCeKwdW87wWiGdFoTzZ7Si35+RYixsRszikWgE9AiEA7e7Z+WNKQPEXleXiluYesUQqBINPx9Hp096U510NMcE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508629},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"cf22037b8b569c14c2d5963b0c8b1c85ac7e282c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-remove-dummy-tokens.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-remove-dummy-tokens.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-remove-dummy-tokens.0_1714315385178_0.8651536042472696","host":"s3://npm-registry-packages"}},"2.2.1-feature-configurable-chain-id.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-configurable-chain-id.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-configurable-chain-id.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ac07ed12ac5e785396b4fb2da25e42911d66dce9","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-configurable-chain-id.0.tgz","fileCount":4,"integrity":"sha512-Fc+UUnp3LWcRnBh5iC4ehp8XNRfk/pXfeOokfW42W+1ch1z+c7lCU14hKYJyaDGhicOrMNCGDMugLDnMno39xA==","signatures":[{"sig":"MEQCIEDFvQw6dBs1siT0EjoOGpXxrYMlnoOiThMvRiurIhpHAiBfTzyDprlwc17tCK/QcVv2zI1TIlweWMQLV4RV2MXRtQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508635},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"64be139456b5f03cbd03a855c9a445cf225cd92b","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-configurable-chain-id.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-configurable-chain-id.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-configurable-chain-id.0_1714375472000_0.09491764636190192","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.33":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.33","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.33","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"0436271fa27953765a62b421a053394b724cef0f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.33.tgz","fileCount":4,"integrity":"sha512-qn1X5cLuNbF4C+d5ESfnA2grBifFnlAKqWGEE2BqG4ebL93CsqSKNuhVuMdD3UUBFITLNZAhpWqKA0tshF3XkQ==","signatures":[{"sig":"MEYCIQC3WDlWvY/TXNAf9vctZH17Q3s24fC3Uc+soW/p/EYmiQIhAIDsqVjPpK8GZjCisPoovYB2+y13twjNLS6N0xxCFg5q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d4ecb2be8c5a30c5e4e0e88289ea384d36b6b527","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.34"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.40"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.33_1714375767035_0.316227018490413","host":"s3://npm-registry-packages"}},"2.2.1-feature-rolldown-mm.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rolldown-mm.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rolldown-mm.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"66f771bcb398080996a03636e2ac5b3e5f9ec0af","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rolldown-mm.1.tgz","fileCount":4,"integrity":"sha512-NnsXaPSzYxriCgRS3MS33A7qOq5rEnytHe2o/Gq8yDPLBxFaeQlPnDDJsUFFgaSK17D2zR/114/lVVCx41JQYQ==","signatures":[{"sig":"MEUCIBnedl9HQsSnKVJYEn8f3o4TxuGsuSHmrB34JRdf3F0iAiEA/bXvTEAr4Uq73nsFEt3fNX8Ss4wztk2kyAStcLhtSQE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"20b9e2a1fa4fe656ca06a826fb1f519c8ced90b4","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-rolldown-mm.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rolldown-mm.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rolldown-mm.1_1714376656452_0.6378723564489654","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.8":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.8","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.8","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b6a7f97df2b8187b0be598a648235d872b8af983","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.8.tgz","fileCount":4,"integrity":"sha512-fvJPtXcBsUg9tiIzGwSNWdKwbs/N7jOUYtRbblR1aEgopEePbMLjEoTktT7z9Lx0i4gYPO0G8JIJk7atvew/Lg==","signatures":[{"sig":"MEUCID/SxFBtxZTCXpFHqOnJu0CIYhaxJmMUwB5z5z24EUr4AiEA583SGrMG+bVl4xubKrqLkWIw+iRycgcOStpjXukiAa0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"528717a1b5b75ae741f43c5b3c97e1b17dbd913a","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.8"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.8"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.8_1714376886466_0.6348558383209839","host":"s3://npm-registry-packages"}},"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-ethereum-as-relaychain-for-crowdloans.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ddb9522b9ac91765b085cf7d77c761a6c6975caf","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-ethereum-as-relaychain-for-crowdloans.1.tgz","fileCount":4,"integrity":"sha512-ORcTGwiy43A4srimgZDUClnmbi/iUdUMENwqATwUMAPWcDAQi5/QoAoP8Kk9TJ2ExjEZSg7VlXqMc1NcKUxXjw==","signatures":[{"sig":"MEUCIQCOZUYaE1WEGeq40BAK1bh4GuOGcpcbOCU4DpzC7LKvxQIgG8iqKpOsRTT4l9nkYg41XhLxUK+clawkRWlV/x7WwW8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508683},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5c40315a93ca7cfd92aaeea5cf559ac9f6ac4b26","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-ethereum-as-relaychain-for-crowdloans.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-ethereum-as-relaychain-for-crowdloans.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-ethereum-as-relaychain-for-crowdloans.1_1714377444331_0.46805973911609944","host":"s3://npm-registry-packages"}},"2.2.1-feature-configurable-chain-id.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-configurable-chain-id.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-configurable-chain-id.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"73e32acbce3fee364c90421bfe9fa17fc8214b82","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-configurable-chain-id.1.tgz","fileCount":4,"integrity":"sha512-t4WBC1hlcIi8zF9ftcYtn6rny9vgmJFkODY3HO8jx4HvnHc8SLDB3aplWtXYJ2uSI3sP4jT7x4gt3EHsMVl1qg==","signatures":[{"sig":"MEQCIAeaAMGFJIhvUcSheOsyplH6qvmm7LLa+opAYiwBru4SAiApMcgkgfjDvEB8am9bOdix+a8Y+JRW82I+OpZI32kgcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508635},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"8d0c2c82adb59de013437d163ce273c312d1c27c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-configurable-chain-id.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-configurable-chain-id.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-configurable-chain-id.1_1714379191707_0.9684258215618757","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.34":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.34","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.34","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"ab9ef0c0ca8ed190ace12289183e0391844c0592","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.34.tgz","fileCount":4,"integrity":"sha512-G5iXL2gT7bbU0JP1vmfsLeAn7gjpLF+cwr3ZQdfwNS3WDijHmvOiy5+sF1VHPpv1/orXaIRNPrhC4IPJ4+N4CA==","signatures":[{"sig":"MEQCICHBMToZDH2KclTmS2fhzAZ0I9KoimInncYJC2YM1efnAiBfkprtYC9ONelo4LaZ80HVu2vvJxJvANBzGe7gfnndLg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"50d0347e6ad55a6376c1b6b63ea85f7775dd4b5e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.35"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.41"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.34_1714380024166_0.6577016869874039","host":"s3://npm-registry-packages"}},"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-ethereum-as-relaychain-for-crowdloans.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"6e8de655abef3a0e5847c43177162f236be74a56","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-ethereum-as-relaychain-for-crowdloans.2.tgz","fileCount":4,"integrity":"sha512-B9WkIgyT2Mv5uGgD9qcTS/wAn5abTjx30uwWW6fCR1VxaN8y8CQj/hor9+lRWJfbIu34eu05v0m5B4K8MO3VQA==","signatures":[{"sig":"MEUCIQDZYaC4HT3vx7twpDKwlseLgiVcOEi0xc8hUte0E1CZgQIgUUU8u6YOr9k6H6UNSauvvpoIqRtQkCjxrDmJ3uGoERE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508683},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d477e407683fd2ca41fcdf89f813baa16a616fe5","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-ethereum-as-relaychain-for-crowdloans.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-ethereum-as-relaychain-for-crowdloans.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-ethereum-as-relaychain-for-crowdloans.2_1714381207047_0.8373118546092166","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.9":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.9","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.9","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"2b0a670978c3e128a262bb9b7cb02acffd5be200","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.9.tgz","fileCount":4,"integrity":"sha512-ItPlb34Tm9hRj5KCDjw4ijfK2Xptwbn/I6K1cEGqbyBJG44WK4cRrd28P/lckopDgEFBKS/Xwnypu8gJx1R99g==","signatures":[{"sig":"MEUCIQC12jagnSwg7fiSD/gj+iDbY7TE69ZBLjN3s+LREcf5qQIgNqFY90fZ0aQwyysjl+ZGMA/RjHfSFh4tGXE0NFhzzvE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508508},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9b16eae008c3d9efe39542063b084e85e9e12bc3","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.9"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.9"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.9_1714386734682_0.005919250917664209","host":"s3://npm-registry-packages"}},"2.2.1-feature-configurable-chain-id.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-configurable-chain-id.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-configurable-chain-id.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1acca5c6b3fb39da7c00362b57eb19c5fed3d833","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-configurable-chain-id.2.tgz","fileCount":4,"integrity":"sha512-m+ahnu+jamsJpeEOU1xBr3jSiFTXpa3zJv2YkUc4V8iBRVvgM/y3KqAZ7QWOWNGaGAY8vbsQ6dEiOnG7KlTj+g==","signatures":[{"sig":"MEUCIQCHa//2Qr9JEyyrzgoMya8YTHq1/+EvR2yvj0+T8aAR0gIgZfu1iS4fMvR+lwl/13qIkGJMn71R1zduduGAZMvrrhI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508635},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"1ae1e0eeef873aef173eb23e54a947cd9e00c21c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-configurable-chain-id.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-configurable-chain-id.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-configurable-chain-id.2_1714389737715_0.9947060225180382","host":"s3://npm-registry-packages"}},"2.2.1-feature-rolldown-counters.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rolldown-counters.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rolldown-counters.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1bcf93cb1630bfa05e2396319a62402315c470bb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rolldown-counters.1.tgz","fileCount":4,"integrity":"sha512-kZHHK0968T48xtriyLiPvF4hHWCcRKGlag8IYi7O/TwbigqHs8MeIkXYT/qVTtOGNPHQcycZczxHfjgaSVfjQQ==","signatures":[{"sig":"MEYCIQDGWTFLxld3xqknle3GOFcCqeIke1tlRXNH64X3rFMEswIhAM0EURImpXw3tBWcSBHPqMeBaPUnpW/5nWbz4V78Un0U","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508623},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"1eb27495c207c3992b4c5a3f868d176906723653","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-rolldown-counters.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rolldown-counters.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rolldown-counters.1_1714390566607_0.9363330362428941","host":"s3://npm-registry-packages"}},"2.2.1-feature-remove-dummy-tokens.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-remove-dummy-tokens.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-remove-dummy-tokens.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e4881720362c1d5421c76e485e22b57908e9e9ff","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-remove-dummy-tokens.1.tgz","fileCount":4,"integrity":"sha512-KuqE8hMaZqU1/OUZgasywGixEpHJSW5YKlyCAKABf4DsDXdF1B9lk6hUOL7In/R7/KNWj355YdiZpzawV6dA6g==","signatures":[{"sig":"MEYCIQDByuosKZ/YiGASzhhJswtng6Wy0UAlBc8vxMexH76BRQIhAJ43y46DMvqC0q/Cu1tuYU5dHzRryU1wq3H+3dyTZZGU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508629},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"f8bb67556d6a71c665ee10b83483ae1e28d20092","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-remove-dummy-tokens.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-remove-dummy-tokens.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-remove-dummy-tokens.1_1714390754992_0.31866923748778997","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.35":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.35","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.35","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b88e56235054263770f50030ff4a3dc5389bc949","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.35.tgz","fileCount":4,"integrity":"sha512-Q1eQU5PDc8OZwZjjT06hYi3+8b697OoFiOegyS5NDk2Bg79D/kaot4fPnk/txMAob/h6/nFA1CQIx3YxF146cg==","signatures":[{"sig":"MEYCIQDIxJtIRP6vlrdKHV1AhrYgbqkFXjWh8zJLyye7SBd8QQIhAKQMO7XA7dLvsGLRm0Kjy/9NHyb89ctgZUbvxn4P7iYl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9941d4b7b538e57b160d7c8a0eaec5ad11452162","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.36"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.42"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.35_1714392710097_0.041059332537874305","host":"s3://npm-registry-packages"}},"2.2.1-feature-configurable-chain-id.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-configurable-chain-id.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-configurable-chain-id.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"021d2eab0e687703119b6285aa575c465d35e62c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-configurable-chain-id.3.tgz","fileCount":4,"integrity":"sha512-6osOT1xfZwosbPWoKohnQn+EEAERUh2HSKkGZdTGtOAGS3di/LQDJN1tD8eZfq90hrgQru4PMhrg15Ja3P2vjQ==","signatures":[{"sig":"MEQCIFg7Cf3Rnl5x3TDI8oz0Zw5AgryskvujpFVQpeuorEKHAiBicHSp0jrgIceQGeABOrulH6MHo70FcQIUF7bU0eGnXQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508635},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6a0a924e965ddea911cb76ee4307cfdea367e34e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-configurable-chain-id.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-configurable-chain-id.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-configurable-chain-id.3_1714393354951_0.021176128909513814","host":"s3://npm-registry-packages"}},"2.2.1-feature-remove-dummy-tokens.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-remove-dummy-tokens.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-remove-dummy-tokens.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1bcd2aec48c437abd2106bd649d29f1d4417ca41","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-remove-dummy-tokens.2.tgz","fileCount":4,"integrity":"sha512-+XX/wnwwZC0R3bKKooSXhOJ9RNhZbXHNxwM75hsOWkAJAd+7Wp4sXi8WP/7BefPmMMWl40ar2iPTITGuIc7HCw==","signatures":[{"sig":"MEQCHxA7I0vx0YIZJYhBlGbaGHn9YUFQfYkG8+Iaq4AMz8oCIQDblWg3qV933II9Gfhe+eJERaXrNDJz1ZH0wW2nxeNE6w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508629},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"11e1c0ee39692f38697c08b789ad4288c6ce1b62","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-remove-dummy-tokens.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-remove-dummy-tokens.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-remove-dummy-tokens.2_1714393869850_0.9521319353164477","host":"s3://npm-registry-packages"}},"2.2.1-feat-chainspec-eigen.10":{"name":"@mangata-finance/sdk","version":"2.2.1-feat-chainspec-eigen.10","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feat-chainspec-eigen.10","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"025adaec50ef72f273a9953a610d186d86e4362b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feat-chainspec-eigen.10.tgz","fileCount":4,"integrity":"sha512-B1g36DZu8yyYl/YGrvCvA3yqyPENNPid/wAL+zf6v04tSpKMx3eM1ZXaNUBapqtloJ23KHYEpT+GWufixAnr2w==","signatures":[{"sig":"MEYCIQCv9+ATIkJ7Q9k8iYi1O3jOBPhDcuL43/j+vKvI7S8DBAIhAKIjMU+FjaDodJYN4N45773lVKQ+r7efFXvfk5z8jmZx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508510},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"0eea606406c207bdb6a4b86a233ec8d3c558a8b9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feat-chainspec-eigen.10"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feat-chainspec-eigen.9"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feat-chainspec-eigen.10_1714394797195_0.09372345665779913","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.36":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.36","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.36","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e8de98b4c0281de62d52a72654ea6a1af880f7a0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.36.tgz","fileCount":4,"integrity":"sha512-UIDwPkDMpAzuBvdsbdakd8t+tFID5HzasjtZ5+kHLntP5V8drfSw9WjWkm6m4vo++yb4m0rJyGiygpOJ3q0LyA==","signatures":[{"sig":"MEQCICYw4PmzWsg43xU9Ojrx1A6TmsAIrnGyqoSA4+B9ZCXGAiAF4mG1Yv6Ig4BYhKNgAs+f3NZ34QsOUhylxmm9LWKH5w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"cccc81e02dc477825eaa5f39133c51b8049b532d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.37"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.42"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.36_1714395949552_0.6979916781869964","host":"s3://npm-registry-packages"}},"2.2.1-feature-configurable-chain-id.4":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-configurable-chain-id.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-configurable-chain-id.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"02ab73c55cad124d8807270039512bd7ea8c548c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-configurable-chain-id.4.tgz","fileCount":4,"integrity":"sha512-lOK2sdvxnLx/1Vx7Xfd5Uiwgj+eHkWJxjNPnGq4FQUmF5uRkBI8h60bKbM9Nq661wIaPqrWWIUAXa0NEb2XfJg==","signatures":[{"sig":"MEUCIDSWaDzrILnSH8O7jmIm+adqdSm7SSwU8hJwsT0a4sKKAiEAskjhjQZT7RLrljgEDGdaipoq3vQvxv9BpTEaGUUmkgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508635},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6366e412d92c7b0a486e2682c3e41db092a28418","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-configurable-chain-id.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-configurable-chain-id.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-configurable-chain-id.4_1714397417018_0.8491956878339357","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.37":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.37","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.37","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"712d6c9460e4aa564d3f745a9d1b0d04c370ff2c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.37.tgz","fileCount":4,"integrity":"sha512-EDFXsKc2AoDOV31VNlRFLXNz09rzcv3TZZK2Cguye/gyrtTLUyccsYslgNi8Q023kxXTTIiEBzyROnitdM8FIw==","signatures":[{"sig":"MEYCIQCSIpB/ryJZTuxx5aT9Rep1aNK25EWfCO+9kTA+SzVhAAIhAONVTBQuuZVWzEqNyDaRtB8/gKQ2fcPyQT3rEAqI1UbH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"1133e5f04a11626d0ed78ecf119a0b8d5f3127b6","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.38"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.44"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.37_1714399448529_0.6718638845003786","host":"s3://npm-registry-packages"}},"2.2.1-feature-rollup-testnet-alignment.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-rollup-testnet-alignment.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-rollup-testnet-alignment.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f60a4e5cd90e63eb59948f9ddb49f1bfb473070c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-rollup-testnet-alignment.0.tgz","fileCount":4,"integrity":"sha512-VFbIQN00ExRXTTMgQHzZ3XY7AbwzG0EK/UznYcWy5RYco8OhYBD8TWHUPlP7FHkFHUePgBCDyyh7KloMzbD7Fg==","signatures":[{"sig":"MEYCIQDwjBLmiG76aIC0z/OnpqxZFM+BreKCYxJ9IEnCW6JMDgIhAI1FB6JNGPcB5BUjvu8oYpCbhorHiyHHHK3SbfZm9wkM","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508644},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"f4dd230bfffa9df55fef04082fb94b3afdc4cf2e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-rollup-testnet-alignment.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-rollup-testnet-alignment.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-rollup-testnet-alignment.0_1714408366117_0.11706419446918037","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.38":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.38","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.38","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"fe8d898e9539e1e520e19f50b6b9bbe18527dacd","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.38.tgz","fileCount":4,"integrity":"sha512-CLkQN1f8IKjst6rBfL7enPWIEfFvQvLa8oJzkFK6no132+ggzC2m3+gRxM8XSNaaHCo74zFfT6+eWmI+WYR23A==","signatures":[{"sig":"MEUCIQCvaz6bsZy1yZ64UxtDsl3Mhr2qphESQtxeJrhXFDyjpAIgQxi7M/FZq6d+FL+YN0pHKyrfnTcK7B2OXklUPaNIr3g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"7574c7bf3fdae18f44df4aabce48d5ab3e843ef9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.39"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.45"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.38_1714410490359_0.21526116340251944","host":"s3://npm-registry-packages"}},"2.2.1-feature-custom-prometheus-metrics.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-custom-prometheus-metrics.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-custom-prometheus-metrics.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"140dae1632ffd89f30b60dee9b535f4609850a24","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-custom-prometheus-metrics.0.tgz","fileCount":4,"integrity":"sha512-7wZhZhMvDw7V2W9vvC6o+ggkiXiSWS2eZvAoRlaXiTdAHOeRqcoF1QnTtrc56w6vt/OPHGCCEhbZXu3xncbfig==","signatures":[{"sig":"MEQCIHRDSgXefkHCnRVu8f133F6jvhNot/pfj8zUQkOqvSsZAiBcr85Ilx+2IuMwUmPThatq6aRmKJoU64fpF9IR3QT3ug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508647},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9a9432445045b8d0c7d889a986a6b48564b35cd1","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-custom-prometheus-metrics.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-custom-prometheus-metrics.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-custom-prometheus-metrics.0_1714981467627_0.9398890550955787","host":"s3://npm-registry-packages"}},"2.2.1-feature-custom-prometheus-metrics.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-custom-prometheus-metrics.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-custom-prometheus-metrics.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"1cbae89ac288a088d1fe85e121aa37d29cd01f37","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-custom-prometheus-metrics.1.tgz","fileCount":4,"integrity":"sha512-qV4gFmL16rU+I6wbnodaIOI3NrAvocDnjBJRhOpW7dRftx+TYYMDkKQv9PhoFB1NO9mEgB86MlIsh6LLT3Bb5Q==","signatures":[{"sig":"MEUCIBaai+Wm84QBJ+3BxMDpMdqMR6qNmUPDISkSZJbxfM46AiEAigGOgj+t/f3ruxFZZw3bU0hBFQKQN1AWdt7ocLk67kA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508647},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"0db46ea500048ed687955ae8d39ea4969e1654bc","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-custom-prometheus-metrics.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-custom-prometheus-metrics.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-custom-prometheus-metrics.1_1714983117037_0.8661046392426783","host":"s3://npm-registry-packages"}},"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-ethereum-as-relaychain-for-crowdloans.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-ethereum-as-relaychain-for-crowdloans.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"229fdffac234884bdf239b62fa483100b1a98bdf","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-ethereum-as-relaychain-for-crowdloans.3.tgz","fileCount":4,"integrity":"sha512-VgvPmR4bcPV3/5brSXayG6Y1XAxkdNLRVZRJ7mBY7TNWSw85/uJJOlO+dqkaD7522VAjoxkM2GZmLc5PQlnTPA==","signatures":[{"sig":"MEQCIDx1FoMF2mgZ/E6GBzxb45OJFDAzmLNmXhUGBj19oNNQAiA5yF4YoZtMrDnOLqOWwfbUrfkrreiyYNNk97Xvrez/uA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508683},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"e20b04501bef9498a6ec3ebb55c65a9d244ca4f4","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-ethereum-as-relaychain-for-crowdloans.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-ethereum-as-relaychain-for-crowdloans.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-ethereum-as-relaychain-for-crowdloans.3_1715094919013_0.7740869205598193","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.39":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.39","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.39","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"abb161bf3b73c7f6221bb63dd5f7f64273b8b541","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.39.tgz","fileCount":4,"integrity":"sha512-1+l6cYyTJLwvJoIGYxEgJcTLZcVSzOZAiakqha/VvM1UqoiVVl6YDEOtHeGy7LwGLV8SaVzXu4TunbmNTXIWdg==","signatures":[{"sig":"MEYCIQCrUBh8b4LJDDZmn6chd8s47S6CUlCSsfn3elVjAys4ZgIhAN1oORquuQ+WXefFD8Hv2OoYtj85SUWjbGFlcfZnvnVG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2691f58f3fd4c66e2230830920cc722d553506f9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.40"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.46"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.39_1715094932451_0.7520857801642848","host":"s3://npm-registry-packages"}},"2.2.1-feature-remove-dummy-tokens.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-remove-dummy-tokens.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-remove-dummy-tokens.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d3b6f5bf0037d26ce9bbb632d3a60aeba680dc03","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-remove-dummy-tokens.3.tgz","fileCount":4,"integrity":"sha512-2CqIPUyED5rJJ4qCriqSRyNlGEAW84hNkIEE+CvR+34f01rSfHK4paZKsyBRz6GBmfo6LaTDIcEOXzgO6xIw8g==","signatures":[{"sig":"MEYCIQDyoYJJJvILoplAKx1hrVbR9nmDTthhCQAHNFWhmd68ewIhAPLst1oowZQ9KN8tHf9vr8Q1rJrGJbG8nvBuCvwicVDo","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508629},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c643a65190f0e74677434eb80b7c0d06ecdf729c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-remove-dummy-tokens.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-remove-dummy-tokens.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-remove-dummy-tokens.3_1715095014975_0.2004649805514629","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.40":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.40","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.40","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"383b41759d3c1be454a07e9cfa74fecfbc0aa25c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.40.tgz","fileCount":4,"integrity":"sha512-xL638uvCLqfTqQecK3ABuqWxPy66mLgEFTFlMAbz1SUTvsPrVX8hdE99XKavnNraWV4zTtHQwEuWJYJVzd9lqQ==","signatures":[{"sig":"MEUCIFYQRa9EiYTLHQCtiXBFIWdJGDNdwQWhlxZC3jDCYopCAiEA4uX76K7wNBfACgrj8Vcgt6JrGb/s3QK9J3DXFNqV7kY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2a7c45c3b88bcc120ec02c7eb8dc851b68269b11","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.41"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.47"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.40_1715101822821_0.5844951434341681","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.41":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.41","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.41","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e032457ae8f294e47432db3e4d6d27541dadac0f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.41.tgz","fileCount":4,"integrity":"sha512-KD3oGmAbc18ARv1cGIinTyHvQSvhHUXlWHbRbmA7tBIH21hUZtSR9wcznKYvxRre8UCMDUd+TWQxjfj/v3zTqQ==","signatures":[{"sig":"MEUCIQDFx4XlQUOATVqaCKCSicGy+bMHYDMvJvFVVTDa/nAJaQIgF2g/VfSny9Mvh/VeVVZSWsfSkY6VTvVARjHz8mfZFXo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":508605},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2a4304fafda96ca030f1edd01be2e3a90e4ae324","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.42"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.48"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.41_1715102156119_0.3423740254969174","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.42":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.42","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.42","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dcb6958e7187935fa515856a6b6d8fe3a8c0dfdb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.42.tgz","fileCount":4,"integrity":"sha512-R+EUUlaT4mEXLySs35WLBYIK2s9UQcYQ2hX4MW3g9j2gmv/vA4o5yEneLu48sNnk+C/xc0eDW8D3PeQ9eDzKzQ==","signatures":[{"sig":"MEUCIQCpi+cBjeYY14V4Q0XoT1+PsDQZSbf/5SOGWs4FpStE/QIgKffreJnQ44lWhKAGv2UnnYmiENYKEwbUk43N7ZNJW24=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"8b401584a50f5ba5b21e8388649c62b745e17d65","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.43"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.49"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.42_1715331646789_0.7201575093569141","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.43":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.43","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.43","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b742a3705950e7c06bea3066de02e0f1596ccce7","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.43.tgz","fileCount":4,"integrity":"sha512-1TlzTnyeORa9PO5EjTFUEeicVdf3kr5SjlTvc8vkFvkaF9vRGFqzAFVvxxUkr7bI3V1HXMbvhsyPuWjkd1okaw==","signatures":[{"sig":"MEUCIQDRZbAP2av3klYBt2qp/fWXNKvQ8tjYQxsHLhhPC0OawgIgUP0HFgcCVEwc3KpckW8gqxuDk2FAmYqA5DPxsWjLTsU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"bdc125de0750bc77660cfd9d455b922540385baf","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.44"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.50"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.43_1715594476040_0.041251864236763636","host":"s3://npm-registry-packages"}},"2.2.1-feature-mm-on-rollup.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-mm-on-rollup.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-mm-on-rollup.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"12dac2fb43710fbe0423d9aca246f87f16586693","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-mm-on-rollup.0.tgz","fileCount":4,"integrity":"sha512-c15WYUgQdH7OtUfSPobZDl5efIYh1pWD7FHBgJbVJ32Brx/Zyg6JswoYIhTmTjxs90Uv2riIPFXVp/NgSXfVVw==","signatures":[{"sig":"MEYCIQDC1xNfQRrEA5CT8YhXzHnPpVHit1lT6T0dQBSbj6AbZAIhALU2E6ICeu93ccYooC8smI/RuDbQKA+udqgYnube5a9w","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194081},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"cbf101e0c3a13f934c2d55f17427b263b8f71acf","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-mm-on-rollup.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-mm-on-rollup.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-mm-on-rollup.0_1715595811302_0.27061559203810437","host":"s3://npm-registry-packages"}},"2.2.1-ci-performance-test.0":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-performance-test.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-performance-test.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"566896f109be26a876a267300096635f8a625b95","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-performance-test.0.tgz","fileCount":4,"integrity":"sha512-JqkqP1PUdto/jPFySI+QecWtvqJHLCBnsE8qNV/42hEcgCcuQBoREUFPaHs3v9yKGKny7Q5Sbj2pY/H7e/2eUg==","signatures":[{"sig":"MEYCIQCBtkLGAYmYAGS9l3aiz58eTuIervEnk8cVinlD7k/L2AIhALOvExooltjw5VqwqfDdGUdCMUCPMMDAnlO0oWMwEmmf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"527629182eb25097dc031f45dea0d19580191faa","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-performance-test.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-performance-test.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-performance-test.0_1715864596869_0.05361304809457379","host":"s3://npm-registry-packages"}},"2.2.1-ci-performance-test.1":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-performance-test.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-performance-test.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c0aa248e028a19c8e1dac92bb8ad386e364d886c","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-performance-test.1.tgz","fileCount":4,"integrity":"sha512-ZpCXTMU3M1lGk8gHf2Bnf3GXuZD/rwNQZVn66VyW9gEeCxzX6UXHIFP5VpP6+cqD4X+EQ0hNfnT9gpzv2Lz4fA==","signatures":[{"sig":"MEUCIAkS3ZFTMqbt9q8RixPh6C4pqFEoZsfOAWOBABpEV7xsAiEAiqZVXU73oaGbxL7r3cGUA1db3w5+5awLIxIOo2lGG7E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"8f882a3f7e2c87c21b754ea3dee798f828c47d57","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-performance-test.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-performance-test.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-performance-test.1_1715868854283_0.9137423123330404","host":"s3://npm-registry-packages"}},"2.2.1-ci-performance-test.2":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-performance-test.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-performance-test.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"cdd270bef4832fc9278a47dab914ffb228e8f72a","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-performance-test.2.tgz","fileCount":4,"integrity":"sha512-XxRUICxDtR0SoduRVD/XUhkz1O6MxwTFCDGmKdWPBU2OXrIdKdyDE7aXmOFQr/OH54Udp6iIVFPMN/FPgGPIig==","signatures":[{"sig":"MEUCIQDEh/uuVduhIW7JaUyUIWVtPSVi6v/sqSYr9sSdO/y4lAIgGeVdeiwhNViXXu9/svHVDA9ygf+l5vYCbo+fi/H6MuM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c0684ba9edaa5054391a7f88581db604da15cceb","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-performance-test.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-performance-test.2"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-performance-test.2_1715876823153_0.18843130999272018","host":"s3://npm-registry-packages"}},"2.2.1-ci-performance-test.3":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-performance-test.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-performance-test.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c68a74b968c497ba3da3a2045a7c80658a013c27","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-performance-test.3.tgz","fileCount":4,"integrity":"sha512-vdfem8Hml2h8EqJlbYg/oDDMWBiG8RLiRoxe5sVgSizRgnXrlXpaAEbWxGz1wpi17jMtA15SKmEMSEs5jlYEog==","signatures":[{"sig":"MEQCIGXCG572i8VwjmXM8laJ3CEdWr6TAxqCAbg247e+Qor+AiAQA0d4UopA3wfhdx1AlURu4h8aIs4PeQCSDt2/JdNniA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"91b0522f3ae6ce43bc36eedfc216a51aa7c60807","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-performance-test.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-performance-test.3"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-performance-test.3_1715877736235_0.20360219310469496","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.44":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.44","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.44","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"a6fed339e4a8b15eede6f00d5aab774925d93bef","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.44.tgz","fileCount":4,"integrity":"sha512-2c8qogrqz63Q1+iDJ50YsQRGvF+jJJzEfRb1eDszUOd6FA/0gTaiJTTTGbVM4R9e8gyhpfJONqzXRJYHAQszeA==","signatures":[{"sig":"MEUCIGrHM0qWLcVUxfzr11M7PkE8vWWzi1/6yZcVFt3MVUONAiEAhWPL2JxG3qFrJFAbHLLExEhgQ36nw0/sMlboM40mC24=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"4d3007bdbbd1a83b9b931c15521c3a70f121724d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.45"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.51"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.44_1715943198492_0.7109506470213072","host":"s3://npm-registry-packages"}},"2.2.1-ci-performance-test.4":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-performance-test.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-performance-test.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"7012b410b15fbf3458656237faa3cee052963604","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-performance-test.4.tgz","fileCount":4,"integrity":"sha512-2H/TTDRh7Ng0/5s/nrDJip1NPsWy4qY2OOXPPkD0nYmw2Sf0OWLCQgUkircVHWSuJslx5wgtDrqkli5fhrwKqg==","signatures":[{"sig":"MEYCIQC7eZvNZfVQbF9uuXcaEMpem6pKDYy+Zok6HTOt5oLk0wIhAOQNm7aRYmnjXGfaNPyu5UmYpccNXgeA9H4FD7enC3yT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"be638fb8d5bb8aa4c9175e3ba6da2ad9597de1ad","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-performance-test.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-performance-test.4"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-performance-test.4_1715943423250_0.4668924052727317","host":"s3://npm-registry-packages"}},"2.2.1-ci-performance-test.5":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-performance-test.5","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-performance-test.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"bb13afb8bf1c152c11d19cd6b994abf77f2e9f7d","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-performance-test.5.tgz","fileCount":4,"integrity":"sha512-rUoFTI7OjlocP4W2v56DwYwB9aFr0Yq9UVb0urQytc8mSh5nc+fenLtuv7Q0MTl14hSjXmoS2FYQpo9wjODmww==","signatures":[{"sig":"MEQCIF5LrFVje+ew/x6lfBiswH+wAD2RfH5DUiuPYlIUyB02AiB7Yf8sEKH1I4xBAeCEc+VzKTs+aed0pWSzoUHAN2VPEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5be9448fbb16318ffc6853a878c2e7ebf9c1794b","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-performance-test.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-performance-test.5"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-performance-test.5_1715959422338_0.917775642741735","host":"s3://npm-registry-packages"}},"2.2.1-ci-performance-test.6":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-performance-test.6","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-performance-test.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"b4d49041a9dee399e05ee9f60257bfa8b1fc6be4","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-performance-test.6.tgz","fileCount":4,"integrity":"sha512-RbRqX3aIq+h+L2ZEMjVt90k4Uwo5O3677oHJcDtnoc7hJr/7/m0i7JJHaeHNFdDMjKRnZ84DF+WDu8sgoLRc1w==","signatures":[{"sig":"MEYCIQCkdY0C8EvnwRN8xFgaMsTXoYIDNZ+A2YbPHo1Ry5t0YwIhAPtMjx/fU/qrrbERld7NIAsMrRkKsSXHAGWyWz/r+DEy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9b8506cd30a8f5aa351ac67a6bdfef50c745a092","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-performance-test.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-performance-test.6"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-performance-test.6_1716193959869_0.13330224611080155","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-3rdPartyRewards.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-3rdPartyRewards.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-3rdPartyRewards.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"2a00e1284a327184d38e63902d5d6715f6376667","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-3rdPartyRewards.0.tgz","fileCount":4,"integrity":"sha512-JKMZKcHYaE6UATQNjAk8NeGS1oQEoEf8IHKYNIwC61wSnTviJEjwVHacF5fGmuIh3i/2Betd4jCgfCJFdOVvtA==","signatures":[{"sig":"MEYCIQC311eWgaUy+qoI8mjVzelVphK89wELcU7l5zOvFBp+TwIhAOioZSoQ2nGh5EoNmuQSvKZ/5avRq1kBQHp+xWeKSAHC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194132},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"781f3dcf0f87a04a97962be7f0ffeec08ef8e6bd","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-3rdPartyRewards.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-3rdPartyRewards.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-3rdPartyRewards.0_1716379256403_0.9257397748636051","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.45":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.45","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.45","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"32ae14a0842a9dfb2be95fb71294cc31e1154d38","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.45.tgz","fileCount":4,"integrity":"sha512-9QrYpMV/6+ReH0qIZVrR8p6ePjQ/7K5qT6EP80RXqgwVizhHp0nwB2MLMMgEiSt6lvutwLt85lZQ02F12IwU6A==","signatures":[{"sig":"MEQCIF8pwFHc4DXEGs5wmiRe1q+wI7PCRt2WSk9QyCrKhX7LAiBWWqgRiG4WGG4xmOfktaQ77yQpR6rPiXvlAtB1akPETw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"61d139fad82ca4a491fe4af31e9048dc4459ba6d","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.46"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.52"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.45_1716389605125_0.019313973935441542","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parAutocompound.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parAutocompound.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parAutocompound.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"bf8fe6dfa8effa63d49c8644ebd33a23dbe78620","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parAutocompound.0.tgz","fileCount":4,"integrity":"sha512-yT06YOzkOibWuj8qDZctaE+5DXaMCF8MeOviaPNJi2LZo6zK7WCZ2QGP3jyaSA1q7B9VIwQfHIm4mXKDqdut/w==","signatures":[{"sig":"MEUCIQDBHjEkpuRePhBc8/dTf75jqwrkZYzIK7LVIb0E4lsDLQIgf2DQ6y11SHDOd/nDb9txcWDC38PmY1r92AVgqO0W5bw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194132},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"70f6eb1d49acf1837f0f678d9fa1ed78b77bbdea","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parAutocompound.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parAutocompound.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parAutocompound.0_1716469950468_0.20901818282025908","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.46":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.46","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.46","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"08178d3cd2018be34105de9a2b851e9b7554d4ed","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.46.tgz","fileCount":4,"integrity":"sha512-4IJqNLiLjxQpjKPQXyRAlcizLIjzOI3OHUQuwgHGJ3CIDvF9mGK1H/MPkTt9SLDFFD6ZA/pf1T5u4JqGOjK/rQ==","signatures":[{"sig":"MEUCIQDa4lHhvNJYKXR4PWkkRxJtZ3I8JIPUhwo0baQrhvCrGAIgXYPMXYXDrGBOF5Pk6yVVxYvAnLs5b/wWe8TzpdF0F/E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"04048c2fa8abd2d9a836002fd415fef90ac3021c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.47"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.53"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.46_1716470934381_0.1593035153864577","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.47":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.47","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.47","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dc38dcb165f353265c786bd77f8e07350be29dcb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.47.tgz","fileCount":4,"integrity":"sha512-Uwk550zicVnvFzQTNQXGmnIBhNn1y9DOoJ1txH4iVwglHV1lw/ieQA9/Pb+XoCtTSGobMaaOSTE39lbWTorNVw==","signatures":[{"sig":"MEQCIC/Twj7jxEjo34oAuOPltNQ/beWagTTu3IkFx47hAJqAAiA6EnJmHL0K6VSGzZWc/97q+gm8Q35K/ofGIMOfeq4Tow==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"4bbccced85e96d6d2cc51ec130b2bbe0c9e9280b","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.48"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.54"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.47_1716565228348_0.04989673891556845","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.48":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.48","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.48","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c6a422393c7ed606fe611d5e509e28e42c0cfe40","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.48.tgz","fileCount":4,"integrity":"sha512-iNUYbr7zIUqHEILHcKwoTzxuil4WcU91IMPeOJbfK9EEOWNNssmpfjmOgiA/Iyuu/JJuR2qYFooJHZfcsqOupg==","signatures":[{"sig":"MEUCIF00vspWcRzm54epJziOdZbzKgU7UvEjW9Zi8GUkXWlIAiEAoRqo+pu7M5efmrDo9P3M9+roOATBbZ/1xWr7QgM/4PQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"191b9a7d02cea8ae56df43786bbed777be2b4685","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.49"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.55"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.48_1716797214493_0.9782792724878746","host":"s3://npm-registry-packages"}},"2.2.1-ci-rollup-wasm-generation-setup-MGX-1094.0":{"name":"@mangata-finance/sdk","version":"2.2.1-ci-rollup-wasm-generation-setup-MGX-1094.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-ci-rollup-wasm-generation-setup-MGX-1094.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"9ee23dbf0504795c498e5b296b566bda7985b8d5","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-ci-rollup-wasm-generation-setup-MGX-1094.0.tgz","fileCount":4,"integrity":"sha512-vRDKyslH7NUT7zyMtHbd2PUTnVhQNy2J99770qb2zXNhxGaTnQ8vvn3poDfbxob+zg1+k6gp3iG9AM98UJEJEg==","signatures":[{"sig":"MEQCIChMrovgtKaE2r88VVJD6gTx9vSAAspyzokqtu5MggkEAiAxV/+tO21181rBwm5Rr1x3FDBhttz3OTYNVEtoyANnHg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194141},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"d400241a66c9e09e27ad2519c82d1ee6508cc114","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-ci-rollup-wasm-generation-setup-MGX-1094.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-ci-rollup-wasm-generation-setup-MGX-1094.0"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-ci-rollup-wasm-generation-setup-MGX-1094.0_1716828338828_0.8756262044308953","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.4":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c87f339b962f67afd6a39cda5d979da2160df2e0","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.4.tgz","fileCount":4,"integrity":"sha512-+7fJlirns65oeTCHUEgNvGni/74VOr2WWcKHkuXHaOfHqOU/SMqMx4yCdpqCizSNWrdXwnwvOQ6+gWGip9Abxg==","signatures":[{"sig":"MEUCICxYfoV4iVpzcTrGOdA2ziwLjq4tCwXa/wIQs3KC8ptmAiEA0pkyNjXOpC2Hsx4hp4opbGsu53hc/6IsPoDxTtvuQsM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509085},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"ccbb0161d0cb874db241b2317ea52934366d5ba3","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.6"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.4_1716899512193_0.2732671017984549","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.50":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.50","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.50","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c03f39e75c096b4606446298505328ac0a3a59e4","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.50.tgz","fileCount":4,"integrity":"sha512-w7Vcc8+FLlNEWeIqABfK0EXu9G/NSS0UxhMf+QCIzdFMq++6tg9nB3gmIVso62T++FtdZ5vPpiuiwU9HH4HhrA==","signatures":[{"sig":"MEYCIQC3hEgvvdj3YN4aRfYiJ1NklNgWbihpAZ2i9T3DogpfSQIhAPd8xwSctiRFDxukOHjRIUrw9fwRiJoiUo+SUkT7QJlX","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6c331d2465de7cd9a3b8629efd0329c20b4eab4e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.58"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.57"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.50_1716908792711_0.8381883179416363","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.51":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.51","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.51","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d76198a76b447db9aa18bb9782790ca668149e05","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.51.tgz","fileCount":4,"integrity":"sha512-1w2z2ZvtzjaQFCsKcgOE4KIAH1wa1JDmC6cUbKuYhmkuEoqW5dkpmgJ1BU812pxC8gXGMKE1HdaTeNJAOT8aag==","signatures":[{"sig":"MEYCIQCdlRw8EFmO4qya1jWIWph6J8Q3qGMA2wOOWvyJMUZCTgIhAKcMJz2N7U/+PtANa7lRh7tRt8owLfIJDzjXJ9dqYTOO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"fb9c6caddfa4a76eeb94a025fe350efe31532969","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.5.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.2","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.59"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.58"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.51_1716909666365_0.8649454339724612","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.5":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.5","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"5b040e9a40baa7b85e96cb50e0e8c729dc1b05af","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.5.tgz","fileCount":4,"integrity":"sha512-Lvb2Gnw0A6x8L4/5mqO+XQqRk6t8XsZmakN4Zo3p/VzGDF/Sgo8gzwkYaNU2FphV0rAkKDId7ZQWzmK0VA5pVg==","signatures":[{"sig":"MEYCIQDp717Lg9FgkYaZAIgpWz5tcXBD4p8Xl0jbJws6rTsKCQIhAJVRSIlQ0pYNSrEoDBvt/CcJ1W/lVEORKhqiTUNWO3Ld","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509085},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"9e55d0de88ec2213560c606d4264b87b6f48e482","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.7"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.7"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.5_1716962413413_0.438129543387187","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.6":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.6","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"90d01e6c23326a31a996a810048e225c5bc53790","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.6.tgz","fileCount":4,"integrity":"sha512-SODlEKvNTRTdwsSUakBy2Jxt5G+3CzUoV/5MsBtBqE3UBK3b2dBXfS+r93zh66Dz/2gS1sEow7RL3e1a+nDY8Q==","signatures":[{"sig":"MEUCIEjYGmnDGcD0qv8z+QPN5pXc4H97naZnhQqxrKpz2liUAiEAoTrwJ6rPidUWTimFx6B/NBFg/7PYoAI6c9Nwt6q2ARw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509085},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"02ca4a68f518faa34e6cf034c8a587384799bb42","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.8"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.8"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.6_1716962925359_0.43388403226929473","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.7":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.7","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.7","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"a0d32ac6ce5da40fd82af96f7ea15d66ccc8496f","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.7.tgz","fileCount":4,"integrity":"sha512-GtP4X5LvgzvX2Z3TEj8h3WEnsmtDcmVBmIn4DhiawURcabmvIEr4qqemupO7osNsMPqSRZ1VzpC6SArpq9VNQw==","signatures":[{"sig":"MEQCICworAK5rQ8ZDTB4tvhhgjpvb1Logj0ABWmJuAeuujr2AiAFn/V7W6WO2NfTW5XverWyvw9ODvNeIA6RXo1XLBMUXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509085},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"7d65c3dc1b9836aecb7bf31b93c72a3df7473525","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.9"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.9"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.7_1716964060309_0.14863940937101128","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.8":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.8","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.8","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"7ee26ef7dc3bd78309ccb4265c4847ce86b9c911","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.8.tgz","fileCount":4,"integrity":"sha512-rIGbnAb0il3y6mK9/JVCVTQ+IRJX/+mB0ES5aF1qyAm5HRVOhjTAvXBmd3tmGvHAGUojxwXcSczC05JLhmLHTg==","signatures":[{"sig":"MEUCIG7VhQLvrFo/f9v1Z4PNs0S1cbNT70HLyp1hpz0wFIfsAiEAmlRyTMED4WlOKzi6TT8mtRtlTmIcbSMB/tcbd1ZJ+i4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509087},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"99bc906bb76ab1d952a65f11f263bb2603ff23fb","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.11"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.10"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.8_1716965069553_0.8206915696553017","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.9":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.9","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.9","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"64c2fe511c4578296a4382579a703b56d4fd82fc","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.9.tgz","fileCount":4,"integrity":"sha512-TVzNq1DxiLv5ZwyHMBag7HJJpcjRpefNnWtG/mpgpo0MJI/v34jUquaIxvCzR6KxMLgJQa1y+NbY6mbbQZwFLA==","signatures":[{"sig":"MEUCICwxb58UZLv8vSBi+RNn2aklilnqkHSFFal6TiCY71yXAiEAsWm+iHmdzSwXhyAl1e4l+XhlDFKiGAPnotfAA2bF84Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509087},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"c7612b60ae001e7241b46d3c9c7b90f2f55aefff","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.12"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.11"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.9_1716986522017_0.47950160702639044","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.10":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.10","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.10","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"adf681e56b8624df4c63f613b986f10c4624cdb6","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.10.tgz","fileCount":4,"integrity":"sha512-MXJFEBgOXKnqoymEs2RMYrvLas4eZtgO+GBm6VF7+UwRshU06risrwi6bsYYmRoGEMsYJV9HeF5VE4RGRRJEJQ==","signatures":[{"sig":"MEUCIDWYCarDb6AKVQgQah9U+qnTinpsQIQg2tNRNi5hIamWAiEAlJbVk+90EoXXiDPZNwF/61PNwm3JCpRxQW8g13nuVGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509088},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"dd1235b5f69d35e473b2a76ff8948a2f4d038295","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.13"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.12"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.10_1716989627200_0.3970001941885435","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.11":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.11","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.11","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"039c32646e351dff2cf3f37565327e5311666ecc","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.11.tgz","fileCount":4,"integrity":"sha512-52CuVFWLtKzdgC3YBYqZ9ngovL9BvfwTtOG1nZ0lpefrNGdsUhS+SGz4IR1KcvA3gxOUNsfz1LdUEeYVisHFzg==","signatures":[{"sig":"MEYCIQC467OQ2BlGpcht0eGl83BbseRwMYIzikUaH72uqHAOPwIhAIwq2e5T5yW7KtiNShOYhFJJbYG7Zw474PkO3WsnPyb9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509088},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"1f674d26d62c38687770eb58ceb3306d84fdf6f9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.15"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.13"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.11_1716990738534_0.9927310958818285","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.52":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.52","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.52","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"acaac59d795984ec1817c03bddba28cb7bf9a783","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.52.tgz","fileCount":4,"integrity":"sha512-H+cluccjEgVulyk1snf41swyFRYYyZX1AIG0qDt2R4zwQqdaGkpmr5IjKDrV2ucf1QMXi/jd8Jbc9HdxiXaSJA==","signatures":[{"sig":"MEUCIF7Q89hprxjsNSCFuReUB3U/N7Ol6DiKW+z5L/hmc/F1AiEA8wcKiPlI9ATJos7ByJzZ5XQkhOGTAEHITSasU6Iql7k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"4e01a06153032ec188d7de8f6f02dc02f7acbe1c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.60"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.59"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.52_1717078792207_0.8036288000728522","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.12":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.12","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.12","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"047b42a6cf36041bbd434017cabe0e7e2de2d546","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.12.tgz","fileCount":4,"integrity":"sha512-2J/x605pbxKIsTTutclvihLzgO45LZDaCCGFJGtLbtgv1BtQuO8NvGkVzMOqDd0HF3I35kNYLDGq1YAhLvFSDg==","signatures":[{"sig":"MEYCIQDcf6ci4LM/n5dLKfAquRXjAgBH2KLHbngAF4Nt/VPYZAIhAJkcAU5ULpEN2oVrPe6XB9Cz7UbmcADeuhrMQETDzKkq","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509088},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"4bcd5788b4a9deff94f09fbdfed5613ffdfb4e08","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.16"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.14"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.12_1717079034570_0.07372702935565334","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-poolLiq.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-poolLiq.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-poolLiq.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e6440e54afef40440b7d317e40db39c1a3ef136e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-poolLiq.0.tgz","fileCount":4,"integrity":"sha512-WibGhCBgMRffrIFexXAzz7iDUqWM67z8k/3xUKoN/fz9ytf8UJHKJcMoPqdKbW98nInxciSgoUzrl/BVfHQPFw==","signatures":[{"sig":"MEUCIQC+nmYYWgxmxhi2WcNBV/G5MPzd+54OYb9PQcYyvgWVZgIgdsBDQmWvPPp2rn1CofPHtYAtSlNjaWq5Mhf3WDN4x8M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194108},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"17b0dae828252eb0e9d4d472649c568ed79efcde","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-poolLiq.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-poolLiq.0"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-poolLiq.0_1717081057301_0.5126038659431529","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.13":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.13","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.13","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"c1038e326c8d4a891aff44b186f77b036e87d078","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.13.tgz","fileCount":4,"integrity":"sha512-AHlsTw7sNLHkfDWaHhZoS3zLXoo4iNge6sTJESaXDF7yNYxeft007hVBLJoYmTbALLyNqr9U7QbLDowpfog0Dg==","signatures":[{"sig":"MEQCICNUmHC+VIFHGqPPCktMVIWst4byi8hGkyQ/RWsa2qZOAiBCzepgQQI40iyuDqtJrTjHPIsrX04eozcVG7Lcqf5IjQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509088},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"2b2ad77da7776a1a66089182089be1bf8a8c2500","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.17"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.15"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.13_1717422058512_0.7582109225857045","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.0":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.0","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.0","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"d2cff87e628cbe3d3ebc57dc988d1336b23122bb","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.0.tgz","fileCount":4,"integrity":"sha512-FDCC4LMDFu6giwWFaUUpB4ZqzZ4jN3w8vXGTfpTEJYDrl0/eDITxk1+NF0L7vohrvcG0D0V0O6dnFzMIaZZIrw==","signatures":[{"sig":"MEYCIQDOFUYoU7/7hGYNgRsVCzi+FtHOuvxh7T/sheLSgIbx6AIhAJ57e1J1F2K9iHXg5bR0mq6/szUmX2vDu81BI5FD8u2G","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194111},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"8bb193d22c03e9551e4dfa27de9b0d0ffc9ca72e","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.0"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.0_1717426895595_0.9388400571988169","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e7e2d7cd8df18e131a3576f9ad007dc8ccf64c89","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.1.tgz","fileCount":4,"integrity":"sha512-qIk5WxjtdWS2Rku8bESKzRppYKlWIPeygzLLn8pw1mak6JGWbh9PQYcx977hvn7e6Cg7WzCPxkUXnE9HuC7ljg==","signatures":[{"sig":"MEYCIQCJX3I15JJl2F1ixcDOygV1Nyl379Asv1x3MTBo6IDRlAIhAPdBle0aoio/WBBZJyok3tVzkXZRP3hWIrzTPpjt5M9V","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194111},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"1cac1607cec485b4e69770715401b2acb1cf7a91","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.1"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.1_1717487166992_0.03431811521003869","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.2":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.2","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.2","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"6f41951fafc7b924fa5fc97aab37872b08d7ba72","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.2.tgz","fileCount":4,"integrity":"sha512-R5p7YwF060ozxLQPcogZnc/cnktzrqD2kMLBCtglXakacfhqR4BrzlGQhgeYT9f60D1SHYANc6AXUgtzuxAwhg==","signatures":[{"sig":"MEYCIQDFuQ2/IrT5rYerg7HD8WxX9vDiCkgDnwSWzW5/y4/hkQIhAPyDzo0wA6TDkkbMwNcpzaRpFR/Ba7/kKKVsDJfyAzFA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194111},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b30f965e14946eeacea9bda9c56b3af9365ad2d9","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.2"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.2_1717493773296_0.8159400349293491","host":"s3://npm-registry-packages"}},"2.2.1-feature-multiple-l1.14":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-multiple-l1.14","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-multiple-l1.14","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"394c9c7bb71a551b1992de295c6767b508a33168","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-multiple-l1.14.tgz","fileCount":4,"integrity":"sha512-Nm6gysJndRYHVIHxYi7raSuAACiK2gX8RFyP2ygbhyIWmpFBxgujseRwf0JVLG17fR19rVnd44WWFR0mm4mmxQ==","signatures":[{"sig":"MEUCIQD53xeeZecHMvZt/Jwt1DfpKDAmVI57KNRN7aZ6OU+KKwIgLzAsfhcyUuOKmGl8QCcRkTnnSFlgdQX+sIa2B1iYwog=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":509088},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"936c8f2196fb5b768879490349dcf228187cb093","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-multiple-l1.18"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-multiple-l1.16"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-multiple-l1.14_1717579393072_0.9455751748180303","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.53":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.53","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.53","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"dbc2e032f1dfcd6bd0dbc4570825e81e722ea2f7","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.53.tgz","fileCount":4,"integrity":"sha512-FI0zR24YmhAuBt4Je9QXH+GXgw0UXV18RIvGX+PfphuZKQJ4+ThhXGRxdEiipcxedKVYEfe8IQNyxrjbjBpN6g==","signatures":[{"sig":"MEQCIFLQ1GbLJ3cy0EEmDQ9mA4WXZxVUoF5OGHWnakLc4EHSAiAgao41PzF0rVnau6JsKwQswR1Un9P2p/hBTE1svyS6Bg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"5d246987eb087bc5d58c1b9e0cabf9c2318a3c7c","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.61"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.60"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.53_1717591098665_0.845896237553383","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.3":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.3","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.3","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"e993ff75cf12ea6ae4a47ccfab5e42b964c8cf8b","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.3.tgz","fileCount":4,"integrity":"sha512-ToH7RU7OkzSvKMmHcgKqEKHR+f5oXn5hsItOfrJzITDA/1nQgpxZzCeLm/nDyzhMXQz6WA3FbUV+PEmghJXtFA==","signatures":[{"sig":"MEYCIQCHgWk2Hb2LtwF/+PbY8FcjTmwzVsbAjyoaEkNNeXAPGQIhAOGmOpA9MsS46Lu/xy82Fh9+gnK872PINlHVyA68co6j","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194111},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"b41c89509a9c92d3c3881abda757956f7d4a57f7","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.3"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.3"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.3_1717591857797_0.6710112332621565","host":"s3://npm-registry-packages"}},"2.2.1-eth-rollup-develop.54":{"name":"@mangata-finance/sdk","version":"2.2.1-eth-rollup-develop.54","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-eth-rollup-develop.54","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"15b280efebb22db1e6ddbdcee6a07e51f062a129","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-eth-rollup-develop.54.tgz","fileCount":4,"integrity":"sha512-ZfE1NLlYz0t7psDcRobtomr5WXrP79FZO3t9RMApNtigr4O8WDSqBSZQHQ3mjN0qIdgHAzDebE/sNsnDSlzC/Q==","signatures":[{"sig":"MEUCIHg4A3gAVA+M2DiPny4Wtk93nn7N3R4tSSt/LSueZEq5AiEAl//0isVncY6CFYnZu0ffY5XpogYmBoC8EV7BNOSuADc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194078},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"21179c8654c074ff3e4c197660fc00a4a1073368","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-eth-rollup-develop.62"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-eth-rollup-develop.61"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-eth-rollup-develop.54_1717594717740_0.38309346621259754","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.4":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.4","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.4","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"19a284b0f90353f769f5429093d1929bc2526109","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.4.tgz","fileCount":4,"integrity":"sha512-Lm2cu77rEQuC5TDRfDB49j4iSXDlxsOLGAYgLRYehoegiiTVQ4H2QFwmHzRm9wV6zgcDnOU0npHuUNv390/Qxw==","signatures":[{"sig":"MEYCIQChUqcnM0YZFLuoyJtxk8XKbNzu1qSRHrYHVlRJ3s6z0gIhAPY/D3BlAx33K4ZNDEmHmz1XZW3irrATIeHoLSzuN1QN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194111},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"6c39d211806d009fa606752e305f42111c1be386","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.4"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.4_1717600083703_0.7670773692360531","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.5":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.5","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.5","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"f540057ef7c8dbf77c566d44f5fcda77ede65849","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.5.tgz","fileCount":4,"integrity":"sha512-3iFEB7UFWqwzwod6cPhsxKjFj5PnRYz2WJ89MR7u1PCf6KOvjX0Y83UB8IoZAdG8zXuNuzBvcsIyP1BX2C1L7A==","signatures":[{"sig":"MEUCIQDAwNmSvlNz2mhnfpXVOQ80PorprirsMf9eGMopSE4SVwIgKehcO0aSFwzDXUbPOdGc4n+OedS+oC93wOMK1lUSMsA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194111},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"f83f9cae4d8c89d5852b0c9e16fe594c6a58bbb2","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.5"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.5"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.5_1717663648974_0.4782974295767284","host":"s3://npm-registry-packages"}},"2.2.1-feature-mm-on-rollup.1":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-mm-on-rollup.1","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-mm-on-rollup.1","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"693cc81704465459b312940960cc4196fa491579","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-mm-on-rollup.1.tgz","fileCount":4,"integrity":"sha512-taJtVPhQAWFtQIYXp8JT3JT09F7bXCgwMOx1enQVKWdqlELAtKA7wR4h+aNDWpQA1I75ap6wcE5ac3qhSSE2Aw==","signatures":[{"sig":"MEQCID6/CjykFohhuxBCvCrYOSTrh+enf/iseypRip3cRk6bAiBfUaiyf8v/SFOiibf5R55S61iXlFWvsK7XquvCUZgprg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194081},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"bc8a0af76451744847c17a29c1d69789cf0feaf7","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-mm-on-rollup.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-mm-on-rollup.1"},"peerDependencies":{"@polkadot/api":"10.12.2"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-mm-on-rollup.1_1717748401564_0.3594624232433965","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.6":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.6","keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.6","maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"dist":{"shasum":"513df6fd1fa23515b04e2e0506597b6a86d75e9e","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.6.tgz","fileCount":4,"integrity":"sha512-VuJGFhuwF1hRcCLrq5L8nKJx9ZUjhjzPoBV5aIP7/fzUBdxiRtuAvTvHDWHK0XOg2n9o1V20BRUloroH+K/shQ==","signatures":[{"sig":"MEQCIDi06gSuIUmvYlUhnrqXSvVLB362uEViYJNQEuUm54iGAiAqESjlnmP17UEujnctdQCQ07OmIhtK9Wyf5RSlrgZyUw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":194111},"type":"module","types":"./index.d.ts","module":"./index.js","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"3cb7f452e8b35c314d0cfd56a20f578f7d033b0f","private":false,"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"_npmVersion":"10.7.0","description":"Mangata SDK","directories":{},"_nodeVersion":"18.20.3","dependencies":{"tslib":"^2.3.0","tslog":"4.8.2","big.js":"6.2.1","@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.6"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.6"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"_npmOperationalInternal":{"tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.6_1718201774497_0.42393666707323785","host":"s3://npm-registry-packages"}},"2.2.1-feature-eth-upd-tests-parallel.7":{"name":"@mangata-finance/sdk","version":"2.2.1-feature-eth-upd-tests-parallel.7","description":"Mangata SDK","type":"module","module":"./index.js","types":"./index.d.ts","engines":{"node":">=18.0.0"},"keywords":["mangata","sdk","trading"],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/mangata-finance/mangata-dev-kit.git"},"peerDependencies":{"@polkadot/api":"^11.1.1"},"devDependencies":{"@mangata-finance/types":"2.2.3-feature-eth-upd-tests-parallel.7"},"dependencies":{"@metamask/sdk":"0.16.0","@mangata-finance/type-definitions":"2.1.3-feature-eth-upd-tests-parallel.7","big.js":"6.2.1","tslog":"4.8.2","tslib":"^2.3.0"},"exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"private":false,"_id":"@mangata-finance/sdk@2.2.1-feature-eth-upd-tests-parallel.7","readme":"## Mangata Finance SDK\n\n<p>\n    The Mangata SDK is a comprehensive toolset designed for facilitating seamless communication with the Mangata node.\n</p>\n\n![Artwork](https://blog.mangata.finance/assets/posts/themis-cover.png)\n\n![npm](https://img.shields.io/npm/v/%40mangata-finance%2Fsdk)\n![Issues](https://img.shields.io/github/issues/mangata-finance/mangata-sdk)\n![Pull Request](https://img.shields.io/github/issues-pr/mangata-finance/mangata-sdk)\n![GitHub last commit](https://img.shields.io/github/last-commit/mangata-finance/mangata-sdk)\n![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fmangata-finance%2Fmangata-sdk%2Fbadge%3Fref%3Ddevelop&style=flat)\n![npm type definitions](https://img.shields.io/npm/types/%40mangata-finance%2Fsdk)\n\n# Getting Started\n\nThe Mangata SDK is the TypeScript library that offers a wide range of convenient methods for effortlessly buying and selling assets on the Mangata DEX. Its primary objective is to streamline the development process for client applications, specifically targeting algorithmic traders and frontend interface builders. By utilizing the Mangata SDK, developers can significantly reduce time and effort required to integrate with the platform.\n\n## Installation\n\n```sh\n// with npm\nnpm i @mangata-finance/sdk\n\n// with yarn\nyarn add @mangata-finance/sdk\n```\n\n## Migration from v1 to v2\n\nTo migrate from v1 to v2, certain modifications need to be made. This guide aims to help you refactor your codebase. We have divided the methods into specific groups:\n\n1. xTokens\n2. xyk\n3. rpc\n4. tokens\n5. submitableExtrinsic\n6. query\n7. fee\n8. util\n\nThe **buyAsset** and **sellAsset** methods have been removed and replaced by **multiswapBuyAsset** and **multiswapSellAsset** respectively.\n\nWe also made a change by transitioning from using arguments for functions to using objects as parameters.\nExample:\n\n```js\nV1:\nawait instance.createPool(\n    testUser,\n    firstTokenId,\n    new BN(\"10000000000000000000000\"),\n    secondTokenId,\n    new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  );\n\n\nV2:\nconst args: CreatePool = {\n    account: testUser,\n    firstTokenId: firstTokenId!,\n    secondTokenId: secondTokenId!,\n    firstTokenAmount: new BN(\"10000000000000000000000\"),\n    secondTokenAmount: new BN(\"10000000000000000000000\"),\n    txOptions: {\n      extrinsicStatus: (data) => {\n        console.log(data)\n      }\n    }\n  };\n  await instance.xyk.createPool(args);\n```\n\nWe no longer support the implementation of depositing to Mangata within the SDK. However, we do provide the necessary raw methods for depositing, which should be implemented separately outside of the SDK. For specific examples of how to deposit to Mangata using the SDK, please refer to the provided examples.\n\nTo obtain an instance of the Mangata node, please follow this step:\n\n```js\nV1:\nconst mangata = Mangata.getInstance([\"wss://kusama-archive.mangata.online\"]);\n\nV2:\nimport { MangataInstance } from \"@mangata-finance/sdk\"\nconst mangata: MangataInstance = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n```\n\nMethod **getAmountOfTokenIdInPool** has been renamed to **getAmountOfTokensInPool**\n\n```js\nV1:\nconst amount = await mangata.getAmountOfTokenIdInPool(\"0\", \"4\")\n\nV2:\nconst amount = await mangata.query.getAmountOfTokensInPool(\"0\", \"4\")\n```\n\nPlease replace the existing \"buyAsset\" and \"sellAsset\" methods with the newly introduced \"multiswapBuyAsset\" and \"multiswapSellAsset\" methods.\n\n```js\nV1:\nawait mangata.buyAsset(\n    account: string | KeyringPair,\n    soldAssetId: string,\n    boughtAssetId: string,\n    amount: BN,\n    maxAmountIn: BN,\n    txOptions?: TxOptions\n  )\n\nV2:\nconst args: MultiswapBuyAsset = {\n    account: Account;\n    tokenIds: TokenId[];\n    amount: TokenAmount;\n    maxAmountIn: TokenAmount;\n    txOptions?: Partial<TxOptions> | undefined;\n}\nawait mangata.xyk.multiswapBuyAsset(args)\n```\n\nTo illustrate how to retrieve asset information, you need to determine its corresponding section within the SDK. The method **getAssetInfo** is located within the query block.\n\n```js\nV1:\nconst assetInfo = await mangata.getAssetInfo()\n\nV2:\nconst assetInfo = await mangata.query.getAssetInfo()\n```\n\n# Basic use case\n\nHere is a quick example to get you started, **all you need is Mangata instance**:\n\nSupport: Only ESM\n\n```js\nimport { Mangata } from \"@mangata-finance/sdk\";\n\nasync function main() {\n  // Connect to the mainet (also testnet, mainnet)\n  const mangata = Mangata.instance([\"wss://kusama-archive.mangata.online\"]);\n\n  // Retrieve the chainName, nodeName & nodeVersion information\n  const [chain, nodeName, nodeVersion] = await Promise.all([\n    mangata.rpc.getChain(),\n    mangata.rpc.getNodeName(),\n    mangata.rpc.getNodeVersion()\n  ]);\n\n  console.log(\n    `You are connected to chain ${chain} using ${nodeName} v${nodeVersion}`\n  );\n}\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\nFor available methods please visit [docs](https://mangata-finance.github.io/mangata-sdk/)\n\n# Documentation\n\n```js\nimport {\n  Mangata,\n  MangataInstance,\n  MainTokens,\n  PoolWithShare,\n  TokenId,\n  Token,\n  PoolWithRatio,\n  TokenBalance,\n  TokenInfo\n} from \"../\";\nimport { BN } from \"@polkadot/util\";\n\nconst ENDPOINT = \"wss://kusama-archive.mangata.online\";\nconst KSM_TOKEN = \"4\";\nconst MGX_TOKEN = \"0\";\nconst ADDRESS = \"5CP5sgWw94GoQCGvm4qeNgKTw41Scnk2F41uPe4SSAPVPoCU\";\nconst LPTOKENKSMANDMGX = \"5\";\n\nconst main = async () => {\n  const mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n  /**\n   * Retrieves the amount of tokens in a liquidity pool for a given pair of\n   * tokens.\n   * @param {string} firstTokenId\n   * @param {string} secondTokenId\n   *\n   * @returns {BN | Array}\n   */\n\n  const amountOfTokens: BN[] = await mangata.query.getAmountOfTokensInPool(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves information about the assets.\n   *\n   * @returns {MainTokens}\n   */\n  const assetInfo: MainTokens = await mangata.query.getAssetsInfo();\n\n  /**\n   * Retrieves the current block number.\n   *\n   * @returns {string}\n   */\n  const blockNumber: string = await mangata.query.getBlockNumber();\n\n  /**\n   * Retrieves the pools in which the specified address has invested\n   *\n   * @returns {PoolWithShare | Array}\n   */\n\n  const investedPools: PoolWithShare[] = await mangata.query.getInvestedPools(\n    ADDRESS\n  );\n\n  /**\n   * Retrieves the liquidity pool information for a specific liquidity token * ID.\n   *\n   * @returns {TokenId | Array}\n   */\n\n  const liquidityPool: TokenId[] = await mangata.query.getLiquidityPool(\n    LPTOKENKSMANDMGX\n  );\n\n  /**\n   * Retrieves the liquidity token ID for a given pair of tokens.\n   *\n   * @returns {TokenId}\n   */\n  const liquidityTokenId: TokenId = await mangata.query.getLiquidityTokenId(\n    KSM_TOKEN,\n    MGX_TOKEN\n  );\n\n  /**\n   * Retrieves the liquidity token IDs.\n   *\n   * @returns {TokenId | Array}\n   */\n  const liquidityTokenIds: TokenId[] =\n    await mangata.query.getLiquidityTokenIds();\n\n  /**\n   * Retrieves the liquidity tokens.\n   *\n   * @returns {MainTokens}\n   */\n  const liquidityTokens: MainTokens = await mangata.query.getLiquidityTokens();\n\n  /**\n   * Retrieves the nonce of the specified address.\n   *\n   * @returns {BN}\n   */\n  const nonce: BN = await mangata.query.getNonce(ADDRESS);\n\n  /**\n   * Retrieves the tokens owned by a specific address.\n   *\n   * @returns {[id: TokenId]: Token}}\n   */\n  const ownedTokens: {\n    [id: TokenId]: Token\n  } = await mangata.query.getOwnedTokens(ADDRESS);\n\n  /**\n   * Retrieves the detailed information about a specific pool.\n   *\n   * @returns {PoolWithRatio}\n   */\n  const pool: PoolWithRatio = await mangata.query.getPool(LPTOKENKSMANDMGX);\n\n  /**\n   * Retrieves information about all the available pools.\n   *\n   * @returns {PoolWithRatio | Array}\n   */\n  const pools: PoolWithRatio[] = await mangata.query.getPools();\n\n  /**\n   * Retrieves the token balance for a specific address and token ID.\n   *\n   * @returns {TokenBalance}\n   */\n  const tokenBalance: TokenBalance = await mangata.query.getTokenBalance(\n    MGX_TOKEN,\n    ADDRESS\n  );\n\n  /**\n   * Retrieves detailed information about a specific token.\n   *\n   * @returns {TokenInfo}\n   */\n  const tokenInfo: TokenInfo = await mangata.query.getTokenInfo(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of a specific token.\n   *\n   * @returns {BN}\n   */\n  const issuance: BN = await mangata.query.getTotalIssuance(MGX_TOKEN);\n\n  /**\n   * Retrieves the total issuance of all tokens.\n   *\n   * @returns {Record<string, BN>}\n   */\n  const totalIssuanceOfTokens: Record<string, BN> =\n    await mangata.query.getTotalIssuanceOfTokens();\n\n  /**\n   * Calculates the buy price based on the reserve parameters\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateBuyPrice(argsReserve);\n\n  /**\n   * Calculates the buy price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateBuyPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n\n  /**\n   * Calculates the rewards amount based on the rewards parameters.\n   *\n   * @returns {BN}\n   */\n  const argsRewards: Rewards = {\n    address: ADDRESS,\n    liquidityTokenId: LPTOKENKSMANDMGX\n  };\n  const rewards: BN = await mangata.rpc.calculateRewardsAmount(argsRewards);\n\n  /**\n   * Calculates the sell price based on the reserve parameters.\n   *\n   * @returns {BN}\n   */\n  const argsReserve: Reserve = {\n    inputReserve: new BN(\"1000000000000000000\"),\n    outputReserve: new BN(\"10000000000000000000\"),\n    amount: new BN(\"10000\")\n  };\n  const price: BN = await mangata.rpc.calculateSellPrice(argsReserve);\n\n  /**\n   * Calculates the sell price based on the asset's ID.\n   *\n   * @returns {BN}\n   */\n  const price: BN = await mangata.rpc.calculateSellPriceId(\n    KSM_TOKEN,\n    MGX_TOKEN,\n    new BN(\"10000\")\n  );\n};\n\nmain()\n  .catch(console.error)\n  .finally(() => process.exit());\n```\n\n# Transactions\n\n```js\nimport {\n  Mangata,\n  MangataInstance\n  TransferTokens,\n  MangataGenericEvent,\n  MangataGenericEvent,\n  MultiswapBuyAsset,\n  Batch,\n  MintLiquidity\n} from \"@mangata-finance/sdk\";\nimport { BN } from \"@polkadot/util\";\nimport { Keyring } from \"@polkadot/api\";\nimport { v4 as uuidv4 } from \"uuid\";\nimport { ISubmittableResult } from \"@polkadot/types/types\";\nconst mangata: MangataInstance = Mangata.instance([ENDPOINT]);\n\nconst keyring = new Keyring({ type: \"sr25519\" });\nconst testUser = \"//testUser_\" + uuidv4();\nconst account = keyring.createFromUri(testUser);\nkeyring.addPair(account);\n\nconst args: TransferTokens = {\n  account: account,\n  tokenId: MGX_TOKEN,\n  address: ADDRESS,\n  amount: new BN(100e18), // 100 MGX\n  txOptions: {\n    statusCallback: (status: ISubmittableResult) => {\n      // Here you can check for status of your transaction\n      console.log(status);\n    },\n    extrinsicStatus: (result: MangataGenericEvent[]) => {\n      // here will be the result of your transaction\n      console.log(result);\n    }\n  }\n};\nawait mangata.tokens.transferTokens(args);\n\nconst args: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18),\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.xyk.multiswapBuyAsset(args);\n\n  const argsBuy: MultiswapBuyAsset = {\n    account,\n    tokenIds: [MGX_TOKEN, KSM_TOKEN],\n    amount: new BN(1000e18), // 100 MGX\n    maxAmountIn: new BN(60000e18)\n  };\n  const tx1 = await mangata.submitableExtrinsic.multiswapBuyAsset(argsBuy);\n\n  const argsMint: MintLiquidity = {\n    account,\n    firstTokenId: KSM_TOKEN,\n    secondTokenId: MGX_TOKEN,\n    firstTokenAmount: new BN(100e12),\n    expectedSecondTokenAmount: new BN(1000e18)\n  };\n\n  const tx2 = await mangata.submitableExtrinsic.mintLiquidity(argsMint);\n\n  const args: Batch = {\n    account,\n    calls: [tx1, tx2],\n    txOptions: {\n      statusCallback: (status: ISubmittableResult) => {\n        // Here you can check for status of your transaction\n        console.log(status);\n      },\n      extrinsicStatus: (result: MangataGenericEvent[]) => {\n        // here will be the result of your transaction\n        console.log(result);\n      }\n    }\n  };\n  await mangata.batch(args);\n```\n","readmeFilename":"README.md","gitHead":"4cfe8a063d148ac73434a136705131082ff48272","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","_nodeVersion":"18.20.3","_npmVersion":"10.7.0","dist":{"integrity":"sha512-86hbWccRUHSbvBBUlwhokfm9FBu6GROmyXAqN6QWM0d2+sO21fOqcSHMAkxZjlYPc+VHplngPmcYJ64XhlEO7g==","shasum":"6a4f4fbf53847890bb810934bb9b26117d3460a9","tarball":"https://registry.npmjs.org/@mangata-finance/sdk/-/sdk-2.2.1-feature-eth-upd-tests-parallel.7.tgz","fileCount":4,"unpackedSize":194111,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDKJYKmVcNNVIve5qYecpZO8UC5mO7iNMrqTo/xwcvSGgIhAKMdvDZdcbdCq89gioqLhz0RiVSc2o/QncMfmCFYcQ++"}]},"_npmUser":{"name":"mangata.dev","email":"solutions@mangata.finance"},"directories":{},"maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk_2.2.1-feature-eth-upd-tests-parallel.7_1718293785269_0.4129226824623655"},"_hasShrinkwrap":false}},"time":{"created":"2022-06-14T13:39:39.071Z","modified":"2024-06-13T15:49:45.651Z","1.0.0":"2022-06-14T13:39:39.334Z","1.0.1":"2022-06-14T15:23:12.197Z","1.0.2":"2022-06-15T04:09:38.320Z","1.0.3":"2022-06-16T07:05:24.839Z","1.0.4":"2022-06-16T11:38:36.039Z","1.0.5":"2022-06-17T13:43:37.142Z","1.0.6":"2022-06-19T13:02:41.051Z","1.0.7":"2022-06-24T05:18:55.082Z","1.0.8":"2022-06-26T07:56:08.830Z","1.0.9":"2022-07-21T13:48:54.594Z","1.0.10":"2022-07-21T15:04:06.115Z","1.0.11":"2022-07-22T07:18:12.865Z","1.1.0":"2022-07-25T10:43:00.014Z","1.2.0":"2022-07-25T11:30:05.942Z","1.3.1":"2022-07-25T11:57:58.717Z","1.4.0":"2022-08-14T09:25:54.586Z","1.5.0":"2022-08-25T08:58:45.949Z","1.6.0":"2022-09-06T12:59:33.973Z","1.6.1":"2022-09-06T15:01:54.804Z","1.7.0":"2022-09-27T11:58:20.458Z","1.7.1":"2022-09-29T14:02:52.619Z","1.7.2":"2022-09-29T18:08:36.646Z","1.7.3":"2022-09-30T06:57:31.863Z","1.7.4":"2022-09-30T12:27:20.819Z","1.7.5":"2022-09-30T12:52:55.473Z","1.8.0":"2022-10-14T13:03:51.348Z","1.8.1":"2022-10-20T12:05:38.779Z","1.9.0":"2022-11-03T20:04:54.250Z","1.10.0":"2022-12-08T14:55:25.564Z","1.10.1":"2022-12-12T15:19:36.580Z","1.10.3":"2022-12-12T16:24:26.796Z","1.10.4":"2022-12-13T09:47:51.279Z","1.10.5":"2022-12-22T12:12:41.820Z","1.11.0":"2023-01-05T09:04:10.236Z","1.11.1":"2023-01-06T14:34:13.491Z","1.11.2":"2023-01-06T19:34:12.036Z","1.11.3":"2023-01-09T13:27:33.171Z","1.11.4":"2023-01-10T12:36:54.707Z","1.11.5":"2023-01-11T09:25:17.739Z","1.11.6":"2023-01-17T10:06:01.345Z","1.11.7":"2023-01-18T06:05:35.020Z","1.12.0":"2023-01-20T19:29:38.007Z","1.13.0":"2023-01-25T12:09:12.817Z","1.13.1":"2023-01-25T20:01:33.733Z","1.14.0":"2023-01-26T12:07:56.630Z","1.14.1":"2023-01-27T09:58:53.982Z","1.14.2":"2023-02-01T09:32:56.110Z","1.15.0":"2023-02-07T14:03:38.080Z","1.15.1":"2023-02-07T15:06:56.813Z","1.16.0":"2023-02-10T12:55:39.779Z","1.16.1":"2023-02-23T11:07:50.473Z","1.17.0":"2023-03-27T08:16:22.496Z","1.17.1":"2023-04-04T11:17:07.194Z","1.17.2":"2023-04-04T13:38:08.790Z","1.17.3":"2023-04-04T14:23:08.352Z","1.17.4":"2023-04-04T15:03:41.931Z","1.18.0":"2023-04-04T15:40:54.812Z","1.18.1":"2023-04-04T16:06:53.124Z","1.18.2":"2023-04-04T19:19:14.105Z","1.19.0":"2023-04-05T09:38:55.622Z","1.19.1":"2023-04-05T09:57:32.835Z","1.19.2":"2023-04-05T10:40:18.279Z","1.19.3":"2023-04-06T08:54:33.624Z","1.19.4":"2023-04-11T10:15:38.931Z","1.19.5":"2023-04-17T08:22:27.920Z","1.19.6":"2023-04-18T19:12:35.032Z","1.19.7":"2023-04-19T09:41:12.137Z","1.19.8":"2023-04-19T12:31:11.802Z","1.20.0":"2023-06-09T13:29:34.964Z","1.20.1":"2023-06-12T09:02:50.024Z","1.20.2":"2023-06-19T10:06:41.771Z","2.0.0-rc.1":"2023-06-19T10:48:29.468Z","2.0.0-rc.2":"2023-06-20T08:16:20.552Z","2.0.0-rc.3":"2023-06-20T14:00:57.480Z","2.0.0-rc.4":"2023-06-21T19:04:31.147Z","1.21.0":"2023-06-26T11:21:14.859Z","2.0.0-rc.5":"2023-06-27T09:46:25.677Z","2.0.0-rc.6":"2023-06-27T11:47:43.491Z","1.21.1":"2023-06-28T19:33:32.973Z","1.21.2":"2023-06-29T07:01:46.526Z","1.21.3":"2023-06-29T07:06:27.006Z","2.0.0-rc.7":"2023-06-29T09:09:20.098Z","2.0.0-rc.8":"2023-06-29T09:51:40.190Z","2.0.0-rc.9":"2023-06-29T11:38:23.111Z","2.0.0-rc.10":"2023-07-03T20:31:34.592Z","2.0.0-rc.11":"2023-07-04T12:25:41.612Z","2.0.0-rc.12":"2023-07-06T07:36:25.543Z","2.0.0-rc.13":"2023-07-06T12:37:41.237Z","2.0.0-rc.14":"2023-07-09T09:59:11.589Z","1.21.4":"2023-07-09T10:53:25.575Z","1.21.5":"2023-07-11T07:36:27.356Z","2.0.0-rc.15":"2023-07-11T13:07:09.323Z","2.0.0-rc.16":"2023-07-13T11:47:06.205Z","1.21.6":"2023-07-14T15:02:40.852Z","1.21.7":"2023-07-14T15:08:41.957Z","2.0.0-rc.17":"2023-07-14T15:35:06.066Z","1.21.8":"2023-07-18T09:14:34.599Z","2.0.0-rc.18":"2023-07-18T09:31:20.942Z","2.0.0-rc.19":"2023-07-26T09:28:31.614Z","1.21.9":"2023-08-01T14:00:09.368Z","2.0.0-rc.20":"2023-08-16T13:25:07.365Z","2.0.0-rc.21":"2023-08-23T09:12:36.740Z","2.0.0-rc.22":"2023-08-23T10:08:58.140Z","2.0.0-rc.23":"2023-09-17T15:05:27.674Z","2.0.0":"2023-09-20T07:55:21.614Z","3.0.0-rc.1":"2023-09-25T14:33:59.359Z","2.1.0-rc.1":"2023-09-25T20:12:11.053Z","2.1.0-rc.2":"2023-10-09T08:54:12.507Z","2.1.0-rc.3":"2023-10-10T09:50:24.471Z","2.1.0-rc.4":"2023-10-12T07:40:45.588Z","2.1.0":"2023-10-12T12:58:41.009Z","2.1.1-rc.1":"2023-11-09T10:48:03.494Z","2.1.1":"2023-11-10T11:54:10.100Z","2.1.2-rc-sdk.1":"2023-11-21T21:06:30.743Z","2.1.2-rc-sdk.2":"2023-11-22T10:23:15.286Z","2.1.2-metamask-test.0":"2023-12-06T12:31:45.806Z","2.1.2-rc-sdk.3":"2023-12-13T13:43:41.090Z","2.1.2-feature-metamask.0":"2023-12-15T08:34:59.611Z","2.1.2-feature-metamask.1":"2023-12-15T08:53:27.750Z","2.1.2-feature-metamask.2":"2023-12-15T08:54:32.121Z","2.1.2":"2023-12-19T08:44:39.253Z","2.1.2-rc-sdk.4":"2023-12-19T09:39:57.333Z","2.1.2-feature-metamask.3":"2024-01-11T11:56:42.414Z","2.2.0-rc-sdk.1":"2024-01-12T12:12:28.205Z","2.2.0-rc-sdk.2":"2024-01-23T09:46:50.370Z","2.2.0":"2024-01-25T08:15:22.210Z","2.2.0-feature-rpc-method.0":"2024-02-14T11:35:55.439Z","2.2.0-feature-rpc-method.1":"2024-02-16T07:49:59.111Z","2.2.0-feature-rpc-method.2":"2024-02-16T09:00:02.417Z","2.2.1-rpc-types-generation.0":"2024-02-22T10:16:45.177Z","2.2.1-rpc-types-generation.1":"2024-02-22T10:52:30.130Z","2.2.1-rpc-types-generation.2":"2024-02-22T11:06:46.067Z","2.2.1-rpc-types-generation.3":"2024-02-22T12:18:06.114Z","2.2.1-rpc-types-generation.4":"2024-02-23T09:36:06.197Z","2.2.1-chore-update-ci-automation-types.0":"2024-02-26T10:37:57.306Z","2.2.1-chore-update-ci-automation-types.1":"2024-02-26T16:14:17.172Z","2.2.1-chore-update-ci-automation-types.2":"2024-02-26T16:36:16.370Z","2.2.1-feature-l2-side-withdraw.0":"2024-02-28T21:14:02.147Z","2.2.1-feature-rpc-verify-pending-requests.0":"2024-02-29T12:41:08.896Z","2.2.1-feature-rpc-verify-pending-requests.1":"2024-03-01T09:56:11.478Z","2.2.0-feature-metamask.4":"2024-03-01T10:49:37.729Z","2.2.1-feature-limit-number-of-executed-requests.0":"2024-03-04T20:18:59.376Z","2.2.1-eth-rollup-develop.0":"2024-03-05T08:09:13.997Z","2.2.1-feature-rpc-verify-pending-requests.2":"2024-03-05T09:45:58.750Z","2.2.1-eth-rollup-develop.1":"2024-03-05T09:59:34.874Z","2.2.1-eth-rollup-develop.2":"2024-03-05T10:14:51.859Z","2.2.1-eth-rollup-develop.3":"2024-03-05T11:38:36.059Z","2.2.1-eth-rollup-develop.4":"2024-03-05T12:20:59.870Z","2.2.1-0":"2024-03-05T13:45:29.660Z","2.2.1-eth-rollup-develop.5":"2024-03-05T15:49:04.687Z","2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.1":"2024-03-06T13:11:19.093Z","2.2.1-fix-rpc-verify-error.0":"2024-03-06T13:46:31.116Z","2.2.1-fix-rpc-verify-error.1":"2024-03-06T17:09:44.901Z","2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.2":"2024-03-06T20:43:20.811Z","2.2.1-feature-fix-ensure.0":"2024-03-07T12:02:34.696Z","2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.3":"2024-03-07T12:44:55.482Z","2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.4":"2024-03-07T13:59:17.783Z","2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.5":"2024-03-07T14:09:47.838Z","2.2.1-eth-rollup-develop.6":"2024-03-07T14:19:49.707Z","2.2.1-eth-rollup-develop.7":"2024-03-07T14:58:38.251Z","2.2.1-eth-rollup-develop.8":"2024-03-08T12:03:40.875Z","2.2.1-eth-rollup-develop.9":"2024-03-08T12:40:16.170Z","2.2.1-ci-eth-develop-solochain-workflow-updates-MGX-1001-2.6":"2024-03-11T14:44:01.982Z","2.2.1-eth-rollup-develop-solo.0":"2024-03-11T15:12:23.501Z","2.2.1-feature-requests-blockhash.0":"2024-03-12T11:36:13.468Z","2.2.1-feature-multiple-l1.0":"2024-03-13T22:14:51.997Z","2.2.1-feature-multiple-l1.1":"2024-03-14T18:12:48.971Z","2.2.1-eth-rollup-develop-solo.1":"2024-03-14T19:38:44.444Z","2.2.1-eth-rollup-develop-solo.2":"2024-03-14T20:51:34.588Z","2.2.1-eth-rollup-develop-solo.3":"2024-03-14T22:12:18.148Z","2.2.1-eth-rollup-develop.10":"2024-03-15T07:15:34.820Z","2.2.1-eth-rollup-develop.11":"2024-03-15T21:49:43.943Z","2.2.1-feature-multiple-l1.2":"2024-03-18T11:12:17.581Z","2.2.1-feature-multiple-l1.3":"2024-03-18T12:20:56.989Z","2.2.1-ci-fix-fungible-envs-deployments-MGX-944.0":"2024-03-18T15:06:46.069Z","2.2.1-feat-raw-update.0":"2024-03-18T15:21:02.531Z","2.2.1-ci-fix-fungible-envs-deployments-MGX-944.1":"2024-03-18T15:37:31.307Z","2.2.1-feat-raw-update.1":"2024-03-18T17:43:40.226Z","2.2.1-eth-rollup-develop.12":"2024-03-18T20:15:16.871Z","2.2.1-feat-raw-update.2":"2024-03-19T12:19:01.025Z","2.2.1-feat-raw-update.3":"2024-03-20T08:57:48.814Z","2.2.1-feat-raw-update.4":"2024-03-20T10:15:56.032Z","2.2.1-eth-rollup-develop.13":"2024-03-21T07:11:16.807Z","2.2.1-feature-consider-withdrawal-resolutions.0":"2024-03-21T19:08:55.111Z","2.2.1-eth-rollup-develop.14":"2024-03-21T19:23:18.904Z","2.2.1-eth-rollup-develop-solo-seq-mod.0":"2024-03-21T21:00:59.452Z","2.2.1-eth-rollup-develop-solo-acc20.0":"2024-03-23T01:00:34.490Z","2.2.1-eth-rollup-develop-solo-seq-mod.1":"2024-03-24T10:05:42.208Z","2.2.1-fix-storage-hasher.0":"2024-03-25T11:18:21.842Z","2.2.1-eth-rollup-develop-solo-acc20.1":"2024-03-25T11:37:24.473Z","2.2.1-eth-rollup-develop-solo-seq-mod.2":"2024-03-25T22:05:03.490Z","2.2.1-eth-rollup-develop-solo-acc20.2":"2024-03-27T11:05:08.900Z","2.2.1-eth-rollup-develop.15":"2024-03-27T11:19:10.388Z","2.2.1-feature-timestamp.0":"2024-03-27T11:28:40.739Z","2.2.1-feat-chainspec-eigen.1":"2024-03-27T11:38:33.765Z","2.2.1-eth-rollup-develop.16":"2024-03-27T13:18:27.029Z","2.2.1-eth-rollup-develop-solo-seq-mod.3":"2024-03-28T12:02:47.342Z","2.2.1-feat-chainspec-eigen.2":"2024-03-28T13:12:16.598Z","2.2.1-feature-timestamp.1":"2024-03-29T09:42:25.700Z","2.2.1-eth-rollup-develop.17":"2024-03-29T11:33:10.134Z","2.2.1-feature-timestamp.3":"2024-03-29T12:40:09.600Z","2.2.1-revert-714-eth-rollup-develop-solo-seq-mod.0":"2024-04-02T07:24:04.555Z","2.2.1-feature-fix-single-sequencer.0":"2024-04-03T05:45:55.490Z","2.2.1-eth-rollup-develop.18":"2024-04-03T07:08:49.231Z","2.2.1-feature-timestamp.4":"2024-04-03T08:56:58.523Z","2.2.1-eth-rollup-develop.19":"2024-04-03T14:37:25.184Z","2.2.1-eth-rollup-develop.20":"2024-04-04T07:45:38.669Z","2.2.1-feat-chainspec-eigen.3":"2024-04-04T11:16:09.871Z","2.2.1-rollup-feature-stabilize-seq-rotation.0":"2024-04-07T20:45:36.768Z","2.2.1-eth-rollup-develop.21":"2024-04-08T07:42:04.824Z","2.2.1-feature-native-eth.0":"2024-04-08T12:23:09.087Z","2.2.1-eth-rollup-develop.22":"2024-04-08T13:12:09.619Z","2.2.1-feature-fix-compose.0":"2024-04-09T11:48:09.647Z","2.2.1-eth-rollup-develop.23":"2024-04-09T14:38:57.948Z","2.2.1-eth-rollup-develop.24":"2024-04-10T11:55:58.634Z","2.2.1-feat-chainspec-eigen.4":"2024-04-11T12:32:49.436Z","2.2.1-eth-rollup-develop.25":"2024-04-11T12:36:27.642Z","2.2.1-feat-chainspec-eigen.5":"2024-04-11T13:09:26.511Z","2.2.1-feature-testnet-fixes.0":"2024-04-11T17:34:29.783Z","2.2.1-eth-rollup-develop.26":"2024-04-11T18:13:36.161Z","2.2.1-feature-isolated-testing-crowdloan.0":"2024-04-12T07:49:18.521Z","2.2.1-feature-isolated-testing-crowdloan.1":"2024-04-12T08:07:38.064Z","2.2.1-feature-isolated-testing-crowdloan.2":"2024-04-12T08:13:19.276Z","2.2.1-feature-isolated-testing-crowdloan.3":"2024-04-12T08:24:20.772Z","2.2.1-feat-chainspec-eigen.6":"2024-04-12T10:51:20.348Z","2.2.1-feat-chainspec-eigen.7":"2024-04-12T11:48:38.176Z","2.2.1-feature-isolated-testing-crowdloan.4":"2024-04-12T12:02:09.383Z","2.2.1-feature-fix-typo.0":"2024-04-15T08:19:23.196Z","2.2.1-feature-run-ci.0":"2024-04-15T09:17:50.687Z","2.2.1-feature-fix-fail-liqId-maintenance.0":"2024-04-15T10:03:19.232Z","2.2.1-eth-rollup-develop.27":"2024-04-16T07:29:08.712Z","2.2.1-feature-fix-typo.1":"2024-04-16T11:57:46.448Z","2.2.1-feature-fix-typo.2":"2024-04-17T08:08:40.442Z","2.2.1-eth-rollup-develop.28":"2024-04-17T09:53:30.950Z","2.2.1-eth-rollup-develop.29":"2024-04-17T11:27:28.156Z","2.2.1-feature-seq-staking-unit-tests.0":"2024-04-17T20:34:40.971Z","2.2.1-fix-remove-eth-from-genesis.0":"2024-04-17T20:48:37.018Z","2.2.1-eth-rollup-develop.30":"2024-04-22T18:15:48.684Z","2.2.1-feature-rolldown-mm.0":"2024-04-23T11:01:18.724Z","2.2.1-feature-debug-print-call-for-context.0":"2024-04-26T05:35:46.613Z","2.2.1-feature-rolldown-counters.0":"2024-04-26T08:42:53.026Z","2.2.1-feature-mtx-upd-seqgasless-bootstrap.0":"2024-04-26T09:08:23.893Z","2.2.1-eth-rollup-develop.31":"2024-04-26T09:51:44.108Z","2.2.1-eth-rollup-develop.32":"2024-04-26T12:38:03.659Z","2.2.1-feature-ethereum-as-relaychain-for-crowdloans.0":"2024-04-26T18:38:17.378Z","2.2.1-feature-remove-dummy-tokens.0":"2024-04-28T14:43:05.417Z","2.2.1-feature-configurable-chain-id.0":"2024-04-29T07:24:32.233Z","2.2.1-eth-rollup-develop.33":"2024-04-29T07:29:27.265Z","2.2.1-feature-rolldown-mm.1":"2024-04-29T07:44:16.657Z","2.2.1-feat-chainspec-eigen.8":"2024-04-29T07:48:06.643Z","2.2.1-feature-ethereum-as-relaychain-for-crowdloans.1":"2024-04-29T07:57:24.491Z","2.2.1-feature-configurable-chain-id.1":"2024-04-29T08:26:31.851Z","2.2.1-eth-rollup-develop.34":"2024-04-29T08:40:24.350Z","2.2.1-feature-ethereum-as-relaychain-for-crowdloans.2":"2024-04-29T09:00:07.275Z","2.2.1-feat-chainspec-eigen.9":"2024-04-29T10:32:14.830Z","2.2.1-feature-configurable-chain-id.2":"2024-04-29T11:22:17.911Z","2.2.1-feature-rolldown-counters.1":"2024-04-29T11:36:06.817Z","2.2.1-feature-remove-dummy-tokens.1":"2024-04-29T11:39:15.193Z","2.2.1-eth-rollup-develop.35":"2024-04-29T12:11:50.333Z","2.2.1-feature-configurable-chain-id.3":"2024-04-29T12:22:35.177Z","2.2.1-feature-remove-dummy-tokens.2":"2024-04-29T12:31:10.154Z","2.2.1-feat-chainspec-eigen.10":"2024-04-29T12:46:37.353Z","2.2.1-eth-rollup-develop.36":"2024-04-29T13:05:49.727Z","2.2.1-feature-configurable-chain-id.4":"2024-04-29T13:30:17.221Z","2.2.1-eth-rollup-develop.37":"2024-04-29T14:04:08.725Z","2.2.1-feature-rollup-testnet-alignment.0":"2024-04-29T16:32:46.497Z","2.2.1-eth-rollup-develop.38":"2024-04-29T17:08:10.617Z","2.2.1-feature-custom-prometheus-metrics.0":"2024-05-06T07:44:27.846Z","2.2.1-feature-custom-prometheus-metrics.1":"2024-05-06T08:11:57.273Z","2.2.1-feature-ethereum-as-relaychain-for-crowdloans.3":"2024-05-07T15:15:19.226Z","2.2.1-eth-rollup-develop.39":"2024-05-07T15:15:32.684Z","2.2.1-feature-remove-dummy-tokens.3":"2024-05-07T15:16:55.164Z","2.2.1-eth-rollup-develop.40":"2024-05-07T17:10:23.046Z","2.2.1-eth-rollup-develop.41":"2024-05-07T17:15:56.314Z","2.2.1-eth-rollup-develop.42":"2024-05-10T09:00:46.970Z","2.2.1-eth-rollup-develop.43":"2024-05-13T10:01:16.317Z","2.2.1-feature-mm-on-rollup.0":"2024-05-13T10:23:31.457Z","2.2.1-ci-performance-test.0":"2024-05-16T13:03:17.018Z","2.2.1-ci-performance-test.1":"2024-05-16T14:14:14.545Z","2.2.1-ci-performance-test.2":"2024-05-16T16:27:03.346Z","2.2.1-ci-performance-test.3":"2024-05-16T16:42:16.373Z","2.2.1-eth-rollup-develop.44":"2024-05-17T10:53:18.738Z","2.2.1-ci-performance-test.4":"2024-05-17T10:57:03.395Z","2.2.1-ci-performance-test.5":"2024-05-17T15:23:42.511Z","2.2.1-ci-performance-test.6":"2024-05-20T08:32:40.063Z","2.2.1-feature-eth-upd-tests-3rdPartyRewards.0":"2024-05-22T12:00:56.569Z","2.2.1-eth-rollup-develop.45":"2024-05-22T14:53:25.304Z","2.2.1-feature-eth-upd-tests-parAutocompound.0":"2024-05-23T13:12:30.605Z","2.2.1-eth-rollup-develop.46":"2024-05-23T13:28:54.535Z","2.2.1-eth-rollup-develop.47":"2024-05-24T15:40:28.474Z","2.2.1-eth-rollup-develop.48":"2024-05-27T08:06:54.648Z","2.2.1-ci-rollup-wasm-generation-setup-MGX-1094.0":"2024-05-27T16:45:39.026Z","2.2.1-feature-multiple-l1.4":"2024-05-28T12:31:52.426Z","2.2.1-eth-rollup-develop.50":"2024-05-28T15:06:32.853Z","2.2.1-eth-rollup-develop.51":"2024-05-28T15:21:06.511Z","2.2.1-feature-multiple-l1.5":"2024-05-29T06:00:13.622Z","2.2.1-feature-multiple-l1.6":"2024-05-29T06:08:45.665Z","2.2.1-feature-multiple-l1.7":"2024-05-29T06:27:40.576Z","2.2.1-feature-multiple-l1.8":"2024-05-29T06:44:29.797Z","2.2.1-feature-multiple-l1.9":"2024-05-29T12:42:02.257Z","2.2.1-feature-multiple-l1.10":"2024-05-29T13:33:47.445Z","2.2.1-feature-multiple-l1.11":"2024-05-29T13:52:18.769Z","2.2.1-eth-rollup-develop.52":"2024-05-30T14:19:52.343Z","2.2.1-feature-multiple-l1.12":"2024-05-30T14:23:54.936Z","2.2.1-feature-eth-upd-tests-poolLiq.0":"2024-05-30T14:57:37.469Z","2.2.1-feature-multiple-l1.13":"2024-06-03T13:40:58.723Z","2.2.1-feature-eth-upd-tests-parallel.0":"2024-06-03T15:01:35.761Z","2.2.1-feature-eth-upd-tests-parallel.1":"2024-06-04T07:46:07.175Z","2.2.1-feature-eth-upd-tests-parallel.2":"2024-06-04T09:36:13.482Z","2.2.1-feature-multiple-l1.14":"2024-06-05T09:23:13.294Z","2.2.1-eth-rollup-develop.53":"2024-06-05T12:38:18.805Z","2.2.1-feature-eth-upd-tests-parallel.3":"2024-06-05T12:50:57.943Z","2.2.1-eth-rollup-develop.54":"2024-06-05T13:38:37.915Z","2.2.1-feature-eth-upd-tests-parallel.4":"2024-06-05T15:08:03.945Z","2.2.1-feature-eth-upd-tests-parallel.5":"2024-06-06T08:47:29.138Z","2.2.1-feature-mm-on-rollup.1":"2024-06-07T08:20:01.758Z","2.2.1-feature-eth-upd-tests-parallel.6":"2024-06-12T14:16:14.641Z","2.2.1-feature-eth-upd-tests-parallel.7":"2024-06-13T15:49:45.431Z"},"maintainers":[{"name":"matus.balascak","email":"matus.balascak@mangata.finance"},{"name":"mangata.dev","email":"solutions@mangata.finance"}],"author":{"name":"Mangata Finance","email":"solutions@mangata.finance"},"repository":{"url":"git+https://github.com/mangata-finance/mangata-dev-kit.git","type":"git"},"keywords":["mangata","sdk","trading"],"license":"ISC","homepage":"https://github.com/mangata-finance/mangata-dev-kit#readme","bugs":{"url":"https://github.com/mangata-finance/mangata-dev-kit/issues"},"readme":"","readmeFilename":""}