From fc0065a046cd3c8e877ef707a0688ebd40a11628 Mon Sep 17 00:00:00 2001 From: gulcinuras Date: Mon, 20 Mar 2023 15:23:27 +0300 Subject: [PATCH 1/5] chore(package-json): Upgrade the algosdk version as it is conflicting with the perawallet/connect algosdk version in peerDependencies --- package-lock.json | 453 ++++++++++++++-------------------------------- package.json | 2 +- 2 files changed, 134 insertions(+), 321 deletions(-) diff --git a/package-lock.json b/package-lock.json index b2b4758a..7207323a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.0.7", "license": "MIT", "dependencies": { - "algosdk": "^1.20.0", + "algosdk": "^2.1.0", "base64-js": "^1.5.1" }, "devDependencies": { @@ -3145,37 +3145,23 @@ } }, "node_modules/algosdk": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/algosdk/-/algosdk-1.20.0.tgz", - "integrity": "sha512-KKfSIIdQTgdj3rKaYGLu3n16KC5obx0n+6XvlwAhyGxqG1K5bCJ9F1zbblhCE9aKEv+buNR23Lw6hXGQ54PA1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/algosdk/-/algosdk-2.1.0.tgz", + "integrity": "sha512-KogpdRK3u7Efvw0FVduyFQEOwI+uGvMJmXUvzdmQJjK0hWhEYUl13X/X1QqNKwyEZjw2qutf9pf23UbNnBEAwA==", "dependencies": { "algo-msgpack-with-bigint": "^2.1.1", - "buffer": "^6.0.2", + "buffer": "^6.0.3", + "cross-fetch": "^3.1.5", "hi-base32": "^0.5.1", "js-sha256": "^0.9.0", "js-sha3": "^0.8.0", "js-sha512": "^0.8.0", "json-bigint": "^1.0.0", - "superagent": "^6.1.0", "tweetnacl": "^1.0.3", "vlq": "^2.0.4" }, - "optionalDependencies": { - "fsevents": "2.1.2" - } - }, - "node_modules/algosdk/node_modules/fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", - "deprecated": "\"Please update to latest v2.3 or v2.2\"", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=14.0.0" } }, "node_modules/ansi-escapes": { @@ -3288,11 +3274,6 @@ "node": ">=8" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, "node_modules/babel-jest": { "version": "29.4.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.4.1.tgz", @@ -3550,6 +3531,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -3794,17 +3776,6 @@ "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, "node_modules/commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", @@ -3820,11 +3791,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -3846,11 +3812,6 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, - "node_modules/cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" - }, "node_modules/core-js-compat": { "version": "3.25.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.25.0.tgz", @@ -3874,6 +3835,14 @@ "semver": "bin/semver.js" } }, + "node_modules/cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "dependencies": { + "node-fetch": "2.6.7" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -3892,6 +3861,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -3907,7 +3877,8 @@ "node_modules/debug/node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "node_modules/dedent": { "version": "0.7.0", @@ -3946,14 +3917,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -4703,11 +4666,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "node_modules/fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" - }, "node_modules/fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -4823,24 +4781,6 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, - "node_modules/form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==" - }, "node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -4877,7 +4817,8 @@ "node_modules/function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "node_modules/functional-red-black-tree": { "version": "1.0.1", @@ -4907,6 +4848,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -5051,6 +4993,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -5092,6 +5035,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -5238,7 +5182,8 @@ "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "node_modules/inquirer": { "version": "7.3.3", @@ -6727,6 +6672,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "dependencies": { "yallist": "^4.0.0" }, @@ -6791,14 +6737,6 @@ "node": ">= 8" } }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", - "engines": { - "node": ">= 0.6" - } - }, "node_modules/micromatch": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", @@ -6812,36 +6750,6 @@ "node": ">=8.6" } }, - "node_modules/mime": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/mime-db": { - "version": "1.47.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", - "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.30", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", - "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", - "dependencies": { - "mime-db": "1.47.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -6905,6 +6813,25 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -6942,6 +6869,7 @@ "version": "1.12.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7353,17 +7281,6 @@ "node": ">=6" } }, - "node_modules/qs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", - "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -7399,19 +7316,6 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -8205,7 +8109,8 @@ "node_modules/safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "node_modules/safer-buffer": { "version": "2.1.2", @@ -8217,6 +8122,7 @@ "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, "dependencies": { "lru-cache": "^6.0.0" }, @@ -8252,6 +8158,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, "dependencies": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -8371,14 +8278,6 @@ "node": ">=8" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -8515,27 +8414,6 @@ "node": ">=8" } }, - "node_modules/superagent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", - "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", - "dependencies": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.7", - "form-data": "^3.0.0", - "formidable": "^1.2.2", - "methods": "^1.1.2", - "mime": "^2.4.6", - "qs": "^6.9.4", - "readable-stream": "^3.6.0", - "semver": "^7.3.2" - }, - "engines": { - "node": ">= 7.0.0" - } - }, "node_modules/supports-color": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.2.tgz", @@ -8649,6 +8527,11 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "node_modules/tsconfig-paths": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", @@ -8829,11 +8712,6 @@ "punycode": "^2.1.0" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -8868,6 +8746,20 @@ "makeerror": "1.0.12" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -9012,7 +8904,8 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/yaml": { "version": "1.10.2", @@ -11371,29 +11264,20 @@ "integrity": "sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ==" }, "algosdk": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/algosdk/-/algosdk-1.20.0.tgz", - "integrity": "sha512-KKfSIIdQTgdj3rKaYGLu3n16KC5obx0n+6XvlwAhyGxqG1K5bCJ9F1zbblhCE9aKEv+buNR23Lw6hXGQ54PA1A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/algosdk/-/algosdk-2.1.0.tgz", + "integrity": "sha512-KogpdRK3u7Efvw0FVduyFQEOwI+uGvMJmXUvzdmQJjK0hWhEYUl13X/X1QqNKwyEZjw2qutf9pf23UbNnBEAwA==", "requires": { "algo-msgpack-with-bigint": "^2.1.1", - "buffer": "^6.0.2", - "fsevents": "2.1.2", + "buffer": "^6.0.3", + "cross-fetch": "^3.1.5", "hi-base32": "^0.5.1", "js-sha256": "^0.9.0", "js-sha3": "^0.8.0", "js-sha512": "^0.8.0", "json-bigint": "^1.0.0", - "superagent": "^6.1.0", "tweetnacl": "^1.0.3", "vlq": "^2.0.4" - }, - "dependencies": { - "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", - "optional": true - } } }, "ansi-escapes": { @@ -11473,11 +11357,6 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, "babel-jest": { "version": "29.4.1", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.4.1.tgz", @@ -11676,6 +11555,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, "requires": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -11853,14 +11733,6 @@ "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", "dev": true }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, "commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", @@ -11873,11 +11745,6 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", "dev": true }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -11901,11 +11768,6 @@ } } }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" - }, "core-js-compat": { "version": "3.25.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.25.0.tgz", @@ -11924,6 +11786,14 @@ } } }, + "cross-fetch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", + "integrity": "sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==", + "requires": { + "node-fetch": "2.6.7" + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -11939,6 +11809,7 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "requires": { "ms": "2.1.2" }, @@ -11946,7 +11817,8 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true } } }, @@ -11978,11 +11850,6 @@ "object-keys": "^1.1.1" } }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", @@ -12568,11 +12435,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" - }, "fastq": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", @@ -12663,21 +12525,6 @@ "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", "dev": true }, - "form-data": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz", - "integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==" - }, "fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", @@ -12705,7 +12552,8 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true }, "functional-red-black-tree": { "version": "1.0.1", @@ -12729,6 +12577,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "dev": true, "requires": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -12835,6 +12684,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -12863,7 +12713,8 @@ "has-symbols": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true }, "has-tostringtag": { "version": "1.0.0", @@ -12962,7 +12813,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "inquirer": { "version": "7.3.3", @@ -14094,6 +13946,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -14145,11 +13998,6 @@ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", "dev": true }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, "micromatch": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz", @@ -14160,24 +14008,6 @@ "picomatch": "^2.2.3" } }, - "mime": { - "version": "2.5.2", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.2.tgz", - "integrity": "sha512-tqkh47FzKeCPD2PUiPB6pkbMzsCasjxAfC62/Wap5qrUWcb+sFasXUC5I3gYM5iBM8v/Qpn4UK0x+j0iHyFPDg==" - }, - "mime-db": { - "version": "1.47.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz", - "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==" - }, - "mime-types": { - "version": "2.1.30", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz", - "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==", - "requires": { - "mime-db": "1.47.0" - } - }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -14232,6 +14062,14 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + } + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -14262,7 +14100,8 @@ "object-inspect": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", - "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==" + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", + "dev": true }, "object-keys": { "version": "1.1.1", @@ -14546,14 +14385,6 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "qs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", - "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", - "requires": { - "side-channel": "^1.0.4" - } - }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -14575,16 +14406,6 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, "regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -15202,7 +15023,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safer-buffer": { "version": "2.1.2", @@ -15214,6 +15036,7 @@ "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -15237,6 +15060,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, "requires": { "call-bind": "^1.0.0", "get-intrinsic": "^1.0.2", @@ -15330,14 +15154,6 @@ } } }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" - } - }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -15439,24 +15255,6 @@ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, - "superagent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", - "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", - "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.7", - "form-data": "^3.0.0", - "formidable": "^1.2.2", - "methods": "^1.1.2", - "mime": "^2.4.6", - "qs": "^6.9.4", - "readable-stream": "^3.6.0", - "semver": "^7.3.2" - } - }, "supports-color": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.2.tgz", @@ -15539,6 +15337,11 @@ "is-number": "^7.0.0" } }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, "tsconfig-paths": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", @@ -15663,11 +15466,6 @@ "punycode": "^2.1.0" } }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", @@ -15699,6 +15497,20 @@ "makeerror": "1.0.12" } }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -15806,7 +15618,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "yaml": { "version": "1.10.2", diff --git a/package.json b/package.json index ad53719d..aea65314 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "typescript": "^4.8.2" }, "dependencies": { - "algosdk": "^1.20.0", + "algosdk": "^2.1.0", "base64-js": "^1.5.1" }, "lint-staged": { From ec4efa65f76d6c062466eb2446d35da084d84c6d Mon Sep 17 00:00:00 2001 From: gulcinuras Date: Wed, 22 Mar 2023 17:37:30 +0300 Subject: [PATCH 2/5] fix(asset-constants): Add clawback_address prop --- src/util/asset/assetConstants.ts | 3 ++- src/util/asset/assetModels.ts | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/util/asset/assetConstants.ts b/src/util/asset/assetConstants.ts index 824e5b8a..2e6b1d0e 100644 --- a/src/util/asset/assetConstants.ts +++ b/src/util/asset/assetConstants.ts @@ -9,7 +9,8 @@ export const ALGO_ASSET: TinymanAnalyticsApiAsset = { decimals: 6, url: "https://algorand.org", is_liquidity_token: false, - total_amount: "6615503326932151" + total_amount: "6615503326932151", + clawback_address: "" }; export const POOL_TOKEN_UNIT_NAME = { diff --git a/src/util/asset/assetModels.ts b/src/util/asset/assetModels.ts index 385836a5..67414946 100644 --- a/src/util/asset/assetModels.ts +++ b/src/util/asset/assetModels.ts @@ -16,6 +16,7 @@ export interface TinymanAnalyticsApiAsset { liquidity_in_usd?: null | string; last_day_volume_in_usd?: null | string; last_day_price_change?: null | string; + clawback_address: string; } export interface IndexerAssetInformation { From 4ccf5429ae13f906f10d3392fbee7d98c41f1b8d Mon Sep 17 00:00:00 2001 From: gulcinuras Date: Wed, 22 Mar 2023 20:45:11 +0300 Subject: [PATCH 3/5] style(asset-models): Put clawback_address before optional properties --- src/util/asset/assetModels.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/asset/assetModels.ts b/src/util/asset/assetModels.ts index 67414946..4eebcde1 100644 --- a/src/util/asset/assetModels.ts +++ b/src/util/asset/assetModels.ts @@ -13,10 +13,10 @@ export interface TinymanAnalyticsApiAsset { decimals: number; url: string; total_amount: string; + clawback_address: string; liquidity_in_usd?: null | string; last_day_volume_in_usd?: null | string; last_day_price_change?: null | string; - clawback_address: string; } export interface IndexerAssetInformation { From fe6569339159240c547fd2a18e232c7c0667f40b Mon Sep 17 00:00:00 2001 From: Cem KIRAY Date: Thu, 23 Mar 2023 09:24:11 +0100 Subject: [PATCH 4/5] chore: bump up package version and get build --- dist/index.js | 2 +- dist/util/asset/assetModels.d.ts | 1 + package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index efb1c611..aefb904e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,3 +1,3 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("algosdk"),e=require("base64-js");function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var r=n(t),s=Uint8Array.from([1]);function a(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function o(t){for(var e=1;e=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var i=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(i&&u){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var s=r.arg;_(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:D(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function u(t,e,n,r,s,a,o){try{var i=t[a](o),u=i.value}catch(t){return void n(t)}i.done?e(u):Promise.resolve(u).then(r,s)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var a=t.apply(e,n);function o(t){u(a,r,s,o,i,"next",t)}function i(t){u(a,r,s,o,i,"throw",t)}o(void 0)}))}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,i=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){i=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw a}}}}var E="- would result negative",S="logic eval error:",N="exceeds schema integer count",O=/transaction \w+:/,P=function(t){m(n,h(Error));var e=v(n);function n(t,r){var s;p(this,n);for(var a=arguments.length,o=new Array(a>2?a-2:0),i=2;i1||e<0)throw new Error("Invalid slippage value. Must be between 0 and 1, got ".concat(e));var r;try{var s="negative"===t?1-e:1+e;r=BigInt(Math.floor(Number(n)*s))}catch(t){throw new Error(t.message)}return r}function G(t,e){var n=Number(t);return W({decimalPlaces:n},Math.pow(10,-n)*Number(e))}function q(t,e){return W({decimalPlaces:0},Math.pow(10,Number(t))*Number(e))}function W(t,e){var n=t.decimalPlaces,r=void 0===n?0:n;if(r>0){var s=y(J(e),2),a=s[0],o=s[1],i=y(J(Math.round(Number(z(a,o+r)))),2),u=i[0],c=i[1];return Number(z(u,c-r))}return Math.round(e)}function z(t,e){return t+(e<0?"e".concat(e):"e+".concat(e))}function J(t){if(t.toString().includes("e")){var e=t.toString().split("e");return[parseFloat(e[0]),parseFloat(e[1])]}return[t,0]}function Y(t,e){return K.apply(this,arguments)}function K(){return(K=c(i().mark((function t(e,n){var r,s,a,o,u,c,p,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,r=[],s=b(n),t.prev=3,s.s();case 5:if((a=s.n()).done){t.next=18;break}return o=a.value,t.next=9,e.sendRawTransaction(o).do();case 9:return u=t.sent,c=u.txId,t.next=13,j(e,c);case 13:p=t.sent,l=p["confirmed-round"],r.push({confirmedRound:l,txnID:c});case 16:t.next=5;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(3),s.e(t.t0);case 23:return t.prev=23,s.f(),t.finish(23);case 26:return t.abrupt("return",r);case 29:throw t.prev=29,t.t1=t.catch(0),new P(t.t1,"We encountered an error while processing this transaction. Try again later.");case 32:case"end":return t.stop()}}),t,null,[[0,29],[3,20,23,26]])})))).apply(this,arguments)}function H(t){return t.reduce((function(t,e){return t+e.txn.fee}),0)}function Z(t){return(e=t[0].txn.group)?Buffer.from(e).toString("base64"):"";var e}function $(t){for(var e=[];;){var n=127&t;if(!(t>>=7)){e.push(n);break}e.push(128|n)}return e}function tt(t){return(new TextEncoder).encode(t)}var et={id:"".concat(0),name:"Algorand",unit_name:"ALGO",decimals:6,url:"https://algorand.org",is_liquidity_token:!1,total_amount:"6615503326932151"},nt={V1:"TM1POOL",V1_1:"TMPOOL11",V2:"TMPOOL2"};function rt(){return(rt=c(i().mark((function t(e){var n,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.assetID,a=e.initiatorAddr,t.prev=1,t.next=4,n.getTransactionParams().do();case 4:return o=t.sent,u=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:a,to:a,assetIndex:s,amount:0,suggestedParams:o}),t.abrupt("return",[{txn:u,signers:[a]}]);case 9:throw t.prev=9,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while opting into this asset. Try again later.");case 12:case"end":return t.stop()}}),t,null,[[1,9]])})))).apply(this,arguments)}function st(t,e){var n=Number(t.id),r=Number(e.id);return n>r?[o(o({},t),{},{id:n}),o(o({},e),{},{id:r})]:[o(o({},e),{},{id:r}),o(o({},t),{},{id:n})]}function at(t,e){var n=[t,e];return[Math.max.apply(Math,n),Math.min.apply(Math,n)]}function ot(t){return 0===Number(t)}var it,ut={V1_1:"v1_1",V2:"v2"},ct={type:"logicsig",logic:{bytecode:"BCAIAQCBgICAgICAgPABgICAgICAgIDwAQMEBQYlJA1EMQkyAxJEMRUyAxJEMSAyAxJEMgQiDUQzAQAxABJEMwEQIQcSRDMBGIGCgICAgICAgPABEkQzARkiEjMBGyEEEhA3ARoAgAlib290c3RyYXASEEAAXDMBGSMSRDMBG4ECEjcBGgCABHN3YXASEEACOzMBGyISRDcBGgCABG1pbnQSQAE7NwEaAIAEYnVybhJAAZg3ARoAgAZyZWRlZW0SQAJbNwEaAIAEZmVlcxJAAnkAIQYhBSQjEk0yBBJENwEaARclEjcBGgIXJBIQRDMCADEAEkQzAhAhBBJEMwIhIxJEMwIiIxwSRDMCIyEHEkQzAiQjEkQzAiWACFRNUE9PTDExEkQzAiZRAA+AD1RpbnltYW5Qb29sMS4xIBJEMwIngBNodHRwczovL3RpbnltYW4ub3JnEkQzAikyAxJEMwIqMgMSRDMCKzIDEkQzAiwyAxJEMwMAMQASRDMDECEFEkQzAxElEkQzAxQxABJEMwMSIxJEJCMTQAAQMwEBMwIBCDMDAQg1AUIBsTMEADEAEkQzBBAhBRJEMwQRJBJEMwQUMQASRDMEEiMSRDMBATMCAQgzAwEIMwQBCDUBQgF8MgQhBhJENwEcATEAE0Q3ARwBMwQUEkQzAgAxABNEMwIUMQASRDMDADMCABJEMwIRJRJEMwMUMwMHMwMQIhJNMQASRDMDESMzAxAiEk0kEkQzBAAxABJEMwQUMwIAEkQzAQEzBAEINQFCAREyBCEGEkQ3ARwBMQATRDcBHAEzAhQSRDMDFDMDBzMDECISTTcBHAESRDMCADEAEkQzAhQzBAASRDMCESUSRDMDADEAEkQzAxQzAwczAxAiEk0zBAASRDMDESMzAxAiEk0kEkQzBAAxABNEMwQUMQASRDMBATMCAQgzAwEINQFCAJAyBCEFEkQ3ARwBMQATRDMCADcBHAESRDMCADEAE0QzAwAxABJEMwIUMwIHMwIQIhJNMQASRDMDFDMDBzMDECISTTMCABJEMwEBMwMBCDUBQgA+MgQhBBJENwEcATEAE0QzAhQzAgczAhAiEk03ARwBEkQzAQEzAgEINQFCABIyBCEEEkQzAQEzAgEINQFCAAAzAAAxABNEMwAHMQASRDMACDQBD0M=",address:"ABUKAXTANWR6K6ZYV75DWJEPVWWOU6SFUVRI6QHO44E4SIDLHBTD2CZ64A",size:881,variables:[{name:"TMPL_ASSET_ID_1",type:"int",index:15,length:10},{name:"TMPL_ASSET_ID_2",type:"int",index:5,length:10},{name:"TMPL_VALIDATOR_APP_ID",type:"int",index:74,length:10}],source:"https://github.com/tinymanorg/tinyman-contracts-v1/tree/dc9ab40c58b85c15d58f63a1507e18be76720dbb/contracts/pool_logicsig.teal.tmpl"},name:"pool_logicsig"},pt={type:"app",global_state_schema:{num_uints:0,num_byte_slices:0},local_state_schema:{num_uints:16,num_byte_slices:0},name:"validator_app"},lt=new(function(){function t(){p(this,t),this.clientName="tinyman-js-sdk"}return d(t,[{key:"getClientName",value:function(){return this.clientName}},{key:"setClientName",value:function(t){this.clientName=t}},{key:"getAppCallTxnNoteWithClientName",value:function(t){return tt("tinyman/".concat(t===ut.V1_1?"v1":t,':j{"origin":"').concat(this.clientName,'"}'))}}]),t}()),dt=(f(it={},ut.V1_1,{testnet:62368684,mainnet:552635992}),f(it,ut.V2,{testnet:148607e3,mainnet:1002541853}),it);function ft(t,e){var n=dt[e][t];if(!n)throw new Error("No Validator App exists for ".concat(t," network with ").concat(e," contract version"));return n}function mt(){return(mt=c(i().mark((function t(e){var n,s,a,o,u,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.network,a=e.contractVersion,o=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return u=t.sent,c=r.default.makeApplicationOptInTxnFromObject({from:o,appIndex:ft(s,a),note:lt.getAppCallTxnNoteWithClientName(a),suggestedParams:u}),t.abrupt("return",[{txn:c,signers:[o]}]);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gt(){return(gt=c(i().mark((function t(e){var n,s,a,o,u,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.network,a=e.contractVersion,o=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return u=t.sent,c=r.default.makeApplicationClearStateTxnFromObject({from:o,appIndex:ft(s,a),note:lt.getAppCallTxnNoteWithClientName(a),suggestedParams:u}),t.abrupt("return",[{txn:c,signers:[o]}]);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var It=d((function t(e){p(this,t),this.schema={numLocalInts:e.local_state_schema.num_uints,numLocalByteSlices:e.local_state_schema.num_byte_slices,numGlobalInts:e.global_state_schema.num_uints,numGlobalByteSlices:e.global_state_schema.num_byte_slices}})),At=new(function(n){m(s,It);var r=v(s);function s(t,e){var n;return p(this,s),(n=r.call(this,t)).poolLogicSigContractTemplate=e.logic.bytecode,n.templateVariables=e.logic.variables,n}return d(s,[{key:"generateLogicSigAccountForPool",value:function(n){if(n.asset1ID===n.asset2ID)throw new Error("Assets are the same");var r=ft(n.network,ut.V1_1),s=y(at(n.asset1ID,n.asset2ID),2),a=s[0],o=s[1],i=Array.from(e.toByteArray(this.poolLogicSigContractTemplate)),u={asset_id_1:a,asset_id_2:o,validator_app_id:r},c=0;this.templateVariables.sort((function(t,e){return t.index-e.index}));for(var p=0;p2&&void 0!==arguments[2]?arguments[2]:t.IntDecoding.DEFAULT;return new Promise(function(){var t=c(i().mark((function t(s,a){var u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.accountInformation(n).setIntDecoding(r).do();case 3:u=t.sent,s(o(o({},u),{},{minimum_required_balance:wt(u)})),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),a(new Error(t.t0.message||"Failed to fetch account information"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,n){return t.apply(this,arguments)}}())}function _t(t,e){var n=t["apps-local-state"].find((function(t){return t.id===e}));return n?k({stateArray:n["key-value"],shouldDecodeKeys:!0}):null}function wt(t){var e=t["apps-total-schema"];return 1e5+1e5*(t.assets||[]).length+1e5*(t["created-apps"]||[]).length+1e5*(t["apps-local-state"]||[]).length+5e4*Number(e&&e["num-byte-slice"]||0)+28500*Number(e&&e["num-uint"]||0)+1e5*(t["apps-total-extra-pages"]||0)}var Dt,bt,Et=tt("e");function St(t){return Nt.apply(this,arguments)}function Nt(){return(Nt=c(i().mark((function n(s){var a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,y,_,w,D,E;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=s.client,o=s.pool,u=s.accountAddr,n.next=3,a.accountInformation(u).setIntDecoding(t.IntDecoding.BIGINT).do();case 3:c=n.sent,p=c["apps-local-state"]||[],l=0n,d=0n,f=0n,m=o.account.address(),g=b(p),n.prev=10,g.s();case 12:if((I=g.n()).done){n.next=31;break}if((A=I.value).id==o.validatorAppID){n.next=16;break}return n.abrupt("continue",29);case 16:if(x=A["key-value"]){n.next=19;break}return n.abrupt("break",31);case 19:h=k({stateArray:x}),T=e.fromByteArray(L([r.default.decodeAddress(m).publicKey,Et,r.default.encodeUint64(o.asset1ID)])),v=e.fromByteArray(L([r.default.decodeAddress(m).publicKey,Et,r.default.encodeUint64(o.asset2ID)])),y=e.fromByteArray(L([r.default.decodeAddress(m).publicKey,Et,r.default.encodeUint64(o.poolTokenID)])),_=h[T],w=h[v],D=h[y],"bigint"==typeof _&&(l=_),"bigint"==typeof w&&(d=w),"bigint"==typeof D&&(f=D);case 29:n.next=12;break;case 31:n.next=36;break;case 33:n.prev=33,n.t0=n.catch(10),g.e(n.t0);case 36:return n.prev=36,g.f(),n.finish(36);case 39:if(!((E={excessAsset1:l,excessAsset2:d,excessPoolTokens:f}).excessAsset1<0n||E.excessAsset2<0n||E.excessPoolTokens<0n)){n.next=42;break}throw new Error("Invalid account excess: ".concat(E));case 42:return n.abrupt("return",E);case 43:case"end":return n.stop()}}),n,null,[[10,33,36,39]])})))).apply(this,arguments)}function Ot(){return(Ot=c(i().mark((function n(s){var a,o,u,c,p,l,d,f,m,g,I,A,x,h,T;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=s.client,o=s.accountAddr,u=s.validatorAppID,n.next=3,a.accountInformation(o).setIntDecoding(t.IntDecoding.BIGINT).do();case 3:if(c=n.sent,p=c["apps-local-state"]||[],l=p.find((function(t){return t.id==u})),d=[],l&&l["key-value"])for(f=k({stateArray:l["key-value"]}),m=0,g=Object.entries(f);mLt)){n.next=48;break}throw new Error("Issued liquidity value is out of the expected range ([0n, ".concat(Lt,"]): ").concat(B.issuedLiquidity));case 48:return n.abrupt("return",B);case 49:case"end":return n.stop()}}),n,null,[[8,31,34,37]])})))).apply(this,arguments)}function Mt(){return Mt=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,r=e.address,s=e.network,!(a=d.length>1&&void 0!==d[1]?d[1]:{})[r]){t.next=4;break}return t.abrupt("return",a[r]);case 4:return t.next=6,yt(n,r);case 6:return o=t.sent,u=_t(o,ft(s,ut.V1_1)),c=null,u&&(l=o["created-assets"][0],p=l.index,c={asset1ID:u[Pt[ut.V1_1].asset1],asset2ID:u[Pt[ut.V1_1].asset2],poolTokenID:p},a[r]=c),t.abrupt("return",c);case 11:case"end":return t.stop()}}),t)}))),Mt.apply(this,arguments)}var Ct=Object.freeze({__proto__:null,getPoolInfo:Ft,getPoolReserves:function(t,e){return Rt.apply(this,arguments)},getPoolAssets:function(t){return Mt.apply(this,arguments)}});function Vt(t){return Xt.apply(this,arguments)}function Xt(){return(Xt=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.network,s=e.asset1ID,a=e.asset2ID,o=vt(ut.V2),u=o.generateLogicSigAccountForPool(e),c=ft(r,ut.V2),p=u.address(),l=at(s,a),t.next=8,yt(n,p);case 8:return d=t.sent,f=_t(d,c),m={account:u,validatorAppID:c,asset1ID:l[0],asset2ID:l[1],status:f?exports.PoolStatus.READY:exports.PoolStatus.NOT_CREATED,contractVersion:ut.V2},f&&(m.asset1ProtocolFees=BigInt(f[Pt.v2.asset1ProtocolFees]),m.asset2ProtocolFees=BigInt(f[Pt.v2.asset2ProtocolFees]),m.asset1Reserves=BigInt(f[Pt.v2.asset1Reserves]),m.asset2Reserves=BigInt(f[Pt.v2.asset2Reserves]),m.issuedPoolTokens=BigInt(f[Pt.v2.issuedPoolTokens]),m.cumulativePriceUpdateTimeStamp=Number(f[Pt.v2.cumulativePriceUpdateTimeStamp]),m.protocolFeeRatio=Number(f[Pt.v2.protocolFeeRatio]),m.totalFeeShare=BigInt(f[Pt.v2.totalFeeShare]),m.poolTokenID=Number(f[Pt.v2.poolTokenID]),m.asset1ID=Number(f[Pt.v2.asset1]),m.asset2ID=Number(f[Pt.v2.asset2])),t.abrupt("return",m);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function jt(){return(jt=c(i().mark((function t(e,n){var r,s,a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,yt(e,n.account.address());case 2:return r=t.sent,s=_t(r,n.validatorAppID),a={asset1:0n,asset2:0n,issuedLiquidity:0n,round:r.round},s&&(a.asset1=BigInt(s[Pt.v2.asset1Reserves]),a.asset2=BigInt(s[Pt.v2.asset2Reserves]),a.issuedLiquidity=BigInt(s[Pt.v2.issuedPoolTokens])),t.abrupt("return",a);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Qt(){return(Qt=c(i().mark((function t(e){var n,r,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.address,s=e.network,t.next=3,yt(n,r);case 3:return a=t.sent,o=_t(a,ft(s,ut.V2)),u=null,o&&(u={asset1ID:o[Pt[ut.V2].asset1],asset2ID:o[Pt[ut.V2].asset2],poolTokenID:o[Pt[ut.V2].poolTokenID]}),t.abrupt("return",u);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ut=Object.freeze({__proto__:null,getPoolInfo:Vt,getPoolReserves:function(t,e){return jt.apply(this,arguments)},getPoolAssets:function(t){return Qt.apply(this,arguments)}});function Gt(t){return Boolean(t&&!(t.asset1+t.asset2))}var qt,Wt,zt=Object.freeze({__proto__:null,getPoolShare:function(t,e){var n=Number(e)/Number(t);return Number.isFinite(n)||(n=0),n},getPoolPairRatio:function(t,e){var n=Gt(e),r=null;return e&&!n&&e.asset1&&e.asset2&&"number"==typeof t.asset2&&"number"==typeof t.asset1&&(r=G(t.asset1,e.asset1)/G(t.asset2,e.asset2)),r},isPoolEmpty:Gt,isPoolNotCreated:function(t){return(null==t?void 0:t.status)===exports.PoolStatus.NOT_CREATED},isPoolReady:function(t){return(null==t?void 0:t.status)===exports.PoolStatus.READY},getPoolsForPair:function(t){return Promise.all([Ft(t),Vt(t)])}}),Jt=o((f(qt={},ut.V1_1,o(o({},Ct),zt)),f(qt,ut.V2,o(o({},Ut),zt)),qt),zt);!function(t){t[t.FUNDING_TXN=0]="FUNDING_TXN",t[t.VALIDATOR_APP_CALL=1]="VALIDATOR_APP_CALL",t[t.POOL_TOKEN_CREATE=2]="POOL_TOKEN_CREATE",t[t.ASSET1_OPT_IN=3]="ASSET1_OPT_IN",t[t.ASSET2_OPT_IN=4]="ASSET2_OPT_IN"}(Wt||(Wt={}));var Yt=96e4,Kt=859e3;function Ht(){return(Ht=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,_,w,D,b,E,S,N;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.network,a=e.asset_1,o=e.asset_2,u=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return c=t.sent,p=st(a,o),l=y(p,2),d=l[0],f=d.id,m=d.unit_name,g=l[1],I=g.id,A=g.unit_name,x=ot(I),h=ft(s,ut.V1_1),T=At.generateLogicSigAccountForPool({network:s,asset1ID:f,asset2ID:I}),v=T.address(),_=r.default.makeApplicationOptInTxnFromObject({from:v,appIndex:h,note:lt.getAppCallTxnNoteWithClientName(ut.V1_1),appArgs:[tt("bootstrap"),r.default.encodeUint64(f),r.default.encodeUint64(I)],foreignAssets:x?[f]:[I],suggestedParams:c}),w=r.default.makeAssetCreateTxnWithSuggestedParamsFromObject({from:v,total:0xffffffffffffffffn,decimals:6,defaultFrozen:!1,unitName:nt.V1_1,assetName:"TinymanPool1.1 ".concat(m,"-").concat(A),assetURL:"https://tinyman.org",suggestedParams:c}),D=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:v,to:v,assetIndex:f,amount:0,suggestedParams:c}),b=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:u,to:v,amount:Zt(x),suggestedParams:c}),(E=[])[Wt.FUNDING_TXN]=b,E[Wt.VALIDATOR_APP_CALL]=_,E[Wt.POOL_TOKEN_CREATE]=w,E[Wt.ASSET1_OPT_IN]=D,x||(E[Wt.ASSET2_OPT_IN]=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:v,to:v,assetIndex:I,amount:0,suggestedParams:c})),S=r.default.assignGroupID(E),N=[{txn:S[Wt.FUNDING_TXN],signers:[u]},{txn:S[Wt.VALIDATOR_APP_CALL],signers:[v]},{txn:S[Wt.POOL_TOKEN_CREATE],signers:[v]},{txn:S[Wt.ASSET1_OPT_IN],signers:[v]}],S[Wt.ASSET2_OPT_IN]&&N.push({txn:S[Wt.ASSET2_OPT_IN],signers:[v]}),t.abrupt("return",N);case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zt(t){return t?Yt:Kt}function $t(){return($t=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.txGroup,s=e.network,a=e.initiatorSigner,o=e.asset1ID,u=e.asset2ID,t.next=3,a([n]);case 3:return c=t.sent,p=y(c,1),l=p[0],d=at(o,u),f=y(d,2),m=f[0],g=f[1],I=At.generateLogicSigAccountForPool({network:s,asset1ID:m,asset2ID:g}),A=[],x=n.map((function(t,e){if(e===Wt.FUNDING_TXN)return A.push(t.txn.txID().toString()),l;var n=r.default.signLogicSigTransactionObject(t.txn,I),s=n.txID,a=n.blob;return A.push(s),a})),t.abrupt("return",{signedTxns:x,txnIDs:A});case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function te(t){return ee.apply(this,arguments)}function ee(){return(ee=c(i().mark((function t(e){var n,r,s,a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.signedTxns,s=e.txnIDs,t.prev=1,t.next=4,n.sendRawTransaction(r).do();case 4:return t.next=6,j(n,s[Wt.POOL_TOKEN_CREATE]);case 6:if(a=t.sent,"number"==typeof(o=a["asset-index"])){t.next=10;break}throw new Error("Generated ID is not valid: got ".concat(o));case 10:return t.abrupt("return",{poolTokenID:o});case 13:throw t.prev=13,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while bootstraping the pool. Try again later.");case 16:case"end":return t.stop()}}),t,null,[[1,13]])})))).apply(this,arguments)}function ne(){return(ne=c(i().mark((function t(e){var n,r,s,a,o,u,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.network,s=e.pool,a=s.asset1ID,o=s.asset2ID,u=e.signedTxns,c=e.txnIDs,t.next=3,te({client:n,signedTxns:u,txnIDs:c});case 3:return t.abrupt("return",Jt.v1_1.getPoolInfo({client:n,network:r,asset1ID:a,asset2ID:o}));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var re,se={generateTxns:function(t){return Ht.apply(this,arguments)},signTxns:function(t){return $t.apply(this,arguments)},execute:function(t){return ne.apply(this,arguments)},getBootstrapFundingTxnAmount:Zt};!function(t){t[t.FUNDING_TXN=0]="FUNDING_TXN",t[t.VALIDATOR_APP_CALL=1]="VALIDATOR_APP_CALL"}(re||(re={}));var ae=5,oe=6;function ie(t,e){return ue.apply(this,arguments)}function ue(){return(ue=c(i().mark((function e(n,r){var s,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(a=null===(s=r.find((function(t){return"appl"===t.txn.type})))||void 0===s?void 0:s.txn.txID())){e.next=7;break}return e.next=4,t.waitForConfirmation(n,a,1e3);case 4:e.t0=e.sent,e.next=8;break;case 7:e.t0=void 0;case 8:return o=e.t0,e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ce(t,e){return pe.apply(this,arguments)}function pe(){return(pe=c(i().mark((function t(e,n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ie(e,n);case 2:return r=t.sent,t.abrupt("return",null==r?void 0:r["inner-txns"]);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function le(){return(le=c(i().mark((function e(n){var s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,_,w,D;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.client,a=n.network,o=n.asset_1,u=n.asset_2,c=n.initiatorAddr,e.next=3,s.getTransactionParams().do();case 3:return p=e.sent,l=ft(a,ut.V2),d=t.getApplicationAddress(l),f=st(o,u),m=y(f,2),g=m[0].id,I=m[1].id,e.next=9,Jt.v2.getPoolInfo({client:s,network:a,asset1ID:g,asset2ID:I});case 9:if(e.sent.status!==exports.PoolStatus.READY){e.next=12;break}throw new Error("Pool for ".concat(o.unit_name,"-").concat(u.unit_name," already exists"));case 12:return A=Tt.generateLogicSigAccountForPool({network:a,asset1ID:g,asset2ID:I}),x=A.address(),h=ot(I),(T=r.default.makeApplicationOptInTxnFromObject({from:x,appIndex:l,appArgs:[tt("bootstrap")],note:lt.getAppCallTxnNoteWithClientName(ut.V2),foreignAssets:[g,I],rekeyTo:d,suggestedParams:p})).fee=fe(h),v=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:c,to:x,amount:de(h),suggestedParams:p}),(_=[])[re.FUNDING_TXN]=v,_[re.VALIDATOR_APP_CALL]=T,w=r.default.assignGroupID(_),(D=[])[re.FUNDING_TXN]={txn:w[re.FUNDING_TXN],signers:[c]},D[re.VALIDATOR_APP_CALL]={txn:w[re.VALIDATOR_APP_CALL],signers:[x]},e.abrupt("return",D);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function de(t){return function(t,e){var n=vt(t).schema,r=4e5+28500*n.numLocalInts+5e4*n.numLocalByteSlices;return e||(r+=1e5),r}(ut.V2,t)+fe(t)+1e5}function fe(e){return((e?ae:oe)+1)*t.ALGORAND_MIN_TX_FEE}function me(){return(me=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.txGroup,s=e.network,a=e.initiatorSigner,o=e.asset1ID,u=e.asset2ID,t.next=3,a([n]);case 3:return c=t.sent,p=y(c,1),l=p[0],d=at(o,u),f=y(d,2),m=f[0],g=f[1],I=Tt.generateLogicSigAccountForPool({network:s,asset1ID:m,asset2ID:g}),A=[],x=n.map((function(t,e){if(e===re.FUNDING_TXN)return A.push(t.txn.txID().toString()),l;var n=r.default.signLogicSigTransactionObject(t.txn,I),s=n.txID,a=n.blob;return A.push(s),a})),t.abrupt("return",{signedTxns:x,txnIDs:A});case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ge(){return(ge=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.network,s=e.pool,a=s.asset1ID,o=s.asset2ID,u=e.txGroup,c=e.signedTxns,t.prev=1,t.next=4,n.sendRawTransaction(c).do();case 4:return t.next=6,ie(n,u);case 6:if(t.t1=p=t.sent,t.t0=null===t.t1,t.t0){t.next=10;break}t.t0=void 0===p;case 10:if(!t.t0){t.next=14;break}t.t2=void 0,t.next=15;break;case 14:t.t2=null===(l=p["local-state-delta"][0].delta)||void 0===l||null===(d=l.find((function(t){return t.key===btoa(Pt.v2.poolTokenID)})))||void 0===d?void 0:d.value.uint;case 15:if("number"==typeof(f=t.t2)){t.next=18;break}throw new Error("Generated ID is not valid: got ".concat(f));case 18:return t.abrupt("return",Jt.v2.getPoolInfo({client:n,network:r,asset1ID:a,asset2ID:o}));case 21:throw t.prev=21,t.t3=t.catch(1),new P(t.t3,"We encountered something unexpected while bootstraping the pool. Try again later.");case 24:case"end":return t.stop()}}),t,null,[[1,21]])})))).apply(this,arguments)}var Ie,Ae={generateTxns:function(t){return le.apply(this,arguments)},signTxns:function(t){return me.apply(this,arguments)},execute:function(t){return ge.apply(this,arguments)},getBootstrapFundingTxnAmount:de,getTotalCost:function(e){return t.ALGORAND_MIN_TX_FEE+de(e)}};var xe,he=(f(Ie={},ut.V1_1,se),f(Ie,ut.V2,Ae),f(Ie,"generateTxns",(function(t){return t.contractVersion===ut.V1_1?se.generateTxns(t):Ae.generateTxns(t)})),f(Ie,"signTxns",(function(t){return t.contractVersion===ut.V1_1?se.signTxns(t):Ae.signTxns(t)})),f(Ie,"execute",(function(t){return t.contractVersion===ut.V1_1?se.execute(t):Ae.execute(t)})),f(Ie,"calculateBootstrapFundingTxnAmount",(function(t){var e=t.contractVersion,n=t.isAlgoPool;return e===ut.V1_1?se.getBootstrapFundingTxnAmount(n):Ae.getBootstrapFundingTxnAmount(n)})),Ie);exports.V1_1AddLiquidityTxnIndices=void 0,(xe=exports.V1_1AddLiquidityTxnIndices||(exports.V1_1AddLiquidityTxnIndices={}))[xe.FEE_TXN=0]="FEE_TXN",xe[xe.VALIDATOR_APP_CALL_TXN=1]="VALIDATOR_APP_CALL_TXN",xe[xe.ASSET1_IN_TXN=2]="ASSET1_IN_TXN",xe[xe.ASSET2_IN_TXN=3]="ASSET2_IN_TXN",xe[xe.LIQUDITY_OUT_TXN=4]="LIQUDITY_OUT_TXN";var Te,ve,ye,_e,we=5*t.ALGORAND_MIN_TX_FEE;exports.V2AddLiquidityType=void 0,(_e=exports.V2AddLiquidityType||(exports.V2AddLiquidityType={})).SINGLE="single",_e.FLEXIBLE="flexible",_e.INITIAL="initial";var De,be=(f(Te={},exports.V2AddLiquidityType.FLEXIBLE,{ASSET1_IN_TXN:0,ASSET2_IN_TXN:1,VALIDATOR_APP_CALL_TXN:2}),f(Te,exports.V2AddLiquidityType.SINGLE,{ASSET_IN_TXN:0,VALIDATOR_APP_CALL_TXN:1}),f(Te,exports.V2AddLiquidityType.INITIAL,{ASSET1_IN_TXN:0,ASSET2_IN_TXN:1,VALIDATOR_APP_CALL_TXN:2}),Te),Ee=(f(ve={},exports.V2AddLiquidityType.INITIAL,1),f(ve,exports.V2AddLiquidityType.SINGLE,2),f(ve,exports.V2AddLiquidityType.FLEXIBLE,2),ve),Se=(f(ye={},exports.V2AddLiquidityType.INITIAL,3),f(ye,exports.V2AddLiquidityType.FLEXIBLE,3),f(ye,exports.V2AddLiquidityType.SINGLE,2),ye);function Ne(t){var e=t.assetIn,n=t.assetOut;return G(n.decimals,Number(n.amount))/G(e.decimals,Number(e.amount))}function Oe(t){var e=t.inputSupply,n=t.outputSupply,r=t.assetIn,s=t.assetOut,a=Ne({assetIn:r,assetOut:s}),o=G(s.decimals,Number(n))/G(r.decimals,Number(e));return W({decimalPlaces:5},Math.abs(a/o-1))}function Pe(t){var e,n,r,s=t.reserves,a=t.totalFeeShare,o=t.asset1,i=t.asset2,u=s.asset1*s.asset2,c=s.asset1+BigInt(o.amount),p=s.asset2+BigInt(i.amount),l=c*p,d=BigInt(parseInt(String(Math.sqrt(Number(l*s.issuedLiquidity*s.issuedLiquidity/u))))),f=d-s.issuedLiquidity,m=f*c/d,g=f*p/d,I=BigInt(o.amount)-m,A=BigInt(i.amount)-g;if(I>A){var x=I;r=ke(x,a),e={id:o.id,amount:x+r,decimals:o.decimals,reserves:s.asset1},n={id:i.id,amount:BigInt(Math.abs(Math.min(Number(A),0))),decimals:i.decimals,reserves:s.asset2},f-=r*d/(c*BigInt(2))}else{var h=A;r=ke(h,a),e={id:i.id,amount:h+r,decimals:i.decimals,reserves:s.asset2},n={id:o.id,amount:BigInt(Math.abs(Math.min(Number(I),0))),decimals:o.decimals,reserves:s.asset1},f-=r*d/(p*BigInt(2))}return{poolTokenOutAmount:f,internalSwapQuote:{assetIn:e,assetOut:n,swapFees:r,priceImpact:Oe({inputSupply:e.reserves,outputSupply:n.reserves,assetIn:e,assetOut:n})}}}function ke(t,e){return t*BigInt(e)/(BigInt(1e4)-BigInt(e))}function Le(e){return(Ee[e]+1)*t.ALGORAND_MIN_TX_FEE}var Fe=tt("add_liquidity"),Be=(f(De={},ut.V1_1,[tt("mint")]),f(De,ut.V2,{INITIAL_LIQUIDITY:[tt("add_initial_liquidity")],SINGLE_ASSET_MODE:[Fe,tt("single")],FLEXIBLE_MODE:[Fe,tt("flexible")]}),De);function Re(){return(Re=c(i().mark((function t(e){var n,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,a=e.network,o=e.poolAddress,u=e.asset1In,c=e.asset2In,p=e.poolTokenOut,l=e.slippage,d=e.initiatorAddr,f=U("negative",l,p.amount),t.next=4,n.getTransactionParams().do();case 4:return m=t.sent,g=r.default.makeApplicationNoOpTxnFromObject({from:o,appIndex:ft(a,ut.V1_1),appArgs:Be.v1_1,accounts:[d],note:lt.getAppCallTxnNoteWithClientName(ut.V1_1),foreignAssets:0==c.id?[u.id,p.id]:[u.id,c.id,p.id],suggestedParams:m}),I=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:d,to:o,assetIndex:u.id,amount:u.amount,suggestedParams:m}),A=0===c.id?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:d,to:o,amount:c.amount,suggestedParams:m}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:d,to:o,assetIndex:c.id,amount:c.amount,suggestedParams:m}),x=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:o,to:d,assetIndex:p.id,amount:f,suggestedParams:m}),h=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:d,to:o,amount:g.fee+x.fee,note:s,suggestedParams:m}),T=r.default.assignGroupID([h,g,I,A,x]),t.abrupt("return",[{txn:T[0],signers:[d]},{txn:T[1],signers:[o]},{txn:T[2],signers:[d]},{txn:T[3],signers:[d]},{txn:T[4],signers:[o]}]);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Me(){return(Me=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pool,s=e.txGroup,a=e.initiatorSigner,o=n.account,t.next=4,a([s]);case 4:return u=t.sent,c=y(u,3),p=c[0],l=c[1],d=c[2],f=s.map((function(t,e){return e===exports.V1_1AddLiquidityTxnIndices.FEE_TXN?p:e===exports.V1_1AddLiquidityTxnIndices.ASSET1_IN_TXN?l:e===exports.V1_1AddLiquidityTxnIndices.ASSET2_IN_TXN?d:r.default.signLogicSigTransactionObject(t.txn,o).blob})),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ce(){return(Ce=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.txGroup,a=e.signedTxns,o=e.initiatorAddr,t.prev=1,u=BigInt(s[exports.V1_1AddLiquidityTxnIndices.LIQUDITY_OUT_TXN].txn.amount),t.next=5,St({client:n,pool:r,accountAddr:o});case 5:return c=t.sent,t.next=8,Y(n,[a]);case 8:return p=t.sent,l=y(p,1),d=l[0],f=d.confirmedRound,m=d.txnID,g=H(s),I=Z(s),t.next=17,St({client:n,pool:r,accountAddr:o});case 17:return A=t.sent,(x=A.excessPoolTokens-c.excessPoolTokens)<0n&&(x=0n),t.abrupt("return",{round:f,fees:g,poolTokenID:r.poolTokenID,poolTokenOut:u+x,excessAmount:{excessAmountForAddingLiquidity:x,totalExcessAmount:A.excessPoolTokens},txnID:m,groupID:I});case 23:throw t.prev=23,t.t0=t.catch(1),"SlippageTolerance"===(h=new P(t.t0,"We encountered something unexpected while adding liquidity. Try again later.")).type&&h.setMessage("Adding liquidity failed due to too much slippage in the price. Please adjust the slippage tolerance and try again."),h;case 28:case"end":return t.stop()}}),t,null,[[1,23]])})))).apply(this,arguments)}var Ve=Object.freeze({__proto__:null,getQuote:function(t){var e=t.pool,n=t.reserves,r=t.asset1In,s=t.asset2In;if(0n===n.issuedLiquidity){var a=BigInt(Math.floor(Math.sqrt(Number(r)*Number(s))));if(a<=BigInt(1e3))throw new Error("Initial liquidity amount is too small. The amount must be greater than ".concat(1e3,", this quote is for ").concat(a,"."));return{round:n.round,asset1ID:e.asset1ID,asset1In:BigInt(r),asset2ID:e.asset2ID,asset2In:BigInt(s),poolTokenID:e.poolTokenID,poolTokenOut:a-BigInt(1e3),share:1}}var o=BigInt(r)*n.issuedLiquidity/n.asset1,i=BigInt(s)*n.issuedLiquidity/n.asset2,u=o0&&void 0!==arguments[0]?arguments[0]:"Output amount exceeds available liquidity";return p(this,n),e.call(this,t)}return d(n)}();function gn(){return(gn=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,s=e.pool,a=e.swapType,o=e.assetIn,u=e.assetOut,c=e.initiatorAddr,p=e.slippage,l=s.account.address(),(d=[s.asset1ID,s.asset2ID]).includes(o.id)&&d.includes(u.id)&&o.id!==u.id){t.next=5;break}throw new P({pool:s,assetIn:o,assetOut:u},"Input asset (#".concat(o.id,") and output asset (#").concat(u.id,") provided to generate transactions do not belong to the pool ").concat(l,"."));case 5:return t.next=7,n.getTransactionParams().do();case 7:return f=t.sent,m=ot(o.id),g=a===exports.SwapType.FixedInput?o.amount:U("positive",p,o.amount),I=a===exports.SwapType.FixedOutput?u.amount:U("negative",p,u.amount),A=m?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:c,to:l,amount:g,suggestedParams:f}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:c,to:l,amount:g,assetIndex:o.id,suggestedParams:f}),(x=r.default.makeApplicationNoOpTxnFromObject({from:c,appIndex:s.validatorAppID,appArgs:[dn,fn[a],r.default.encodeUint64(I)],note:lt.getAppCallTxnNoteWithClientName(ut.V2),accounts:[l],foreignAssets:[s.asset1ID,s.asset2ID],suggestedParams:f})).fee=In(a),(h=[])[cn.INPUT_TXN]=A,h[cn.APP_CALL_TXN]=x,T=r.default.assignGroupID(h),t.abrupt("return",[{txn:T[cn.INPUT_TXN],signers:[c]},{txn:T[cn.APP_CALL_TXN],signers:[c]}]);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function In(e){return(ln[e]+1)*t.ALGORAND_MIN_TX_FEE}function An(){return(An=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=e.client,a=e.pool,o=e.txGroup,u=e.signedTxns,c=e.network,p=e.assetIn,t.next=3,Y(s,[u]);case 3:return l=t.sent,d=y(l,1),f=d[0],m=f.confirmedRound,g=f.txnID,t.next=10,ce(s,o);case 10:return I=t.sent,A=[a.asset1ID,a.asset2ID].filter((function(t){return t!==p.id}))[0],x=null==I||null===(n=I.find((function(t){return t.txn.txn.xaid===p.id})))||void 0===n?void 0:n.txn.txn,h=null==I||null===(r=I.find((function(t){return t.txn.txn.xaid===A})))||void 0===r?void 0:r.txn.txn,t.t0=m,t.t1=x&&{amount:BigInt(p.amount)-BigInt(x.aamt||0),id:p.id},t.t2=h&&{amount:h.aamt,id:A},t.next=19,Jt.v2.getPoolInfo({client:s,network:c,asset1ID:a.asset1ID,asset2ID:a.asset2ID});case 19:return t.t3=t.sent,t.t4=g,t.abrupt("return",{round:t.t0,assetIn:t.t1,assetOut:t.t2,pool:t.t3,txnID:t.t4});case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xn(t){var e=t.pool,n=t.assetIn,r=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetIn:n},"Trying to swap on a non-existent pool");var s,a,o,i=BigInt(n.amount),u=e.totalFeeShare;if(n.id===e.asset1ID)s=e.asset2ID,a=e.asset1Reserves,o=e.asset2Reserves;else{if(n.id!==e.asset2ID)throw new P({pool:e,assetIn:n},"Input asset (#".concat(n.id,") doesn't belong to the pool ").concat(e.account.address(),"."));s=e.asset1ID,a=e.asset2Reserves,o=e.asset1Reserves}var c=Tn({inputSupply:a,outputSupply:o,swapInputAmount:i,totalFeeShare:u,decimals:r}),p=c.swapOutputAmount,l=c.totalFeeAmount,d=c.priceImpact;if(p>o)throw new mn;return{assetInID:n.id,assetInAmount:i,assetOutID:s,assetOutAmount:p,swapFee:Number(l),rate:G(r.assetOut,Number(p))/G(r.assetIn,Number(i)),priceImpact:d}}function hn(t){var e=t.pool,n=t.assetOut,r=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetOut:n},"Trying to swap on a non-existent pool");var s,a,o,i=BigInt(n.amount),u=e.totalFeeShare;if(n.id===e.asset1ID)s=e.asset2ID,a=e.asset2Reserves,o=e.asset1Reserves;else{if(n.id!==e.asset2ID)throw new P({pool:e,assetOut:n},"Output asset (#".concat(n.id,") doesn't belong to the pool ").concat(e.account.address(),"."));s=e.asset1ID,a=e.asset1Reserves,o=e.asset2Reserves}var c=function(t){var e=t.inputSupply,n=t.outputSupply,r=t.swapOutputAmount,s=t.totalFeeShare,a=t.decimals,o=function(t){var e=t.inputSupply,n=t.outputSupply,r=t.outputAmount,s=BigInt(e*n/(n-r))-e;return s+=BigInt(1)}({inputSupply:e,outputSupply:n,outputAmount:r}),i=function(t){var e=t.swapAmount,n=t.totalFeeShare,r=Math.floor(Number(e*BigInt(1e4)/(BigInt(1e4)-BigInt(n))));return BigInt(r)-e}({swapAmount:o,totalFeeShare:s}),u=o+i,c=Oe({inputSupply:e,outputSupply:n,assetIn:{amount:u,decimals:a.assetIn},assetOut:{amount:r,decimals:a.assetOut}});return{swapInputAmount:u,totalFeeAmount:i,priceImpact:c}}({inputSupply:a,outputSupply:o,swapOutputAmount:i,totalFeeShare:u,decimals:r}),p=c.swapInputAmount,l=c.totalFeeAmount,d=c.priceImpact;if(i>o)throw new mn;return{assetInID:s,assetInAmount:p,assetOutID:n.id,assetOutAmount:i,swapFee:Number(l),rate:G(r.assetOut,Number(i))/G(r.assetIn,Number(p)),priceImpact:d}}function Tn(t){var e=t.inputSupply,n=t.outputSupply,r=t.swapInputAmount,s=t.totalFeeShare,a=t.decimals,o=BigInt(function(t){var e=t.inputAmount,n=t.totalFeeShare;return Math.floor(Number(e*BigInt(n))/1e4)}({inputAmount:r,totalFeeShare:s})),i=function(t){var e=t.inputSupply,n=t.outputSupply,r=t.swapAmount,s=n-BigInt(e*n/(e+BigInt(r)));return s-=BigInt(1)}({inputSupply:e,outputSupply:n,swapAmount:r-o});return{swapOutputAmount:i,totalFeeAmount:o,priceImpact:Oe({inputSupply:e,outputSupply:n,assetIn:{amount:r,decimals:a.assetIn},assetOut:{amount:i,decimals:a.assetOut}})}}var vn={getQuote:function(t,e,n,r){return t===exports.SwapType.FixedInput?xn({pool:e,assetIn:n,decimals:r}):hn({pool:e,assetOut:n,decimals:r})},getFixedInputSwapQuote:xn,getFixedOutputSwapQuote:hn,generateTxns:function(t){return gn.apply(this,arguments)},signTxns:function(t){var e=t.txGroup;return(0,t.initiatorSigner)([e])},execute:function(t){return An.apply(this,arguments)},calculateFixedInputSwap:Tn};function yn(t,e){var n,r,s=BigInt(t),a=e.issuedLiquidity;return a>s+BigInt(1e3)?(n=s*e.asset1/a,r=s*e.asset2/a):(n=e.asset1,r=e.asset2),{asset1OutputAmount:n,asset2OutputAmount:r}}function _n(){return(_n=c(i().mark((function e(n){var s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.client,a=n.pool,o=n.poolTokenIn,u=n.initiatorAddr,c=n.minAsset1Amount,p=n.minAsset2Amount,l=n.slippage,e.next=3,s.getTransactionParams().do();case 3:if(d=e.sent,f=a.account.address(),m=a.poolTokenID){e.next=8;break}throw new Error("Pool token asset ID is missing");case 8:return g=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:u,to:f,assetIndex:m,amount:o,suggestedParams:d}),(I=r.default.makeApplicationNoOpTxnFromObject({from:u,appIndex:a.validatorAppID,note:lt.getAppCallTxnNoteWithClientName(ut.V2),appArgs:[en,r.default.encodeUint64(U("negative",l,c)),r.default.encodeUint64(U("negative",l,p))],accounts:[f],foreignAssets:[a.asset1ID,a.asset2ID],suggestedParams:d})).fee=3*t.ALGORAND_MIN_TX_FEE,(A=[])[$e.ASSET_TRANSFER_TXN]=g,A[$e.APP_CALL_TXN]=I,x=r.default.assignGroupID(A),e.abrupt("return",[{txn:x[$e.ASSET_TRANSFER_TXN],signers:[u]},{txn:x[$e.APP_CALL_TXN],signers:[u]}]);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wn(){return(wn=c(i().mark((function e(n){var s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,y,_;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.client,a=n.pool,o=n.initiatorAddr,u=n.poolTokenIn,c=n.outputAssetId,p=n.minOutputAssetAmount,l=n.slippage,e.next=3,s.getTransactionParams().do();case 3:if(d=e.sent,f=a.asset1ID,m=a.asset2ID,g=a.account.address(),I=a.poolTokenID){e.next=9;break}throw new Error("Pool token asset ID is missing");case 9:if(A=0,x=0,h=U("negative",l,p),c!==f){e.next=17;break}A=h,x=0,e.next=23;break;case 17:if(c!==m){e.next=22;break}A=0,x=h,e.next=23;break;case 22:throw new Error("Invalid output asset id. It doesn't match with pool assets");case 23:return T=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:o,to:g,assetIndex:I,amount:u,suggestedParams:d}),(v=r.default.makeApplicationNoOpTxnFromObject({from:o,appIndex:a.validatorAppID,note:lt.getAppCallTxnNoteWithClientName(ut.V2),appArgs:[en,r.default.encodeUint64(A),r.default.encodeUint64(x)],accounts:[g],foreignAssets:[c],suggestedParams:d})).fee=3*t.ALGORAND_MIN_TX_FEE,(y=[])[$e.ASSET_TRANSFER_TXN]=T,y[$e.APP_CALL_TXN]=v,_=r.default.assignGroupID(y),e.abrupt("return",[{txn:_[$e.ASSET_TRANSFER_TXN],signers:[o]},{txn:_[$e.APP_CALL_TXN],signers:[o]}]);case 31:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Dn(){return(Dn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.client,s=e.txGroup,a=e.signedTxns,t.next=3,Y(r,[a]);case 3:return o=t.sent,u=y(o,1),c=u[0].txnID,t.next=8,ce(r,s);case 8:if(t.t1=n=t.sent,t.t0=null===t.t1,t.t0){t.next=12;break}t.t0=void 0===n;case 12:if(!t.t0){t.next=16;break}t.t2=void 0,t.next=17;break;case 16:t.t2=n.map((function(t){return{assetId:t.txn.txn.xaid,amount:t.txn.txn.aamt}}));case 17:return p=t.t2,t.abrupt("return",{outputAssets:p,txnID:c});case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var bn,En,Sn={getQuote:function(t){var e=t.pool,n=t.reserves,r=t.poolTokenIn,s=BigInt(r),a=yn(s,n),o=a.asset1OutputAmount,i=a.asset2OutputAmount;return{round:n.round,asset1Out:{assetId:e.asset1ID,amount:o},asset2Out:{assetId:e.asset2ID,amount:i},poolTokenIn:{assetId:e.poolTokenID,amount:s}}},getSingleAssetRemoveLiquidityQuote:function(t){var e,n=t.pool,r=t.reserves,s=t.poolTokenIn,a=t.assetOutID,o=t.decimals,i=BigInt(s),u=yn(i,r),c=u.asset1OutputAmount,p=u.asset2OutputAmount,l=n.totalFeeShare;if(a===n.asset1ID){var d=vn.calculateFixedInputSwap({inputSupply:r.asset2-p,outputSupply:r.asset1-c,swapInputAmount:p,totalFeeShare:l,decimals:o}),f=d.swapOutputAmount,m=d.totalFeeAmount,g=d.priceImpact;e={round:r.round,assetOut:{assetId:a,amount:c+f},poolTokenIn:{assetId:n.poolTokenID,amount:i},internalSwapQuote:{amountIn:{assetId:n.asset2ID,amount:p},amountOut:{assetId:n.asset1ID,amount:f},swapFees:{assetId:n.asset2ID,amount:m},priceImpact:g}}}else{if(a!==n.asset2ID)throw new Error("assetOutID must be one of the pool assets");var I=vn.calculateFixedInputSwap({inputSupply:r.asset1-c,outputSupply:r.asset2-p,swapInputAmount:c,totalFeeShare:l,decimals:o}),A=I.swapOutputAmount,x=I.totalFeeAmount,h=I.priceImpact;e={round:r.round,assetOut:{assetId:a,amount:p+A},poolTokenIn:{assetId:n.poolTokenID,amount:i},internalSwapQuote:{amountIn:{assetId:n.asset2ID,amount:p},amountOut:{assetId:n.asset1ID,amount:A},swapFees:{assetId:n.asset2ID,amount:x},priceImpact:h}}}return e},generateTxns:function(t){return _n.apply(this,arguments)},generateSingleAssetOutTxns:function(t){return wn.apply(this,arguments)},signTxns:function(t){var e=t.txGroup;return(0,t.initiatorSigner)([e])},execute:function(t){return Dn.apply(this,arguments)}},Nn=(f(bn={},ut.V1_1,pn),f(bn,ut.V2,Sn),bn),On=3n,Pn=1000n;function kn(){return(kn=c(i().mark((function t(e){var n,s,a,o,u,c,p,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pool,s=e.txGroup,a=e.initiatorSigner,t.next=3,a([s]);case 3:return o=t.sent,u=y(o,2),c=u[0],p=u[1],l=s.map((function(t,e){return e===En.FEE_TXN_INDEX?c:e===En.ASSET_IN_TXN_INDEX?p:r.default.signLogicSigTransactionObject(t.txn,n.account.lsig).blob})),t.abrupt("return",l);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ln(){return(Ln=c(i().mark((function t(e){var n,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,y;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,a=e.pool,o=e.swapType,u=e.assetIn,c=e.assetOut,p=e.slippage,l=e.initiatorAddr,d=a.account.address(),(f=[a.asset1ID,a.asset2ID]).includes(u.id)&&f.includes(c.id)&&u.id!==c.id){t.next=5;break}throw new P({pool:a,assetIn:u,assetOut:c},"Input asset (#".concat(u.id,") and output asset (#").concat(c.id,") provided to generate transactions do not belong to the pool ").concat(d,"."));case 5:return t.next=7,n.getTransactionParams().do();case 7:return m=t.sent,g=[tt("swap"),o===exports.SwapType.FixedInput?tt("fi"):tt("fo")],I=r.default.makeApplicationNoOpTxnFromObject({from:d,appIndex:a.validatorAppID,appArgs:g,accounts:[l],note:lt.getAppCallTxnNoteWithClientName(ut.V1_1),foreignAssets:0==a.asset2ID?[a.asset1ID,a.poolTokenID]:[a.asset1ID,a.asset2ID,a.poolTokenID],suggestedParams:m}),A=o===exports.SwapType.FixedOutput?U("positive",p,u.amount):u.amount,x=0===u.id?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:l,to:d,amount:A,suggestedParams:m}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:l,to:d,assetIndex:u.id,amount:A,suggestedParams:m}),h=o===exports.SwapType.FixedInput?U("negative",p,c.amount):c.amount,T=0===c.id?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:d,to:l,amount:h,suggestedParams:m}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:d,to:l,assetIndex:c.id,amount:h,suggestedParams:m}),v=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:l,to:d,amount:I.fee+T.fee,note:s,suggestedParams:m}),y=r.default.assignGroupID([v,I,x,T]),t.abrupt("return",[{txn:y[0],signers:[l]},{txn:y[1],signers:[d]},{txn:y[2],signers:[l]},{txn:y[3],signers:[d]}]);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Fn(t){var e=t.pool,n=t.reserves,r=t.assetIn,s=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetIn:r},"Trying to swap on a non-existent pool");var a,i,u,c=BigInt(r.amount);if(r.id===e.asset1ID)a=e.asset2ID,i=n.asset1,u=n.asset2;else{if(r.id!==e.asset2ID)throw new P({pool:e,assetIn:r},"Input asset (#".concat(r.id,") doesn't belong to the pool ").concat(e.account.address(),"."));a=e.asset1ID,i=n.asset2,u=n.asset1}var p=c*On/Pn,l=u-i*u/(i+(c-p));if(l>u)throw new mn;var d={assetIn:{amount:c,decimals:s.assetIn},assetOut:{amount:l,decimals:s.assetOut}};return{round:n.round,assetInID:r.id,assetInAmount:c,assetOutID:a,assetOutAmount:l,swapFee:Number(p),rate:Ne(d),priceImpact:Oe(o({inputSupply:i,outputSupply:u},d))}}function Bn(t){return Rn.apply(this,arguments)}function Rn(){return(Rn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.signedTxns,a=e.assetIn,o=e.assetOut,u=e.initiatorAddr,t.next=3,St({client:n,pool:r,accountAddr:u});case 3:return c=t.sent,t.next=6,Y(n,[s]);case 6:return p=t.sent,l=y(p,1),d=l[0],f=d.confirmedRound,m=d.txnID,t.next=13,St({client:n,pool:r,accountAddr:u});case 13:return g=t.sent,o.id===r.asset1ID?(I=c.excessAsset1,A=g.excessAsset1):(I=c.excessAsset2,A=g.excessAsset2),(x=A-I)<0n&&(x=0n),t.abrupt("return",{round:f,assetInID:a.id,assetInAmount:BigInt(a.amount),assetOutID:o.id,assetOutAmount:BigInt(o.amount)+x,excessAmount:{assetID:o.id,excessAmountForSwap:x,totalExcessAmount:A},txnID:m});case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Mn(t){var e=t.pool,n=t.reserves,r=t.assetOut,s=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetOut:r},"Trying to swap on a non-existent pool");var a,o,i,u=BigInt(r.amount);if(r.id===e.asset1ID)a=e.asset2ID,o=n.asset2,i=n.asset1;else{if(r.id!==e.asset2ID)throw new P({pool:e,assetOut:r},"Output asset (#".concat(r.id,") doesn't belong to the pool ").concat(e.account.address(),"."));a=e.asset1ID,o=n.asset1,i=n.asset2}if(u>i)throw new mn;var c=o*i/(i-u)-o,p=c*Pn/(Pn-On),l=p-c,d=G(s.assetOut,Number(u))/G(s.assetIn,Number(p)),f=G(s.assetOut,Number(i))/G(s.assetIn,Number(o)),m=W({decimalPlaces:5},Math.abs(d/f-1));return{round:n.round,assetInID:a,assetInAmount:p,assetOutID:r.id,assetOutAmount:u,swapFee:Number(l),rate:d,priceImpact:m}}function Cn(t){return Vn.apply(this,arguments)}function Vn(){return(Vn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.signedTxns,a=e.assetIn,o=e.assetOut,u=e.initiatorAddr,t.next=3,St({client:n,pool:r,accountAddr:u});case 3:return c=t.sent,t.next=6,Y(n,[s]);case 6:return p=t.sent,l=y(p,1),d=l[0],f=d.confirmedRound,m=d.txnID,t.next=13,St({client:n,pool:r,accountAddr:u});case 13:return g=t.sent,a.id===r.asset1ID?(I=c.excessAsset1,A=g.excessAsset1):(I=c.excessAsset2,A=g.excessAsset2),(x=A-I)<0n&&(x=0n),t.abrupt("return",{round:f,assetInID:a.id,assetInAmount:BigInt(a.amount)-x,assetOutID:o.id,assetOutAmount:BigInt(o.amount),excessAmount:{assetID:a.id,excessAmountForSwap:x,totalExcessAmount:A},txnID:m});case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xn(){return(Xn=c(i().mark((function t(e){var n,r,s,a,u,c,p,l,d,f;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,r=e.pool,s=e.swapType,a=e.txGroup,u=e.signedTxns,c=e.initiatorAddr,r.status===exports.PoolStatus.READY){t.next=3;break}throw new P({pool:r,swapType:s,txGroup:a},"Trying to swap on a non-existent pool");case 3:if(t.prev=3,p={id:a[En.ASSET_IN_TXN_INDEX].txn.assetIndex||0,amount:a[En.ASSET_IN_TXN_INDEX].txn.amount},l={id:a[En.ASSET_OUT_TXN_INDEX].txn.assetIndex||0,amount:a[En.ASSET_OUT_TXN_INDEX].txn.amount},s!==exports.SwapType.FixedInput){t.next=12;break}return t.next=9,Bn({client:n,pool:r,signedTxns:u,assetIn:p,assetOut:l,initiatorAddr:c});case 9:d=t.sent,t.next=15;break;case 12:return t.next=14,Cn({client:n,pool:r,signedTxns:u,assetIn:p,assetOut:l,initiatorAddr:c});case 14:d=t.sent;case 15:return t.abrupt("return",o(o({},d),{},{groupID:Z(a),fees:H(a)}));case 18:throw t.prev=18,t.t0=t.catch(3),"SlippageTolerance"===(f=new P(t.t0,"We encountered something unexpected while swapping. Try again later.")).type&&f.setMessage("The swap failed due to too much slippage in the price. Please adjust the slippage tolerance and try again."),f;case 23:case"end":return t.stop()}}),t,null,[[3,18]])})))).apply(this,arguments)}!function(t){t[t.FEE_TXN_INDEX=0]="FEE_TXN_INDEX",t[t.VALIDATOR_APP_CALL_TXN_INDEX=1]="VALIDATOR_APP_CALL_TXN_INDEX",t[t.ASSET_IN_TXN_INDEX=2]="ASSET_IN_TXN_INDEX",t[t.ASSET_OUT_TXN_INDEX=3]="ASSET_OUT_TXN_INDEX"}(En||(En={}));var jn,Qn={getQuote:function(t,e,n,r,s){return t===exports.SwapType.FixedInput?Fn({pool:e,reserves:n,assetIn:r,decimals:s}):Mn({pool:e,reserves:n,assetOut:r,decimals:s})},getFixedInputSwapQuote:Fn,getFixedOutputSwapQuote:Mn,generateTxns:function(t){return Ln.apply(this,arguments)},signTxns:function(t){return kn.apply(this,arguments)},execute:function(t){return Xn.apply(this,arguments)},executeFixedOutputSwap:Cn},Un=4*t.ALGORAND_MIN_TX_FEE;function Gn(t){return Promise.allSettled(t).then((function(t){if(t.every((function(t){return"rejected"===t.status&&t.reason instanceof mn})))throw new mn;return t.filter((function(t){return"fulfilled"===t.status&&void 0!==t.value.quote})).map((function(t){return t.value}))}))}function qn(){return(qn=c(i().mark((function t(e){var n,r,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pools,r=e.assetIn,s=e.assetOut,a=e.amount,o=n.map((function(t){return new Promise((function(e,n){var o,i={pool:t.info,assetIn:{amount:a,id:Number(r.id)},decimals:{assetIn:r.decimals,assetOut:s.decimals},reserves:t.reserves};try{o=t.info.contractVersion===ut.V1_1?Qn.getFixedInputSwapQuote(i):vn.getFixedInputSwapQuote(i),e({pool:t,quote:o})}catch(t){n(t)}}))})),t.next=4,Gn(o);case 4:return u=t.sent,t.abrupt("return",zn(u));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Wn(){return(Wn=c(i().mark((function t(e){var n,r,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pools,r=e.assetIn,s=e.assetOut,a=e.amount,o=n.map((function(t){return new Promise((function(e,n){var o,i={pool:t.info,assetOut:{amount:a,id:Number(s.id)},decimals:{assetIn:r.decimals,assetOut:s.decimals},reserves:t.reserves};try{o=t.info.contractVersion===ut.V1_1?Qn.getFixedOutputSwapQuote(i):vn.getFixedOutputSwapQuote(i),e({pool:t,quote:o})}catch(t){n(t)}}))})),t.next=4,Gn(o);case 4:return u=t.sent,t.abrupt("return",zn(u));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function zn(t){return t.filter((function(t){return!Gt(t.pool.reserves)})).sort((function(t,e){return e.quote.rate-t.quote.rate}))[0]}var Jn=(f(jn={},ut.V1_1,Qn),f(jn,ut.V2,vn),f(jn,"getQuote",(function(t){if(t.pools.every((function(t){return Gt(t.reserves)})))throw new Error("No pools available for swap");return t.type===exports.SwapType.FixedInput?function(t){return qn.apply(this,arguments)}(t):function(t){return Wn.apply(this,arguments)}(t)})),f(jn,"generateTxns",(function(t){return t.pool.contractVersion===ut.V1_1?Qn.generateTxns(t):vn.generateTxns(t)})),f(jn,"signTxns",(function(t){return t.pool.contractVersion===ut.V1_1?Qn.signTxns(t):vn.signTxns(t)})),f(jn,"execute",(function(t){return t.contractVersion===ut.V1_1?Qn.execute(t):vn.execute(t)})),jn);function Yn(){return(Yn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.txGroup,a=e.initiatorSigner,t.prev=1,t.next=4,Kn({txGroup:s,pool:r,initiatorSigner:a});case 4:return o=t.sent,t.next=7,Y(n,[o]);case 7:return u=t.sent,c=y(u,1),p=c[0],l=p.txnID,d=p.confirmedRound,t.abrupt("return",{fees:H(s),confirmedRound:d,txnID:l,groupID:Z(s)});case 15:throw t.prev=15,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while redeeming. Try again later.");case 18:case"end":return t.stop()}}),t,null,[[1,15]])})))).apply(this,arguments)}function Kn(t){return Hn.apply(this,arguments)}function Hn(){return(Hn=c(i().mark((function t(e){var n,s,a,o,u,c,p,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.txGroup,s=e.pool,a=e.initiatorSigner,t.next=3,a([n]);case 3:return o=t.sent,u=y(o,1),c=u[0],p=s.account.lsig,l=n.map((function(t,e){return 0===e?c:r.default.signLogicSigTransactionObject(t.txn,p).blob})),t.abrupt("return",l);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zn(){return Zn=c(i().mark((function t(e){var n,s,a,o,u,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.data,a=e.initiatorSigner,t.prev=1,o=s.map((function(t){var e=t.txGroup,n=t.pool;return{txns:e,txnFees:H(e),groupID:Z(e),lsig:n.account.lsig}})),t.next=5,a(o.map((function(t){return t.txns})));case 5:return u=t.sent,p=Promise.all(o.map((function(t,e){return new Promise(function(){var s=c(i().mark((function s(a,o){var c,p,l,d,f,m;return i().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,c=t.txns.map((function(n,s){return 0===s?u[e]:r.default.signLogicSigTransactionObject(n.txn,t.lsig).blob})),s.next=4,Y(n,[c]);case 4:p=s.sent,l=y(p,1),d=l[0],f=d.txnID,m=d.confirmedRound,a({fees:t.txnFees,groupID:t.groupID,txnID:f,confirmedRound:m}),s.next=15;break;case 12:s.prev=12,s.t0=s.catch(0),o(s.t0);case 15:case"end":return s.stop()}}),s,null,[[0,12]])})));return function(t,e){return s.apply(this,arguments)}}())}))),t.abrupt("return",p);case 10:throw t.prev=10,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while redeeming. Try again later.");case 13:case"end":return t.stop()}}),t,null,[[1,10]])}))),Zn.apply(this,arguments)}function $n(){return($n=c(i().mark((function t(e){var n,a,o,u,c,p,l,d,f,m,g;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,a=e.pool,o=e.assetID,u=e.assetOut,c=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return p=t.sent,l=a.account.address(),d=r.default.makeApplicationNoOpTxnFromObject({from:l,appIndex:a.validatorAppID,appArgs:[tt("redeem")],note:lt.getAppCallTxnNoteWithClientName(a.contractVersion),accounts:[c],foreignAssets:0==a.asset2ID?[a.asset1ID,a.poolTokenID]:[a.asset1ID,a.asset2ID,a.poolTokenID],suggestedParams:p}),f=0===o?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:l,to:c,amount:BigInt(u),suggestedParams:p}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:l,to:c,assetIndex:o,amount:BigInt(u),suggestedParams:p}),m=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:c,to:l,amount:d.fee+f.fee,note:s,suggestedParams:p}),g=r.default.assignGroupID([m,d,f]),t.abrupt("return",[{txn:g[0],signers:[c]},{txn:g[1],signers:[l]},{txn:g[2],signers:[l]}]);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function tr(e){var n=e.suggestedParams,r=e.stakingAppID,s=e.initiatorAddr,a=e.liquidityAssetID,o=e.program,i=e.amount,u=t.encodeUint64(i),c=t.encodeUint64(o.id);return t.makeApplicationNoOpTxnFromObject({appIndex:r,from:s,suggestedParams:n,foreignAssets:[a],accounts:[o.accountAddress],appArgs:[tt("commit"),u],note:L([tt("tinymanStaking/v1:b"),c,t.encodeUint64(a),u])})}function er(){return(er=c(i().mark((function e(n){var r,s,a,o,u,c,p,l,d,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.client,s=n.stakingAppID,a=n.program,o=n.requiredAssetID,u=n.liquidityAssetID,c=n.amount,p=n.initiatorAddr,e.next=3,r.getTransactionParams().do();case 3:if(l=e.sent,d=tr({suggestedParams:l,stakingAppID:s,program:a,liquidityAssetID:u,initiatorAddr:p,amount:c}),f=[d],"number"!=typeof o){e.next=10;break}return m=t.makeApplicationNoOpTxnFromObject({appIndex:s,from:p,suggestedParams:l,foreignAssets:[o],accounts:[a.accountAddress],appArgs:[tt("log_balance")]}),f=t.assignGroupID([d,m]),e.abrupt("return",[{txn:f[0],signers:[p]},{txn:f[1],signers:[p]}]);case 10:return e.abrupt("return",[{txn:f[0],signers:[p]}]);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.ALGO_ASSET=et,exports.ALGO_ASSET_ID=0,exports.ASSET_OPT_IN_PROCESS_TXN_COUNT=1,exports.AddLiquidity=Ze,exports.BASE_MINIMUM_BALANCE=1e5,exports.Bootstrap=he,exports.CONTRACT_VERSION=ut,exports.MINIMUM_ADD_LIQUIDITY_AMOUNT=1e3,exports.MINIMUM_BALANCE_REQUIRED_PER_APP=1e5,exports.MINIMUM_BALANCE_REQUIRED_PER_ASSET=1e5,exports.MINIMUM_BALANCE_REQUIRED_PER_BYTE_SCHEMA=5e4,exports.MINIMUM_BALANCE_REQUIRED_PER_INT_SCHEMA_VALUE=28500,exports.OPT_IN_VALIDATOR_APP_PROCESS_TXN_COUNT=1,exports.OPT_OUT_VALIDATOR_APP_PROCESS_TXN_COUNT=1,exports.POOL_TOKEN_UNIT_NAME=nt,exports.REDEEM_PROCESS_TXN_COUNT=3,exports.RemoveLiquidity=Nn,exports.Swap=Jn,exports.V1_1_ADD_LIQUIDITY_PROCESS_TXN_COUNT=5,exports.V1_1_REMOVE_LIQUIDITY_TXN_COUNT=tn,exports.V2AddLiquidityTxnIndices=be,exports.V2_REMOVE_LIQUIDITY_APP_CALL_INNER_TXN_COUNT=2,exports.applySlippageToAmount=U,exports.calculateAccountMinimumRequiredBalance=wt,exports.combineAndRegroupSignerTxns=function(){for(var e=arguments.length,n=new Array(e),r=0;r=t.minimum_required_balance},exports.isAccountOptedIntoApp=function(t){var e=t.appID;return t.accountAppsLocalState.some((function(t){return t.id===e}))},exports.poolUtils=Jt,exports.prepareCommitTransactions=function(t){return er.apply(this,arguments)},exports.redeemAllExcessAsset=function(t){return Zn.apply(this,arguments)},exports.redeemExcessAsset=function(t){return Yn.apply(this,arguments)},exports.sendAndWaitRawTransaction=Y,exports.sumUpTxnFees=H,exports.tinymanContract_v1_1=At,exports.tinymanContract_v2=Tt,exports.tinymanJSSDKConfig=lt; +i=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},s=r.iterator||"@@iterator",a=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var s=e&&e.prototype instanceof d?e:d,a=Object.create(s.prototype),o=new w(r||[]);return a._invoke=function(t,e,n){var r="suspendedStart";return function(s,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===s)throw a;return b()}for(n.method=s,n.arg=a;;){var o=n.delegate;if(o){var i=v(o,n);if(i){if(i===l)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=p(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),a}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var l={};function d(){}function f(){}function m(){}var g={};u(g,s,(function(){return this}));var I=Object.getPrototypeOf,A=I&&I(I(D([])));A&&A!==e&&n.call(A,s)&&(g=A);var x=m.prototype=d.prototype=Object.create(g);function h(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(s,a,o,i){var u=p(t[s],t,a);if("throw"!==u.type){var c=u.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,o,i)}),(function(t){r("throw",t,o,i)})):e.resolve(l).then((function(t){c.value=t,o(c)}),(function(t){return r("throw",t,o,i)}))}i(u.arg)}var s;this._invoke=function(t,n){function a(){return new e((function(e,s){r(t,n,e,s)}))}return s=s?s.then(a,a):a()}}function v(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,v(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=p(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var s=r.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function y(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(y,this),this.reset(!0)}function D(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,a=function e(){for(;++r=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var i=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(i&&u){if(this.prev=0;--r){var s=this.tryEntries[r];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var s=r.arg;_(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:D(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function u(t,e,n,r,s,a,o){try{var i=t[a](o),u=i.value}catch(t){return void n(t)}i.done?e(u):Promise.resolve(u).then(r,s)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,s){var a=t.apply(e,n);function o(t){u(a,r,s,o,i,"next",t)}function i(t){u(a,r,s,o,i,"throw",t)}o(void 0)}))}}function p(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,i=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){i=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw a}}}}var E="- would result negative",S="logic eval error:",N="exceeds schema integer count",O=/transaction \w+:/,P=function(t){m(n,h(Error));var e=v(n);function n(t,r){var s;p(this,n);for(var a=arguments.length,o=new Array(a>2?a-2:0),i=2;i1||e<0)throw new Error("Invalid slippage value. Must be between 0 and 1, got ".concat(e));var r;try{var s="negative"===t?1-e:1+e;r=BigInt(Math.floor(Number(n)*s))}catch(t){throw new Error(t.message)}return r}function G(t,e){var n=Number(t);return W({decimalPlaces:n},Math.pow(10,-n)*Number(e))}function q(t,e){return W({decimalPlaces:0},Math.pow(10,Number(t))*Number(e))}function W(t,e){var n=t.decimalPlaces,r=void 0===n?0:n;if(r>0){var s=y(J(e),2),a=s[0],o=s[1],i=y(J(Math.round(Number(z(a,o+r)))),2),u=i[0],c=i[1];return Number(z(u,c-r))}return Math.round(e)}function z(t,e){return t+(e<0?"e".concat(e):"e+".concat(e))}function J(t){if(t.toString().includes("e")){var e=t.toString().split("e");return[parseFloat(e[0]),parseFloat(e[1])]}return[t,0]}function Y(t,e){return K.apply(this,arguments)}function K(){return(K=c(i().mark((function t(e,n){var r,s,a,o,u,c,p,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.prev=0,r=[],s=b(n),t.prev=3,s.s();case 5:if((a=s.n()).done){t.next=18;break}return o=a.value,t.next=9,e.sendRawTransaction(o).do();case 9:return u=t.sent,c=u.txId,t.next=13,j(e,c);case 13:p=t.sent,l=p["confirmed-round"],r.push({confirmedRound:l,txnID:c});case 16:t.next=5;break;case 18:t.next=23;break;case 20:t.prev=20,t.t0=t.catch(3),s.e(t.t0);case 23:return t.prev=23,s.f(),t.finish(23);case 26:return t.abrupt("return",r);case 29:throw t.prev=29,t.t1=t.catch(0),new P(t.t1,"We encountered an error while processing this transaction. Try again later.");case 32:case"end":return t.stop()}}),t,null,[[0,29],[3,20,23,26]])})))).apply(this,arguments)}function H(t){return t.reduce((function(t,e){return t+e.txn.fee}),0)}function Z(t){return(e=t[0].txn.group)?Buffer.from(e).toString("base64"):"";var e}function $(t){for(var e=[];;){var n=127&t;if(!(t>>=7)){e.push(n);break}e.push(128|n)}return e}function tt(t){return(new TextEncoder).encode(t)}var et={id:"".concat(0),name:"Algorand",unit_name:"ALGO",decimals:6,url:"https://algorand.org",is_liquidity_token:!1,total_amount:"6615503326932151",clawback_address:""},nt={V1:"TM1POOL",V1_1:"TMPOOL11",V2:"TMPOOL2"};function rt(){return(rt=c(i().mark((function t(e){var n,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.assetID,a=e.initiatorAddr,t.prev=1,t.next=4,n.getTransactionParams().do();case 4:return o=t.sent,u=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:a,to:a,assetIndex:s,amount:0,suggestedParams:o}),t.abrupt("return",[{txn:u,signers:[a]}]);case 9:throw t.prev=9,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while opting into this asset. Try again later.");case 12:case"end":return t.stop()}}),t,null,[[1,9]])})))).apply(this,arguments)}function st(t,e){var n=Number(t.id),r=Number(e.id);return n>r?[o(o({},t),{},{id:n}),o(o({},e),{},{id:r})]:[o(o({},e),{},{id:r}),o(o({},t),{},{id:n})]}function at(t,e){var n=[t,e];return[Math.max.apply(Math,n),Math.min.apply(Math,n)]}function ot(t){return 0===Number(t)}var it,ut={V1_1:"v1_1",V2:"v2"},ct={type:"logicsig",logic:{bytecode:"BCAIAQCBgICAgICAgPABgICAgICAgIDwAQMEBQYlJA1EMQkyAxJEMRUyAxJEMSAyAxJEMgQiDUQzAQAxABJEMwEQIQcSRDMBGIGCgICAgICAgPABEkQzARkiEjMBGyEEEhA3ARoAgAlib290c3RyYXASEEAAXDMBGSMSRDMBG4ECEjcBGgCABHN3YXASEEACOzMBGyISRDcBGgCABG1pbnQSQAE7NwEaAIAEYnVybhJAAZg3ARoAgAZyZWRlZW0SQAJbNwEaAIAEZmVlcxJAAnkAIQYhBSQjEk0yBBJENwEaARclEjcBGgIXJBIQRDMCADEAEkQzAhAhBBJEMwIhIxJEMwIiIxwSRDMCIyEHEkQzAiQjEkQzAiWACFRNUE9PTDExEkQzAiZRAA+AD1RpbnltYW5Qb29sMS4xIBJEMwIngBNodHRwczovL3RpbnltYW4ub3JnEkQzAikyAxJEMwIqMgMSRDMCKzIDEkQzAiwyAxJEMwMAMQASRDMDECEFEkQzAxElEkQzAxQxABJEMwMSIxJEJCMTQAAQMwEBMwIBCDMDAQg1AUIBsTMEADEAEkQzBBAhBRJEMwQRJBJEMwQUMQASRDMEEiMSRDMBATMCAQgzAwEIMwQBCDUBQgF8MgQhBhJENwEcATEAE0Q3ARwBMwQUEkQzAgAxABNEMwIUMQASRDMDADMCABJEMwIRJRJEMwMUMwMHMwMQIhJNMQASRDMDESMzAxAiEk0kEkQzBAAxABJEMwQUMwIAEkQzAQEzBAEINQFCAREyBCEGEkQ3ARwBMQATRDcBHAEzAhQSRDMDFDMDBzMDECISTTcBHAESRDMCADEAEkQzAhQzBAASRDMCESUSRDMDADEAEkQzAxQzAwczAxAiEk0zBAASRDMDESMzAxAiEk0kEkQzBAAxABNEMwQUMQASRDMBATMCAQgzAwEINQFCAJAyBCEFEkQ3ARwBMQATRDMCADcBHAESRDMCADEAE0QzAwAxABJEMwIUMwIHMwIQIhJNMQASRDMDFDMDBzMDECISTTMCABJEMwEBMwMBCDUBQgA+MgQhBBJENwEcATEAE0QzAhQzAgczAhAiEk03ARwBEkQzAQEzAgEINQFCABIyBCEEEkQzAQEzAgEINQFCAAAzAAAxABNEMwAHMQASRDMACDQBD0M=",address:"ABUKAXTANWR6K6ZYV75DWJEPVWWOU6SFUVRI6QHO44E4SIDLHBTD2CZ64A",size:881,variables:[{name:"TMPL_ASSET_ID_1",type:"int",index:15,length:10},{name:"TMPL_ASSET_ID_2",type:"int",index:5,length:10},{name:"TMPL_VALIDATOR_APP_ID",type:"int",index:74,length:10}],source:"https://github.com/tinymanorg/tinyman-contracts-v1/tree/dc9ab40c58b85c15d58f63a1507e18be76720dbb/contracts/pool_logicsig.teal.tmpl"},name:"pool_logicsig"},pt={type:"app",global_state_schema:{num_uints:0,num_byte_slices:0},local_state_schema:{num_uints:16,num_byte_slices:0},name:"validator_app"},lt=new(function(){function t(){p(this,t),this.clientName="tinyman-js-sdk"}return d(t,[{key:"getClientName",value:function(){return this.clientName}},{key:"setClientName",value:function(t){this.clientName=t}},{key:"getAppCallTxnNoteWithClientName",value:function(t){return tt("tinyman/".concat(t===ut.V1_1?"v1":t,':j{"origin":"').concat(this.clientName,'"}'))}}]),t}()),dt=(f(it={},ut.V1_1,{testnet:62368684,mainnet:552635992}),f(it,ut.V2,{testnet:148607e3,mainnet:1002541853}),it);function ft(t,e){var n=dt[e][t];if(!n)throw new Error("No Validator App exists for ".concat(t," network with ").concat(e," contract version"));return n}function mt(){return(mt=c(i().mark((function t(e){var n,s,a,o,u,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.network,a=e.contractVersion,o=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return u=t.sent,c=r.default.makeApplicationOptInTxnFromObject({from:o,appIndex:ft(s,a),note:lt.getAppCallTxnNoteWithClientName(a),suggestedParams:u}),t.abrupt("return",[{txn:c,signers:[o]}]);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gt(){return(gt=c(i().mark((function t(e){var n,s,a,o,u,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.network,a=e.contractVersion,o=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return u=t.sent,c=r.default.makeApplicationClearStateTxnFromObject({from:o,appIndex:ft(s,a),note:lt.getAppCallTxnNoteWithClientName(a),suggestedParams:u}),t.abrupt("return",[{txn:c,signers:[o]}]);case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var It=d((function t(e){p(this,t),this.schema={numLocalInts:e.local_state_schema.num_uints,numLocalByteSlices:e.local_state_schema.num_byte_slices,numGlobalInts:e.global_state_schema.num_uints,numGlobalByteSlices:e.global_state_schema.num_byte_slices}})),At=new(function(n){m(s,It);var r=v(s);function s(t,e){var n;return p(this,s),(n=r.call(this,t)).poolLogicSigContractTemplate=e.logic.bytecode,n.templateVariables=e.logic.variables,n}return d(s,[{key:"generateLogicSigAccountForPool",value:function(n){if(n.asset1ID===n.asset2ID)throw new Error("Assets are the same");var r=ft(n.network,ut.V1_1),s=y(at(n.asset1ID,n.asset2ID),2),a=s[0],o=s[1],i=Array.from(e.toByteArray(this.poolLogicSigContractTemplate)),u={asset_id_1:a,asset_id_2:o,validator_app_id:r},c=0;this.templateVariables.sort((function(t,e){return t.index-e.index}));for(var p=0;p2&&void 0!==arguments[2]?arguments[2]:t.IntDecoding.DEFAULT;return new Promise(function(){var t=c(i().mark((function t(s,a){var u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.accountInformation(n).setIntDecoding(r).do();case 3:u=t.sent,s(o(o({},u),{},{minimum_required_balance:wt(u)})),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),a(new Error(t.t0.message||"Failed to fetch account information"));case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e,n){return t.apply(this,arguments)}}())}function _t(t,e){var n=t["apps-local-state"].find((function(t){return t.id===e}));return n?k({stateArray:n["key-value"],shouldDecodeKeys:!0}):null}function wt(t){var e=t["apps-total-schema"];return 1e5+1e5*(t.assets||[]).length+1e5*(t["created-apps"]||[]).length+1e5*(t["apps-local-state"]||[]).length+5e4*Number(e&&e["num-byte-slice"]||0)+28500*Number(e&&e["num-uint"]||0)+1e5*(t["apps-total-extra-pages"]||0)}var Dt,bt,Et=tt("e");function St(t){return Nt.apply(this,arguments)}function Nt(){return(Nt=c(i().mark((function n(s){var a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,y,_,w,D,E;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=s.client,o=s.pool,u=s.accountAddr,n.next=3,a.accountInformation(u).setIntDecoding(t.IntDecoding.BIGINT).do();case 3:c=n.sent,p=c["apps-local-state"]||[],l=0n,d=0n,f=0n,m=o.account.address(),g=b(p),n.prev=10,g.s();case 12:if((I=g.n()).done){n.next=31;break}if((A=I.value).id==o.validatorAppID){n.next=16;break}return n.abrupt("continue",29);case 16:if(x=A["key-value"]){n.next=19;break}return n.abrupt("break",31);case 19:h=k({stateArray:x}),T=e.fromByteArray(L([r.default.decodeAddress(m).publicKey,Et,r.default.encodeUint64(o.asset1ID)])),v=e.fromByteArray(L([r.default.decodeAddress(m).publicKey,Et,r.default.encodeUint64(o.asset2ID)])),y=e.fromByteArray(L([r.default.decodeAddress(m).publicKey,Et,r.default.encodeUint64(o.poolTokenID)])),_=h[T],w=h[v],D=h[y],"bigint"==typeof _&&(l=_),"bigint"==typeof w&&(d=w),"bigint"==typeof D&&(f=D);case 29:n.next=12;break;case 31:n.next=36;break;case 33:n.prev=33,n.t0=n.catch(10),g.e(n.t0);case 36:return n.prev=36,g.f(),n.finish(36);case 39:if(!((E={excessAsset1:l,excessAsset2:d,excessPoolTokens:f}).excessAsset1<0n||E.excessAsset2<0n||E.excessPoolTokens<0n)){n.next=42;break}throw new Error("Invalid account excess: ".concat(E));case 42:return n.abrupt("return",E);case 43:case"end":return n.stop()}}),n,null,[[10,33,36,39]])})))).apply(this,arguments)}function Ot(){return(Ot=c(i().mark((function n(s){var a,o,u,c,p,l,d,f,m,g,I,A,x,h,T;return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=s.client,o=s.accountAddr,u=s.validatorAppID,n.next=3,a.accountInformation(o).setIntDecoding(t.IntDecoding.BIGINT).do();case 3:if(c=n.sent,p=c["apps-local-state"]||[],l=p.find((function(t){return t.id==u})),d=[],l&&l["key-value"])for(f=k({stateArray:l["key-value"]}),m=0,g=Object.entries(f);mLt)){n.next=48;break}throw new Error("Issued liquidity value is out of the expected range ([0n, ".concat(Lt,"]): ").concat(B.issuedLiquidity));case 48:return n.abrupt("return",B);case 49:case"end":return n.stop()}}),n,null,[[8,31,34,37]])})))).apply(this,arguments)}function Mt(){return Mt=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,r=e.address,s=e.network,!(a=d.length>1&&void 0!==d[1]?d[1]:{})[r]){t.next=4;break}return t.abrupt("return",a[r]);case 4:return t.next=6,yt(n,r);case 6:return o=t.sent,u=_t(o,ft(s,ut.V1_1)),c=null,u&&(l=o["created-assets"][0],p=l.index,c={asset1ID:u[Pt[ut.V1_1].asset1],asset2ID:u[Pt[ut.V1_1].asset2],poolTokenID:p},a[r]=c),t.abrupt("return",c);case 11:case"end":return t.stop()}}),t)}))),Mt.apply(this,arguments)}var Ct=Object.freeze({__proto__:null,getPoolInfo:Ft,getPoolReserves:function(t,e){return Rt.apply(this,arguments)},getPoolAssets:function(t){return Mt.apply(this,arguments)}});function Vt(t){return Xt.apply(this,arguments)}function Xt(){return(Xt=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.network,s=e.asset1ID,a=e.asset2ID,o=vt(ut.V2),u=o.generateLogicSigAccountForPool(e),c=ft(r,ut.V2),p=u.address(),l=at(s,a),t.next=8,yt(n,p);case 8:return d=t.sent,f=_t(d,c),m={account:u,validatorAppID:c,asset1ID:l[0],asset2ID:l[1],status:f?exports.PoolStatus.READY:exports.PoolStatus.NOT_CREATED,contractVersion:ut.V2},f&&(m.asset1ProtocolFees=BigInt(f[Pt.v2.asset1ProtocolFees]),m.asset2ProtocolFees=BigInt(f[Pt.v2.asset2ProtocolFees]),m.asset1Reserves=BigInt(f[Pt.v2.asset1Reserves]),m.asset2Reserves=BigInt(f[Pt.v2.asset2Reserves]),m.issuedPoolTokens=BigInt(f[Pt.v2.issuedPoolTokens]),m.cumulativePriceUpdateTimeStamp=Number(f[Pt.v2.cumulativePriceUpdateTimeStamp]),m.protocolFeeRatio=Number(f[Pt.v2.protocolFeeRatio]),m.totalFeeShare=BigInt(f[Pt.v2.totalFeeShare]),m.poolTokenID=Number(f[Pt.v2.poolTokenID]),m.asset1ID=Number(f[Pt.v2.asset1]),m.asset2ID=Number(f[Pt.v2.asset2])),t.abrupt("return",m);case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function jt(){return(jt=c(i().mark((function t(e,n){var r,s,a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,yt(e,n.account.address());case 2:return r=t.sent,s=_t(r,n.validatorAppID),a={asset1:0n,asset2:0n,issuedLiquidity:0n,round:r.round},s&&(a.asset1=BigInt(s[Pt.v2.asset1Reserves]),a.asset2=BigInt(s[Pt.v2.asset2Reserves]),a.issuedLiquidity=BigInt(s[Pt.v2.issuedPoolTokens])),t.abrupt("return",a);case 7:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Qt(){return(Qt=c(i().mark((function t(e){var n,r,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.address,s=e.network,t.next=3,yt(n,r);case 3:return a=t.sent,o=_t(a,ft(s,ut.V2)),u=null,o&&(u={asset1ID:o[Pt[ut.V2].asset1],asset2ID:o[Pt[ut.V2].asset2],poolTokenID:o[Pt[ut.V2].poolTokenID]}),t.abrupt("return",u);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var Ut=Object.freeze({__proto__:null,getPoolInfo:Vt,getPoolReserves:function(t,e){return jt.apply(this,arguments)},getPoolAssets:function(t){return Qt.apply(this,arguments)}});function Gt(t){return Boolean(t&&!(t.asset1+t.asset2))}var qt,Wt,zt=Object.freeze({__proto__:null,getPoolShare:function(t,e){var n=Number(e)/Number(t);return Number.isFinite(n)||(n=0),n},getPoolPairRatio:function(t,e){var n=Gt(e),r=null;return e&&!n&&e.asset1&&e.asset2&&"number"==typeof t.asset2&&"number"==typeof t.asset1&&(r=G(t.asset1,e.asset1)/G(t.asset2,e.asset2)),r},isPoolEmpty:Gt,isPoolNotCreated:function(t){return(null==t?void 0:t.status)===exports.PoolStatus.NOT_CREATED},isPoolReady:function(t){return(null==t?void 0:t.status)===exports.PoolStatus.READY},getPoolsForPair:function(t){return Promise.all([Ft(t),Vt(t)])}}),Jt=o((f(qt={},ut.V1_1,o(o({},Ct),zt)),f(qt,ut.V2,o(o({},Ut),zt)),qt),zt);!function(t){t[t.FUNDING_TXN=0]="FUNDING_TXN",t[t.VALIDATOR_APP_CALL=1]="VALIDATOR_APP_CALL",t[t.POOL_TOKEN_CREATE=2]="POOL_TOKEN_CREATE",t[t.ASSET1_OPT_IN=3]="ASSET1_OPT_IN",t[t.ASSET2_OPT_IN=4]="ASSET2_OPT_IN"}(Wt||(Wt={}));var Yt=96e4,Kt=859e3;function Ht(){return(Ht=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,_,w,D,b,E,S,N;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.network,a=e.asset_1,o=e.asset_2,u=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return c=t.sent,p=st(a,o),l=y(p,2),d=l[0],f=d.id,m=d.unit_name,g=l[1],I=g.id,A=g.unit_name,x=ot(I),h=ft(s,ut.V1_1),T=At.generateLogicSigAccountForPool({network:s,asset1ID:f,asset2ID:I}),v=T.address(),_=r.default.makeApplicationOptInTxnFromObject({from:v,appIndex:h,note:lt.getAppCallTxnNoteWithClientName(ut.V1_1),appArgs:[tt("bootstrap"),r.default.encodeUint64(f),r.default.encodeUint64(I)],foreignAssets:x?[f]:[I],suggestedParams:c}),w=r.default.makeAssetCreateTxnWithSuggestedParamsFromObject({from:v,total:0xffffffffffffffffn,decimals:6,defaultFrozen:!1,unitName:nt.V1_1,assetName:"TinymanPool1.1 ".concat(m,"-").concat(A),assetURL:"https://tinyman.org",suggestedParams:c}),D=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:v,to:v,assetIndex:f,amount:0,suggestedParams:c}),b=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:u,to:v,amount:Zt(x),suggestedParams:c}),(E=[])[Wt.FUNDING_TXN]=b,E[Wt.VALIDATOR_APP_CALL]=_,E[Wt.POOL_TOKEN_CREATE]=w,E[Wt.ASSET1_OPT_IN]=D,x||(E[Wt.ASSET2_OPT_IN]=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:v,to:v,assetIndex:I,amount:0,suggestedParams:c})),S=r.default.assignGroupID(E),N=[{txn:S[Wt.FUNDING_TXN],signers:[u]},{txn:S[Wt.VALIDATOR_APP_CALL],signers:[v]},{txn:S[Wt.POOL_TOKEN_CREATE],signers:[v]},{txn:S[Wt.ASSET1_OPT_IN],signers:[v]}],S[Wt.ASSET2_OPT_IN]&&N.push({txn:S[Wt.ASSET2_OPT_IN],signers:[v]}),t.abrupt("return",N);case 23:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zt(t){return t?Yt:Kt}function $t(){return($t=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.txGroup,s=e.network,a=e.initiatorSigner,o=e.asset1ID,u=e.asset2ID,t.next=3,a([n]);case 3:return c=t.sent,p=y(c,1),l=p[0],d=at(o,u),f=y(d,2),m=f[0],g=f[1],I=At.generateLogicSigAccountForPool({network:s,asset1ID:m,asset2ID:g}),A=[],x=n.map((function(t,e){if(e===Wt.FUNDING_TXN)return A.push(t.txn.txID().toString()),l;var n=r.default.signLogicSigTransactionObject(t.txn,I),s=n.txID,a=n.blob;return A.push(s),a})),t.abrupt("return",{signedTxns:x,txnIDs:A});case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function te(t){return ee.apply(this,arguments)}function ee(){return(ee=c(i().mark((function t(e){var n,r,s,a,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.signedTxns,s=e.txnIDs,t.prev=1,t.next=4,n.sendRawTransaction(r).do();case 4:return t.next=6,j(n,s[Wt.POOL_TOKEN_CREATE]);case 6:if(a=t.sent,"number"==typeof(o=a["asset-index"])){t.next=10;break}throw new Error("Generated ID is not valid: got ".concat(o));case 10:return t.abrupt("return",{poolTokenID:o});case 13:throw t.prev=13,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while bootstraping the pool. Try again later.");case 16:case"end":return t.stop()}}),t,null,[[1,13]])})))).apply(this,arguments)}function ne(){return(ne=c(i().mark((function t(e){var n,r,s,a,o,u,c;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.network,s=e.pool,a=s.asset1ID,o=s.asset2ID,u=e.signedTxns,c=e.txnIDs,t.next=3,te({client:n,signedTxns:u,txnIDs:c});case 3:return t.abrupt("return",Jt.v1_1.getPoolInfo({client:n,network:r,asset1ID:a,asset2ID:o}));case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var re,se={generateTxns:function(t){return Ht.apply(this,arguments)},signTxns:function(t){return $t.apply(this,arguments)},execute:function(t){return ne.apply(this,arguments)},getBootstrapFundingTxnAmount:Zt};!function(t){t[t.FUNDING_TXN=0]="FUNDING_TXN",t[t.VALIDATOR_APP_CALL=1]="VALIDATOR_APP_CALL"}(re||(re={}));var ae=5,oe=6;function ie(t,e){return ue.apply(this,arguments)}function ue(){return(ue=c(i().mark((function e(n,r){var s,a,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(a=null===(s=r.find((function(t){return"appl"===t.txn.type})))||void 0===s?void 0:s.txn.txID())){e.next=7;break}return e.next=4,t.waitForConfirmation(n,a,1e3);case 4:e.t0=e.sent,e.next=8;break;case 7:e.t0=void 0;case 8:return o=e.t0,e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ce(t,e){return pe.apply(this,arguments)}function pe(){return(pe=c(i().mark((function t(e,n){var r;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ie(e,n);case 2:return r=t.sent,t.abrupt("return",null==r?void 0:r["inner-txns"]);case 4:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function le(){return(le=c(i().mark((function e(n){var s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,_,w,D;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.client,a=n.network,o=n.asset_1,u=n.asset_2,c=n.initiatorAddr,e.next=3,s.getTransactionParams().do();case 3:return p=e.sent,l=ft(a,ut.V2),d=t.getApplicationAddress(l),f=st(o,u),m=y(f,2),g=m[0].id,I=m[1].id,e.next=9,Jt.v2.getPoolInfo({client:s,network:a,asset1ID:g,asset2ID:I});case 9:if(e.sent.status!==exports.PoolStatus.READY){e.next=12;break}throw new Error("Pool for ".concat(o.unit_name,"-").concat(u.unit_name," already exists"));case 12:return A=Tt.generateLogicSigAccountForPool({network:a,asset1ID:g,asset2ID:I}),x=A.address(),h=ot(I),(T=r.default.makeApplicationOptInTxnFromObject({from:x,appIndex:l,appArgs:[tt("bootstrap")],note:lt.getAppCallTxnNoteWithClientName(ut.V2),foreignAssets:[g,I],rekeyTo:d,suggestedParams:p})).fee=fe(h),v=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:c,to:x,amount:de(h),suggestedParams:p}),(_=[])[re.FUNDING_TXN]=v,_[re.VALIDATOR_APP_CALL]=T,w=r.default.assignGroupID(_),(D=[])[re.FUNDING_TXN]={txn:w[re.FUNDING_TXN],signers:[c]},D[re.VALIDATOR_APP_CALL]={txn:w[re.VALIDATOR_APP_CALL],signers:[x]},e.abrupt("return",D);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function de(t){return function(t,e){var n=vt(t).schema,r=4e5+28500*n.numLocalInts+5e4*n.numLocalByteSlices;return e||(r+=1e5),r}(ut.V2,t)+fe(t)+1e5}function fe(e){return((e?ae:oe)+1)*t.ALGORAND_MIN_TX_FEE}function me(){return(me=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.txGroup,s=e.network,a=e.initiatorSigner,o=e.asset1ID,u=e.asset2ID,t.next=3,a([n]);case 3:return c=t.sent,p=y(c,1),l=p[0],d=at(o,u),f=y(d,2),m=f[0],g=f[1],I=Tt.generateLogicSigAccountForPool({network:s,asset1ID:m,asset2ID:g}),A=[],x=n.map((function(t,e){if(e===re.FUNDING_TXN)return A.push(t.txn.txID().toString()),l;var n=r.default.signLogicSigTransactionObject(t.txn,I),s=n.txID,a=n.blob;return A.push(s),a})),t.abrupt("return",{signedTxns:x,txnIDs:A});case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function ge(){return(ge=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.network,s=e.pool,a=s.asset1ID,o=s.asset2ID,u=e.txGroup,c=e.signedTxns,t.prev=1,t.next=4,n.sendRawTransaction(c).do();case 4:return t.next=6,ie(n,u);case 6:if(t.t1=p=t.sent,t.t0=null===t.t1,t.t0){t.next=10;break}t.t0=void 0===p;case 10:if(!t.t0){t.next=14;break}t.t2=void 0,t.next=15;break;case 14:t.t2=null===(l=p["local-state-delta"][0].delta)||void 0===l||null===(d=l.find((function(t){return t.key===btoa(Pt.v2.poolTokenID)})))||void 0===d?void 0:d.value.uint;case 15:if("number"==typeof(f=t.t2)){t.next=18;break}throw new Error("Generated ID is not valid: got ".concat(f));case 18:return t.abrupt("return",Jt.v2.getPoolInfo({client:n,network:r,asset1ID:a,asset2ID:o}));case 21:throw t.prev=21,t.t3=t.catch(1),new P(t.t3,"We encountered something unexpected while bootstraping the pool. Try again later.");case 24:case"end":return t.stop()}}),t,null,[[1,21]])})))).apply(this,arguments)}var Ie,Ae={generateTxns:function(t){return le.apply(this,arguments)},signTxns:function(t){return me.apply(this,arguments)},execute:function(t){return ge.apply(this,arguments)},getBootstrapFundingTxnAmount:de,getTotalCost:function(e){return t.ALGORAND_MIN_TX_FEE+de(e)}};var xe,he=(f(Ie={},ut.V1_1,se),f(Ie,ut.V2,Ae),f(Ie,"generateTxns",(function(t){return t.contractVersion===ut.V1_1?se.generateTxns(t):Ae.generateTxns(t)})),f(Ie,"signTxns",(function(t){return t.contractVersion===ut.V1_1?se.signTxns(t):Ae.signTxns(t)})),f(Ie,"execute",(function(t){return t.contractVersion===ut.V1_1?se.execute(t):Ae.execute(t)})),f(Ie,"calculateBootstrapFundingTxnAmount",(function(t){var e=t.contractVersion,n=t.isAlgoPool;return e===ut.V1_1?se.getBootstrapFundingTxnAmount(n):Ae.getBootstrapFundingTxnAmount(n)})),Ie);exports.V1_1AddLiquidityTxnIndices=void 0,(xe=exports.V1_1AddLiquidityTxnIndices||(exports.V1_1AddLiquidityTxnIndices={}))[xe.FEE_TXN=0]="FEE_TXN",xe[xe.VALIDATOR_APP_CALL_TXN=1]="VALIDATOR_APP_CALL_TXN",xe[xe.ASSET1_IN_TXN=2]="ASSET1_IN_TXN",xe[xe.ASSET2_IN_TXN=3]="ASSET2_IN_TXN",xe[xe.LIQUDITY_OUT_TXN=4]="LIQUDITY_OUT_TXN";var Te,ve,ye,_e,we=5*t.ALGORAND_MIN_TX_FEE;exports.V2AddLiquidityType=void 0,(_e=exports.V2AddLiquidityType||(exports.V2AddLiquidityType={})).SINGLE="single",_e.FLEXIBLE="flexible",_e.INITIAL="initial";var De,be=(f(Te={},exports.V2AddLiquidityType.FLEXIBLE,{ASSET1_IN_TXN:0,ASSET2_IN_TXN:1,VALIDATOR_APP_CALL_TXN:2}),f(Te,exports.V2AddLiquidityType.SINGLE,{ASSET_IN_TXN:0,VALIDATOR_APP_CALL_TXN:1}),f(Te,exports.V2AddLiquidityType.INITIAL,{ASSET1_IN_TXN:0,ASSET2_IN_TXN:1,VALIDATOR_APP_CALL_TXN:2}),Te),Ee=(f(ve={},exports.V2AddLiquidityType.INITIAL,1),f(ve,exports.V2AddLiquidityType.SINGLE,2),f(ve,exports.V2AddLiquidityType.FLEXIBLE,2),ve),Se=(f(ye={},exports.V2AddLiquidityType.INITIAL,3),f(ye,exports.V2AddLiquidityType.FLEXIBLE,3),f(ye,exports.V2AddLiquidityType.SINGLE,2),ye);function Ne(t){var e=t.assetIn,n=t.assetOut;return G(n.decimals,Number(n.amount))/G(e.decimals,Number(e.amount))}function Oe(t){var e=t.inputSupply,n=t.outputSupply,r=t.assetIn,s=t.assetOut,a=Ne({assetIn:r,assetOut:s}),o=G(s.decimals,Number(n))/G(r.decimals,Number(e));return W({decimalPlaces:5},Math.abs(a/o-1))}function Pe(t){var e,n,r,s=t.reserves,a=t.totalFeeShare,o=t.asset1,i=t.asset2,u=s.asset1*s.asset2,c=s.asset1+BigInt(o.amount),p=s.asset2+BigInt(i.amount),l=c*p,d=BigInt(parseInt(String(Math.sqrt(Number(l*s.issuedLiquidity*s.issuedLiquidity/u))))),f=d-s.issuedLiquidity,m=f*c/d,g=f*p/d,I=BigInt(o.amount)-m,A=BigInt(i.amount)-g;if(I>A){var x=I;r=ke(x,a),e={id:o.id,amount:x+r,decimals:o.decimals,reserves:s.asset1},n={id:i.id,amount:BigInt(Math.abs(Math.min(Number(A),0))),decimals:i.decimals,reserves:s.asset2},f-=r*d/(c*BigInt(2))}else{var h=A;r=ke(h,a),e={id:i.id,amount:h+r,decimals:i.decimals,reserves:s.asset2},n={id:o.id,amount:BigInt(Math.abs(Math.min(Number(I),0))),decimals:o.decimals,reserves:s.asset1},f-=r*d/(p*BigInt(2))}return{poolTokenOutAmount:f,internalSwapQuote:{assetIn:e,assetOut:n,swapFees:r,priceImpact:Oe({inputSupply:e.reserves,outputSupply:n.reserves,assetIn:e,assetOut:n})}}}function ke(t,e){return t*BigInt(e)/(BigInt(1e4)-BigInt(e))}function Le(e){return(Ee[e]+1)*t.ALGORAND_MIN_TX_FEE}var Fe=tt("add_liquidity"),Be=(f(De={},ut.V1_1,[tt("mint")]),f(De,ut.V2,{INITIAL_LIQUIDITY:[tt("add_initial_liquidity")],SINGLE_ASSET_MODE:[Fe,tt("single")],FLEXIBLE_MODE:[Fe,tt("flexible")]}),De);function Re(){return(Re=c(i().mark((function t(e){var n,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,a=e.network,o=e.poolAddress,u=e.asset1In,c=e.asset2In,p=e.poolTokenOut,l=e.slippage,d=e.initiatorAddr,f=U("negative",l,p.amount),t.next=4,n.getTransactionParams().do();case 4:return m=t.sent,g=r.default.makeApplicationNoOpTxnFromObject({from:o,appIndex:ft(a,ut.V1_1),appArgs:Be.v1_1,accounts:[d],note:lt.getAppCallTxnNoteWithClientName(ut.V1_1),foreignAssets:0==c.id?[u.id,p.id]:[u.id,c.id,p.id],suggestedParams:m}),I=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:d,to:o,assetIndex:u.id,amount:u.amount,suggestedParams:m}),A=0===c.id?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:d,to:o,amount:c.amount,suggestedParams:m}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:d,to:o,assetIndex:c.id,amount:c.amount,suggestedParams:m}),x=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:o,to:d,assetIndex:p.id,amount:f,suggestedParams:m}),h=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:d,to:o,amount:g.fee+x.fee,note:s,suggestedParams:m}),T=r.default.assignGroupID([h,g,I,A,x]),t.abrupt("return",[{txn:T[0],signers:[d]},{txn:T[1],signers:[o]},{txn:T[2],signers:[d]},{txn:T[3],signers:[d]},{txn:T[4],signers:[o]}]);case 12:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Me(){return(Me=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pool,s=e.txGroup,a=e.initiatorSigner,o=n.account,t.next=4,a([s]);case 4:return u=t.sent,c=y(u,3),p=c[0],l=c[1],d=c[2],f=s.map((function(t,e){return e===exports.V1_1AddLiquidityTxnIndices.FEE_TXN?p:e===exports.V1_1AddLiquidityTxnIndices.ASSET1_IN_TXN?l:e===exports.V1_1AddLiquidityTxnIndices.ASSET2_IN_TXN?d:r.default.signLogicSigTransactionObject(t.txn,o).blob})),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ce(){return(Ce=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.txGroup,a=e.signedTxns,o=e.initiatorAddr,t.prev=1,u=BigInt(s[exports.V1_1AddLiquidityTxnIndices.LIQUDITY_OUT_TXN].txn.amount),t.next=5,St({client:n,pool:r,accountAddr:o});case 5:return c=t.sent,t.next=8,Y(n,[a]);case 8:return p=t.sent,l=y(p,1),d=l[0],f=d.confirmedRound,m=d.txnID,g=H(s),I=Z(s),t.next=17,St({client:n,pool:r,accountAddr:o});case 17:return A=t.sent,(x=A.excessPoolTokens-c.excessPoolTokens)<0n&&(x=0n),t.abrupt("return",{round:f,fees:g,poolTokenID:r.poolTokenID,poolTokenOut:u+x,excessAmount:{excessAmountForAddingLiquidity:x,totalExcessAmount:A.excessPoolTokens},txnID:m,groupID:I});case 23:throw t.prev=23,t.t0=t.catch(1),"SlippageTolerance"===(h=new P(t.t0,"We encountered something unexpected while adding liquidity. Try again later.")).type&&h.setMessage("Adding liquidity failed due to too much slippage in the price. Please adjust the slippage tolerance and try again."),h;case 28:case"end":return t.stop()}}),t,null,[[1,23]])})))).apply(this,arguments)}var Ve=Object.freeze({__proto__:null,getQuote:function(t){var e=t.pool,n=t.reserves,r=t.asset1In,s=t.asset2In;if(0n===n.issuedLiquidity){var a=BigInt(Math.floor(Math.sqrt(Number(r)*Number(s))));if(a<=BigInt(1e3))throw new Error("Initial liquidity amount is too small. The amount must be greater than ".concat(1e3,", this quote is for ").concat(a,"."));return{round:n.round,asset1ID:e.asset1ID,asset1In:BigInt(r),asset2ID:e.asset2ID,asset2In:BigInt(s),poolTokenID:e.poolTokenID,poolTokenOut:a-BigInt(1e3),share:1}}var o=BigInt(r)*n.issuedLiquidity/n.asset1,i=BigInt(s)*n.issuedLiquidity/n.asset2,u=o0&&void 0!==arguments[0]?arguments[0]:"Output amount exceeds available liquidity";return p(this,n),e.call(this,t)}return d(n)}();function gn(){return(gn=c(i().mark((function t(e){var n,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,s=e.pool,a=e.swapType,o=e.assetIn,u=e.assetOut,c=e.initiatorAddr,p=e.slippage,l=s.account.address(),(d=[s.asset1ID,s.asset2ID]).includes(o.id)&&d.includes(u.id)&&o.id!==u.id){t.next=5;break}throw new P({pool:s,assetIn:o,assetOut:u},"Input asset (#".concat(o.id,") and output asset (#").concat(u.id,") provided to generate transactions do not belong to the pool ").concat(l,"."));case 5:return t.next=7,n.getTransactionParams().do();case 7:return f=t.sent,m=ot(o.id),g=a===exports.SwapType.FixedInput?o.amount:U("positive",p,o.amount),I=a===exports.SwapType.FixedOutput?u.amount:U("negative",p,u.amount),A=m?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:c,to:l,amount:g,suggestedParams:f}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:c,to:l,amount:g,assetIndex:o.id,suggestedParams:f}),(x=r.default.makeApplicationNoOpTxnFromObject({from:c,appIndex:s.validatorAppID,appArgs:[dn,fn[a],r.default.encodeUint64(I)],note:lt.getAppCallTxnNoteWithClientName(ut.V2),accounts:[l],foreignAssets:[s.asset1ID,s.asset2ID],suggestedParams:f})).fee=In(a),(h=[])[cn.INPUT_TXN]=A,h[cn.APP_CALL_TXN]=x,T=r.default.assignGroupID(h),t.abrupt("return",[{txn:T[cn.INPUT_TXN],signers:[c]},{txn:T[cn.APP_CALL_TXN],signers:[c]}]);case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function In(e){return(ln[e]+1)*t.ALGORAND_MIN_TX_FEE}function An(){return(An=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x,h;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=e.client,a=e.pool,o=e.txGroup,u=e.signedTxns,c=e.network,p=e.assetIn,t.next=3,Y(s,[u]);case 3:return l=t.sent,d=y(l,1),f=d[0],m=f.confirmedRound,g=f.txnID,t.next=10,ce(s,o);case 10:return I=t.sent,A=[a.asset1ID,a.asset2ID].filter((function(t){return t!==p.id}))[0],x=null==I||null===(n=I.find((function(t){return t.txn.txn.xaid===p.id})))||void 0===n?void 0:n.txn.txn,h=null==I||null===(r=I.find((function(t){return t.txn.txn.xaid===A})))||void 0===r?void 0:r.txn.txn,t.t0=m,t.t1=x&&{amount:BigInt(p.amount)-BigInt(x.aamt||0),id:p.id},t.t2=h&&{amount:h.aamt,id:A},t.next=19,Jt.v2.getPoolInfo({client:s,network:c,asset1ID:a.asset1ID,asset2ID:a.asset2ID});case 19:return t.t3=t.sent,t.t4=g,t.abrupt("return",{round:t.t0,assetIn:t.t1,assetOut:t.t2,pool:t.t3,txnID:t.t4});case 22:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function xn(t){var e=t.pool,n=t.assetIn,r=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetIn:n},"Trying to swap on a non-existent pool");var s,a,o,i=BigInt(n.amount),u=e.totalFeeShare;if(n.id===e.asset1ID)s=e.asset2ID,a=e.asset1Reserves,o=e.asset2Reserves;else{if(n.id!==e.asset2ID)throw new P({pool:e,assetIn:n},"Input asset (#".concat(n.id,") doesn't belong to the pool ").concat(e.account.address(),"."));s=e.asset1ID,a=e.asset2Reserves,o=e.asset1Reserves}var c=Tn({inputSupply:a,outputSupply:o,swapInputAmount:i,totalFeeShare:u,decimals:r}),p=c.swapOutputAmount,l=c.totalFeeAmount,d=c.priceImpact;if(p>o)throw new mn;return{assetInID:n.id,assetInAmount:i,assetOutID:s,assetOutAmount:p,swapFee:Number(l),rate:G(r.assetOut,Number(p))/G(r.assetIn,Number(i)),priceImpact:d}}function hn(t){var e=t.pool,n=t.assetOut,r=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetOut:n},"Trying to swap on a non-existent pool");var s,a,o,i=BigInt(n.amount),u=e.totalFeeShare;if(n.id===e.asset1ID)s=e.asset2ID,a=e.asset2Reserves,o=e.asset1Reserves;else{if(n.id!==e.asset2ID)throw new P({pool:e,assetOut:n},"Output asset (#".concat(n.id,") doesn't belong to the pool ").concat(e.account.address(),"."));s=e.asset1ID,a=e.asset1Reserves,o=e.asset2Reserves}var c=function(t){var e=t.inputSupply,n=t.outputSupply,r=t.swapOutputAmount,s=t.totalFeeShare,a=t.decimals,o=function(t){var e=t.inputSupply,n=t.outputSupply,r=t.outputAmount,s=BigInt(e*n/(n-r))-e;return s+=BigInt(1)}({inputSupply:e,outputSupply:n,outputAmount:r}),i=function(t){var e=t.swapAmount,n=t.totalFeeShare,r=Math.floor(Number(e*BigInt(1e4)/(BigInt(1e4)-BigInt(n))));return BigInt(r)-e}({swapAmount:o,totalFeeShare:s}),u=o+i,c=Oe({inputSupply:e,outputSupply:n,assetIn:{amount:u,decimals:a.assetIn},assetOut:{amount:r,decimals:a.assetOut}});return{swapInputAmount:u,totalFeeAmount:i,priceImpact:c}}({inputSupply:a,outputSupply:o,swapOutputAmount:i,totalFeeShare:u,decimals:r}),p=c.swapInputAmount,l=c.totalFeeAmount,d=c.priceImpact;if(i>o)throw new mn;return{assetInID:s,assetInAmount:p,assetOutID:n.id,assetOutAmount:i,swapFee:Number(l),rate:G(r.assetOut,Number(i))/G(r.assetIn,Number(p)),priceImpact:d}}function Tn(t){var e=t.inputSupply,n=t.outputSupply,r=t.swapInputAmount,s=t.totalFeeShare,a=t.decimals,o=BigInt(function(t){var e=t.inputAmount,n=t.totalFeeShare;return Math.floor(Number(e*BigInt(n))/1e4)}({inputAmount:r,totalFeeShare:s})),i=function(t){var e=t.inputSupply,n=t.outputSupply,r=t.swapAmount,s=n-BigInt(e*n/(e+BigInt(r)));return s-=BigInt(1)}({inputSupply:e,outputSupply:n,swapAmount:r-o});return{swapOutputAmount:i,totalFeeAmount:o,priceImpact:Oe({inputSupply:e,outputSupply:n,assetIn:{amount:r,decimals:a.assetIn},assetOut:{amount:i,decimals:a.assetOut}})}}var vn={getQuote:function(t,e,n,r){return t===exports.SwapType.FixedInput?xn({pool:e,assetIn:n,decimals:r}):hn({pool:e,assetOut:n,decimals:r})},getFixedInputSwapQuote:xn,getFixedOutputSwapQuote:hn,generateTxns:function(t){return gn.apply(this,arguments)},signTxns:function(t){var e=t.txGroup;return(0,t.initiatorSigner)([e])},execute:function(t){return An.apply(this,arguments)},calculateFixedInputSwap:Tn};function yn(t,e){var n,r,s=BigInt(t),a=e.issuedLiquidity;return a>s+BigInt(1e3)?(n=s*e.asset1/a,r=s*e.asset2/a):(n=e.asset1,r=e.asset2),{asset1OutputAmount:n,asset2OutputAmount:r}}function _n(){return(_n=c(i().mark((function e(n){var s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.client,a=n.pool,o=n.poolTokenIn,u=n.initiatorAddr,c=n.minAsset1Amount,p=n.minAsset2Amount,l=n.slippage,e.next=3,s.getTransactionParams().do();case 3:if(d=e.sent,f=a.account.address(),m=a.poolTokenID){e.next=8;break}throw new Error("Pool token asset ID is missing");case 8:return g=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:u,to:f,assetIndex:m,amount:o,suggestedParams:d}),(I=r.default.makeApplicationNoOpTxnFromObject({from:u,appIndex:a.validatorAppID,note:lt.getAppCallTxnNoteWithClientName(ut.V2),appArgs:[en,r.default.encodeUint64(U("negative",l,c)),r.default.encodeUint64(U("negative",l,p))],accounts:[f],foreignAssets:[a.asset1ID,a.asset2ID],suggestedParams:d})).fee=3*t.ALGORAND_MIN_TX_FEE,(A=[])[$e.ASSET_TRANSFER_TXN]=g,A[$e.APP_CALL_TXN]=I,x=r.default.assignGroupID(A),e.abrupt("return",[{txn:x[$e.ASSET_TRANSFER_TXN],signers:[u]},{txn:x[$e.APP_CALL_TXN],signers:[u]}]);case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wn(){return(wn=c(i().mark((function e(n){var s,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,y,_;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=n.client,a=n.pool,o=n.initiatorAddr,u=n.poolTokenIn,c=n.outputAssetId,p=n.minOutputAssetAmount,l=n.slippage,e.next=3,s.getTransactionParams().do();case 3:if(d=e.sent,f=a.asset1ID,m=a.asset2ID,g=a.account.address(),I=a.poolTokenID){e.next=9;break}throw new Error("Pool token asset ID is missing");case 9:if(A=0,x=0,h=U("negative",l,p),c!==f){e.next=17;break}A=h,x=0,e.next=23;break;case 17:if(c!==m){e.next=22;break}A=0,x=h,e.next=23;break;case 22:throw new Error("Invalid output asset id. It doesn't match with pool assets");case 23:return T=r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:o,to:g,assetIndex:I,amount:u,suggestedParams:d}),(v=r.default.makeApplicationNoOpTxnFromObject({from:o,appIndex:a.validatorAppID,note:lt.getAppCallTxnNoteWithClientName(ut.V2),appArgs:[en,r.default.encodeUint64(A),r.default.encodeUint64(x)],accounts:[g],foreignAssets:[c],suggestedParams:d})).fee=3*t.ALGORAND_MIN_TX_FEE,(y=[])[$e.ASSET_TRANSFER_TXN]=T,y[$e.APP_CALL_TXN]=v,_=r.default.assignGroupID(y),e.abrupt("return",[{txn:_[$e.ASSET_TRANSFER_TXN],signers:[o]},{txn:_[$e.APP_CALL_TXN],signers:[o]}]);case 31:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Dn(){return(Dn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.client,s=e.txGroup,a=e.signedTxns,t.next=3,Y(r,[a]);case 3:return o=t.sent,u=y(o,1),c=u[0].txnID,t.next=8,ce(r,s);case 8:if(t.t1=n=t.sent,t.t0=null===t.t1,t.t0){t.next=12;break}t.t0=void 0===n;case 12:if(!t.t0){t.next=16;break}t.t2=void 0,t.next=17;break;case 16:t.t2=n.map((function(t){return{assetId:t.txn.txn.xaid,amount:t.txn.txn.aamt}}));case 17:return p=t.t2,t.abrupt("return",{outputAssets:p,txnID:c});case 19:case"end":return t.stop()}}),t)})))).apply(this,arguments)}var bn,En,Sn={getQuote:function(t){var e=t.pool,n=t.reserves,r=t.poolTokenIn,s=BigInt(r),a=yn(s,n),o=a.asset1OutputAmount,i=a.asset2OutputAmount;return{round:n.round,asset1Out:{assetId:e.asset1ID,amount:o},asset2Out:{assetId:e.asset2ID,amount:i},poolTokenIn:{assetId:e.poolTokenID,amount:s}}},getSingleAssetRemoveLiquidityQuote:function(t){var e,n=t.pool,r=t.reserves,s=t.poolTokenIn,a=t.assetOutID,o=t.decimals,i=BigInt(s),u=yn(i,r),c=u.asset1OutputAmount,p=u.asset2OutputAmount,l=n.totalFeeShare;if(a===n.asset1ID){var d=vn.calculateFixedInputSwap({inputSupply:r.asset2-p,outputSupply:r.asset1-c,swapInputAmount:p,totalFeeShare:l,decimals:o}),f=d.swapOutputAmount,m=d.totalFeeAmount,g=d.priceImpact;e={round:r.round,assetOut:{assetId:a,amount:c+f},poolTokenIn:{assetId:n.poolTokenID,amount:i},internalSwapQuote:{amountIn:{assetId:n.asset2ID,amount:p},amountOut:{assetId:n.asset1ID,amount:f},swapFees:{assetId:n.asset2ID,amount:m},priceImpact:g}}}else{if(a!==n.asset2ID)throw new Error("assetOutID must be one of the pool assets");var I=vn.calculateFixedInputSwap({inputSupply:r.asset1-c,outputSupply:r.asset2-p,swapInputAmount:c,totalFeeShare:l,decimals:o}),A=I.swapOutputAmount,x=I.totalFeeAmount,h=I.priceImpact;e={round:r.round,assetOut:{assetId:a,amount:p+A},poolTokenIn:{assetId:n.poolTokenID,amount:i},internalSwapQuote:{amountIn:{assetId:n.asset2ID,amount:p},amountOut:{assetId:n.asset1ID,amount:A},swapFees:{assetId:n.asset2ID,amount:x},priceImpact:h}}}return e},generateTxns:function(t){return _n.apply(this,arguments)},generateSingleAssetOutTxns:function(t){return wn.apply(this,arguments)},signTxns:function(t){var e=t.txGroup;return(0,t.initiatorSigner)([e])},execute:function(t){return Dn.apply(this,arguments)}},Nn=(f(bn={},ut.V1_1,pn),f(bn,ut.V2,Sn),bn),On=3n,Pn=1000n;function kn(){return(kn=c(i().mark((function t(e){var n,s,a,o,u,c,p,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pool,s=e.txGroup,a=e.initiatorSigner,t.next=3,a([s]);case 3:return o=t.sent,u=y(o,2),c=u[0],p=u[1],l=s.map((function(t,e){return e===En.FEE_TXN_INDEX?c:e===En.ASSET_IN_TXN_INDEX?p:r.default.signLogicSigTransactionObject(t.txn,n.account.lsig).blob})),t.abrupt("return",l);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Ln(){return(Ln=c(i().mark((function t(e){var n,a,o,u,c,p,l,d,f,m,g,I,A,x,h,T,v,y;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,a=e.pool,o=e.swapType,u=e.assetIn,c=e.assetOut,p=e.slippage,l=e.initiatorAddr,d=a.account.address(),(f=[a.asset1ID,a.asset2ID]).includes(u.id)&&f.includes(c.id)&&u.id!==c.id){t.next=5;break}throw new P({pool:a,assetIn:u,assetOut:c},"Input asset (#".concat(u.id,") and output asset (#").concat(c.id,") provided to generate transactions do not belong to the pool ").concat(d,"."));case 5:return t.next=7,n.getTransactionParams().do();case 7:return m=t.sent,g=[tt("swap"),o===exports.SwapType.FixedInput?tt("fi"):tt("fo")],I=r.default.makeApplicationNoOpTxnFromObject({from:d,appIndex:a.validatorAppID,appArgs:g,accounts:[l],note:lt.getAppCallTxnNoteWithClientName(ut.V1_1),foreignAssets:0==a.asset2ID?[a.asset1ID,a.poolTokenID]:[a.asset1ID,a.asset2ID,a.poolTokenID],suggestedParams:m}),A=o===exports.SwapType.FixedOutput?U("positive",p,u.amount):u.amount,x=0===u.id?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:l,to:d,amount:A,suggestedParams:m}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:l,to:d,assetIndex:u.id,amount:A,suggestedParams:m}),h=o===exports.SwapType.FixedInput?U("negative",p,c.amount):c.amount,T=0===c.id?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:d,to:l,amount:h,suggestedParams:m}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:d,to:l,assetIndex:c.id,amount:h,suggestedParams:m}),v=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:l,to:d,amount:I.fee+T.fee,note:s,suggestedParams:m}),y=r.default.assignGroupID([v,I,x,T]),t.abrupt("return",[{txn:y[0],signers:[l]},{txn:y[1],signers:[d]},{txn:y[2],signers:[l]},{txn:y[3],signers:[d]}]);case 17:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Fn(t){var e=t.pool,n=t.reserves,r=t.assetIn,s=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetIn:r},"Trying to swap on a non-existent pool");var a,i,u,c=BigInt(r.amount);if(r.id===e.asset1ID)a=e.asset2ID,i=n.asset1,u=n.asset2;else{if(r.id!==e.asset2ID)throw new P({pool:e,assetIn:r},"Input asset (#".concat(r.id,") doesn't belong to the pool ").concat(e.account.address(),"."));a=e.asset1ID,i=n.asset2,u=n.asset1}var p=c*On/Pn,l=u-i*u/(i+(c-p));if(l>u)throw new mn;var d={assetIn:{amount:c,decimals:s.assetIn},assetOut:{amount:l,decimals:s.assetOut}};return{round:n.round,assetInID:r.id,assetInAmount:c,assetOutID:a,assetOutAmount:l,swapFee:Number(p),rate:Ne(d),priceImpact:Oe(o({inputSupply:i,outputSupply:u},d))}}function Bn(t){return Rn.apply(this,arguments)}function Rn(){return(Rn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.signedTxns,a=e.assetIn,o=e.assetOut,u=e.initiatorAddr,t.next=3,St({client:n,pool:r,accountAddr:u});case 3:return c=t.sent,t.next=6,Y(n,[s]);case 6:return p=t.sent,l=y(p,1),d=l[0],f=d.confirmedRound,m=d.txnID,t.next=13,St({client:n,pool:r,accountAddr:u});case 13:return g=t.sent,o.id===r.asset1ID?(I=c.excessAsset1,A=g.excessAsset1):(I=c.excessAsset2,A=g.excessAsset2),(x=A-I)<0n&&(x=0n),t.abrupt("return",{round:f,assetInID:a.id,assetInAmount:BigInt(a.amount),assetOutID:o.id,assetOutAmount:BigInt(o.amount)+x,excessAmount:{assetID:o.id,excessAmountForSwap:x,totalExcessAmount:A},txnID:m});case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Mn(t){var e=t.pool,n=t.reserves,r=t.assetOut,s=t.decimals;if(e.status!==exports.PoolStatus.READY)throw new P({pool:e,assetOut:r},"Trying to swap on a non-existent pool");var a,o,i,u=BigInt(r.amount);if(r.id===e.asset1ID)a=e.asset2ID,o=n.asset2,i=n.asset1;else{if(r.id!==e.asset2ID)throw new P({pool:e,assetOut:r},"Output asset (#".concat(r.id,") doesn't belong to the pool ").concat(e.account.address(),"."));a=e.asset1ID,o=n.asset1,i=n.asset2}if(u>i)throw new mn;var c=o*i/(i-u)-o,p=c*Pn/(Pn-On),l=p-c,d=G(s.assetOut,Number(u))/G(s.assetIn,Number(p)),f=G(s.assetOut,Number(i))/G(s.assetIn,Number(o)),m=W({decimalPlaces:5},Math.abs(d/f-1));return{round:n.round,assetInID:a,assetInAmount:p,assetOutID:r.id,assetOutAmount:u,swapFee:Number(l),rate:d,priceImpact:m}}function Cn(t){return Vn.apply(this,arguments)}function Vn(){return(Vn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d,f,m,g,I,A,x;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.signedTxns,a=e.assetIn,o=e.assetOut,u=e.initiatorAddr,t.next=3,St({client:n,pool:r,accountAddr:u});case 3:return c=t.sent,t.next=6,Y(n,[s]);case 6:return p=t.sent,l=y(p,1),d=l[0],f=d.confirmedRound,m=d.txnID,t.next=13,St({client:n,pool:r,accountAddr:u});case 13:return g=t.sent,a.id===r.asset1ID?(I=c.excessAsset1,A=g.excessAsset1):(I=c.excessAsset2,A=g.excessAsset2),(x=A-I)<0n&&(x=0n),t.abrupt("return",{round:f,assetInID:a.id,assetInAmount:BigInt(a.amount)-x,assetOutID:o.id,assetOutAmount:BigInt(o.amount),excessAmount:{assetID:a.id,excessAmountForSwap:x,totalExcessAmount:A},txnID:m});case 18:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Xn(){return(Xn=c(i().mark((function t(e){var n,r,s,a,u,c,p,l,d,f;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.client,r=e.pool,s=e.swapType,a=e.txGroup,u=e.signedTxns,c=e.initiatorAddr,r.status===exports.PoolStatus.READY){t.next=3;break}throw new P({pool:r,swapType:s,txGroup:a},"Trying to swap on a non-existent pool");case 3:if(t.prev=3,p={id:a[En.ASSET_IN_TXN_INDEX].txn.assetIndex||0,amount:a[En.ASSET_IN_TXN_INDEX].txn.amount},l={id:a[En.ASSET_OUT_TXN_INDEX].txn.assetIndex||0,amount:a[En.ASSET_OUT_TXN_INDEX].txn.amount},s!==exports.SwapType.FixedInput){t.next=12;break}return t.next=9,Bn({client:n,pool:r,signedTxns:u,assetIn:p,assetOut:l,initiatorAddr:c});case 9:d=t.sent,t.next=15;break;case 12:return t.next=14,Cn({client:n,pool:r,signedTxns:u,assetIn:p,assetOut:l,initiatorAddr:c});case 14:d=t.sent;case 15:return t.abrupt("return",o(o({},d),{},{groupID:Z(a),fees:H(a)}));case 18:throw t.prev=18,t.t0=t.catch(3),"SlippageTolerance"===(f=new P(t.t0,"We encountered something unexpected while swapping. Try again later.")).type&&f.setMessage("The swap failed due to too much slippage in the price. Please adjust the slippage tolerance and try again."),f;case 23:case"end":return t.stop()}}),t,null,[[3,18]])})))).apply(this,arguments)}!function(t){t[t.FEE_TXN_INDEX=0]="FEE_TXN_INDEX",t[t.VALIDATOR_APP_CALL_TXN_INDEX=1]="VALIDATOR_APP_CALL_TXN_INDEX",t[t.ASSET_IN_TXN_INDEX=2]="ASSET_IN_TXN_INDEX",t[t.ASSET_OUT_TXN_INDEX=3]="ASSET_OUT_TXN_INDEX"}(En||(En={}));var jn,Qn={getQuote:function(t,e,n,r,s){return t===exports.SwapType.FixedInput?Fn({pool:e,reserves:n,assetIn:r,decimals:s}):Mn({pool:e,reserves:n,assetOut:r,decimals:s})},getFixedInputSwapQuote:Fn,getFixedOutputSwapQuote:Mn,generateTxns:function(t){return Ln.apply(this,arguments)},signTxns:function(t){return kn.apply(this,arguments)},execute:function(t){return Xn.apply(this,arguments)},executeFixedOutputSwap:Cn},Un=4*t.ALGORAND_MIN_TX_FEE;function Gn(t){return Promise.allSettled(t).then((function(t){if(t.every((function(t){return"rejected"===t.status&&t.reason instanceof mn})))throw new mn;return t.filter((function(t){return"fulfilled"===t.status&&void 0!==t.value.quote})).map((function(t){return t.value}))}))}function qn(){return(qn=c(i().mark((function t(e){var n,r,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pools,r=e.assetIn,s=e.assetOut,a=e.amount,o=n.map((function(t){return new Promise((function(e,n){var o,i={pool:t.info,assetIn:{amount:a,id:Number(r.id)},decimals:{assetIn:r.decimals,assetOut:s.decimals},reserves:t.reserves};try{o=t.info.contractVersion===ut.V1_1?Qn.getFixedInputSwapQuote(i):vn.getFixedInputSwapQuote(i),e({pool:t,quote:o})}catch(t){n(t)}}))})),t.next=4,Gn(o);case 4:return u=t.sent,t.abrupt("return",zn(u));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Wn(){return(Wn=c(i().mark((function t(e){var n,r,s,a,o,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.pools,r=e.assetIn,s=e.assetOut,a=e.amount,o=n.map((function(t){return new Promise((function(e,n){var o,i={pool:t.info,assetOut:{amount:a,id:Number(s.id)},decimals:{assetIn:r.decimals,assetOut:s.decimals},reserves:t.reserves};try{o=t.info.contractVersion===ut.V1_1?Qn.getFixedOutputSwapQuote(i):vn.getFixedOutputSwapQuote(i),e({pool:t,quote:o})}catch(t){n(t)}}))})),t.next=4,Gn(o);case 4:return u=t.sent,t.abrupt("return",zn(u));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function zn(t){return t.filter((function(t){return!Gt(t.pool.reserves)})).sort((function(t,e){return e.quote.rate-t.quote.rate}))[0]}var Jn=(f(jn={},ut.V1_1,Qn),f(jn,ut.V2,vn),f(jn,"getQuote",(function(t){if(t.pools.every((function(t){return Gt(t.reserves)})))throw new Error("No pools available for swap");return t.type===exports.SwapType.FixedInput?function(t){return qn.apply(this,arguments)}(t):function(t){return Wn.apply(this,arguments)}(t)})),f(jn,"generateTxns",(function(t){return t.pool.contractVersion===ut.V1_1?Qn.generateTxns(t):vn.generateTxns(t)})),f(jn,"signTxns",(function(t){return t.pool.contractVersion===ut.V1_1?Qn.signTxns(t):vn.signTxns(t)})),f(jn,"execute",(function(t){return t.contractVersion===ut.V1_1?Qn.execute(t):vn.execute(t)})),jn);function Yn(){return(Yn=c(i().mark((function t(e){var n,r,s,a,o,u,c,p,l,d;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,r=e.pool,s=e.txGroup,a=e.initiatorSigner,t.prev=1,t.next=4,Kn({txGroup:s,pool:r,initiatorSigner:a});case 4:return o=t.sent,t.next=7,Y(n,[o]);case 7:return u=t.sent,c=y(u,1),p=c[0],l=p.txnID,d=p.confirmedRound,t.abrupt("return",{fees:H(s),confirmedRound:d,txnID:l,groupID:Z(s)});case 15:throw t.prev=15,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while redeeming. Try again later.");case 18:case"end":return t.stop()}}),t,null,[[1,15]])})))).apply(this,arguments)}function Kn(t){return Hn.apply(this,arguments)}function Hn(){return(Hn=c(i().mark((function t(e){var n,s,a,o,u,c,p,l;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.txGroup,s=e.pool,a=e.initiatorSigner,t.next=3,a([n]);case 3:return o=t.sent,u=y(o,1),c=u[0],p=s.account.lsig,l=n.map((function(t,e){return 0===e?c:r.default.signLogicSigTransactionObject(t.txn,p).blob})),t.abrupt("return",l);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Zn(){return Zn=c(i().mark((function t(e){var n,s,a,o,u,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,s=e.data,a=e.initiatorSigner,t.prev=1,o=s.map((function(t){var e=t.txGroup,n=t.pool;return{txns:e,txnFees:H(e),groupID:Z(e),lsig:n.account.lsig}})),t.next=5,a(o.map((function(t){return t.txns})));case 5:return u=t.sent,p=Promise.all(o.map((function(t,e){return new Promise(function(){var s=c(i().mark((function s(a,o){var c,p,l,d,f,m;return i().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,c=t.txns.map((function(n,s){return 0===s?u[e]:r.default.signLogicSigTransactionObject(n.txn,t.lsig).blob})),s.next=4,Y(n,[c]);case 4:p=s.sent,l=y(p,1),d=l[0],f=d.txnID,m=d.confirmedRound,a({fees:t.txnFees,groupID:t.groupID,txnID:f,confirmedRound:m}),s.next=15;break;case 12:s.prev=12,s.t0=s.catch(0),o(s.t0);case 15:case"end":return s.stop()}}),s,null,[[0,12]])})));return function(t,e){return s.apply(this,arguments)}}())}))),t.abrupt("return",p);case 10:throw t.prev=10,t.t0=t.catch(1),new P(t.t0,"We encountered something unexpected while redeeming. Try again later.");case 13:case"end":return t.stop()}}),t,null,[[1,10]])}))),Zn.apply(this,arguments)}function $n(){return($n=c(i().mark((function t(e){var n,a,o,u,c,p,l,d,f,m,g;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.client,a=e.pool,o=e.assetID,u=e.assetOut,c=e.initiatorAddr,t.next=3,n.getTransactionParams().do();case 3:return p=t.sent,l=a.account.address(),d=r.default.makeApplicationNoOpTxnFromObject({from:l,appIndex:a.validatorAppID,appArgs:[tt("redeem")],note:lt.getAppCallTxnNoteWithClientName(a.contractVersion),accounts:[c],foreignAssets:0==a.asset2ID?[a.asset1ID,a.poolTokenID]:[a.asset1ID,a.asset2ID,a.poolTokenID],suggestedParams:p}),f=0===o?r.default.makePaymentTxnWithSuggestedParamsFromObject({from:l,to:c,amount:BigInt(u),suggestedParams:p}):r.default.makeAssetTransferTxnWithSuggestedParamsFromObject({from:l,to:c,assetIndex:o,amount:BigInt(u),suggestedParams:p}),m=r.default.makePaymentTxnWithSuggestedParamsFromObject({from:c,to:l,amount:d.fee+f.fee,note:s,suggestedParams:p}),g=r.default.assignGroupID([m,d,f]),t.abrupt("return",[{txn:g[0],signers:[c]},{txn:g[1],signers:[l]},{txn:g[2],signers:[l]}]);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function tr(e){var n=e.suggestedParams,r=e.stakingAppID,s=e.initiatorAddr,a=e.liquidityAssetID,o=e.program,i=e.amount,u=t.encodeUint64(i),c=t.encodeUint64(o.id);return t.makeApplicationNoOpTxnFromObject({appIndex:r,from:s,suggestedParams:n,foreignAssets:[a],accounts:[o.accountAddress],appArgs:[tt("commit"),u],note:L([tt("tinymanStaking/v1:b"),c,t.encodeUint64(a),u])})}function er(){return(er=c(i().mark((function e(n){var r,s,a,o,u,c,p,l,d,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n.client,s=n.stakingAppID,a=n.program,o=n.requiredAssetID,u=n.liquidityAssetID,c=n.amount,p=n.initiatorAddr,e.next=3,r.getTransactionParams().do();case 3:if(l=e.sent,d=tr({suggestedParams:l,stakingAppID:s,program:a,liquidityAssetID:u,initiatorAddr:p,amount:c}),f=[d],"number"!=typeof o){e.next=10;break}return m=t.makeApplicationNoOpTxnFromObject({appIndex:s,from:p,suggestedParams:l,foreignAssets:[o],accounts:[a.accountAddress],appArgs:[tt("log_balance")]}),f=t.assignGroupID([d,m]),e.abrupt("return",[{txn:f[0],signers:[p]},{txn:f[1],signers:[p]}]);case 10:return e.abrupt("return",[{txn:f[0],signers:[p]}]);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}exports.ALGO_ASSET=et,exports.ALGO_ASSET_ID=0,exports.ASSET_OPT_IN_PROCESS_TXN_COUNT=1,exports.AddLiquidity=Ze,exports.BASE_MINIMUM_BALANCE=1e5,exports.Bootstrap=he,exports.CONTRACT_VERSION=ut,exports.MINIMUM_ADD_LIQUIDITY_AMOUNT=1e3,exports.MINIMUM_BALANCE_REQUIRED_PER_APP=1e5,exports.MINIMUM_BALANCE_REQUIRED_PER_ASSET=1e5,exports.MINIMUM_BALANCE_REQUIRED_PER_BYTE_SCHEMA=5e4,exports.MINIMUM_BALANCE_REQUIRED_PER_INT_SCHEMA_VALUE=28500,exports.OPT_IN_VALIDATOR_APP_PROCESS_TXN_COUNT=1,exports.OPT_OUT_VALIDATOR_APP_PROCESS_TXN_COUNT=1,exports.POOL_TOKEN_UNIT_NAME=nt,exports.REDEEM_PROCESS_TXN_COUNT=3,exports.RemoveLiquidity=Nn,exports.Swap=Jn,exports.V1_1_ADD_LIQUIDITY_PROCESS_TXN_COUNT=5,exports.V1_1_REMOVE_LIQUIDITY_TXN_COUNT=tn,exports.V2AddLiquidityTxnIndices=be,exports.V2_REMOVE_LIQUIDITY_APP_CALL_INNER_TXN_COUNT=2,exports.applySlippageToAmount=U,exports.calculateAccountMinimumRequiredBalance=wt,exports.combineAndRegroupSignerTxns=function(){for(var e=arguments.length,n=new Array(e),r=0;r=t.minimum_required_balance},exports.isAccountOptedIntoApp=function(t){var e=t.appID;return t.accountAppsLocalState.some((function(t){return t.id===e}))},exports.poolUtils=Jt,exports.prepareCommitTransactions=function(t){return er.apply(this,arguments)},exports.redeemAllExcessAsset=function(t){return Zn.apply(this,arguments)},exports.redeemExcessAsset=function(t){return Yn.apply(this,arguments)},exports.sendAndWaitRawTransaction=Y,exports.sumUpTxnFees=H,exports.tinymanContract_v1_1=At,exports.tinymanContract_v2=Tt,exports.tinymanJSSDKConfig=lt; diff --git a/dist/util/asset/assetModels.d.ts b/dist/util/asset/assetModels.d.ts index 05703bd2..80ef5c18 100644 --- a/dist/util/asset/assetModels.d.ts +++ b/dist/util/asset/assetModels.d.ts @@ -12,6 +12,7 @@ export interface TinymanAnalyticsApiAsset { decimals: number; url: string; total_amount: string; + clawback_address: string; liquidity_in_usd?: null | string; last_day_volume_in_usd?: null | string; last_day_price_change?: null | string; diff --git a/package-lock.json b/package-lock.json index 7207323a..f052bc4f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tinymanorg/tinyman-js-sdk", - "version": "2.0.7", + "version": "2.0.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tinymanorg/tinyman-js-sdk", - "version": "2.0.7", + "version": "2.0.8", "license": "MIT", "dependencies": { "algosdk": "^2.1.0", diff --git a/package.json b/package.json index aea65314..d4f15fcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tinymanorg/tinyman-js-sdk", - "version": "2.0.7", + "version": "2.0.8", "description": "Tinyman JS SDK", "author": "Tinyman Core Team", "license": "MIT", From 73e3203dae2ff04c531ec5527d92aadd3fa25efe Mon Sep 17 00:00:00 2001 From: Cem KIRAY Date: Thu, 23 Mar 2023 09:25:24 +0100 Subject: [PATCH 5/5] chore: bump up middle package version --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f052bc4f..5b73689a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@tinymanorg/tinyman-js-sdk", - "version": "2.0.8", + "version": "2.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@tinymanorg/tinyman-js-sdk", - "version": "2.0.8", + "version": "2.1.0", "license": "MIT", "dependencies": { "algosdk": "^2.1.0", diff --git a/package.json b/package.json index d4f15fcb..de9a81a4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tinymanorg/tinyman-js-sdk", - "version": "2.0.8", + "version": "2.1.0", "description": "Tinyman JS SDK", "author": "Tinyman Core Team", "license": "MIT",