{"_id":"@anchor-protocol/anchor-earn","_rev":"27-7d5156edcd68eccff958cf9a93577654","name":"@anchor-protocol/anchor-earn","dist-tags":{"bombay":"1.1.0-alpha.2","alpha":"2.0.0-alpha1","latest":"2.0.0"},"versions":{"1.0.0":{"name":"@anchor-protocol/anchor-earn","version":"1.0.0","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.0.0","maintainers":[{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"saad.najafi","email":"najafi@snu.ac.kr"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"ssen","email":"i@ssen.name"}],"dist":{"shasum":"e8c64ec6d5c3844eb43f368052b20f649487b9af","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.0.0.tgz","fileCount":78,"integrity":"sha512-+7MHrvlaMOlgsbBBKcfo+1ercgXAmrMbEAZIprCOylnNJJM/FtOy3EI7vzMnzdNgNnxb3dxZ2xUUdZFJT4UC7A==","signatures":[{"sig":"MEQCICVh3FKUBELQkQPpRcEodFMOIvvXIvffBd5O4F3qPuzZAiAl1EuCOCll49PzhGCQLwSrBdmU1ETzJHPLYMTz2VseCw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":129322,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgmpy7CRA9TVsSAnZWagAAZbMP/153TcjNM1orhMx/Eyxm\ngZIpWIZPPSv1u2N+U0+PgtlSDC22gZtrcdzq1gbqnUjUQM10GjVqvcMsFFBf\nr/+/BLvF3k/MBZTRdEqFAt8wLRSRaGrhWp4An2FDEfmE6jGxotozD/x7c0wi\nqshdUyjyBzB1dpXfjFCtgYVgjXmaUI6h08zEypQjaDcoay9oglZDmcx2dG6s\n5MBWNdxorH/bNW8F+Pb/dRd7/Ou/Bdo/63VsJTcJ3639j6ZPXFP9xjBzv9fl\nuuH9kuR0/JsvYIwCWlLmWFJBIA2KRH6BvkXcfUAo2sJ7XFPNQ5FIZMG8kn1d\nDOJohaFHjh7GquVvVmN98C0Q4OUgHw9bfcrL0ADKO7hUVUuH61W0IaGtMr2w\nGo4vrozGQckkpGDfgNHq1Ac6lkX1Yv7Szk4gM6LHhoqcCQfTdSzjCViLMvFD\nthYP1iXLFMmN/frKCxoxfCjl9PRrlxYhoVSwEY245FbdejgZIWspIV3TA9VO\npN6J4qNd8DBODVbAZMiLK/syeOTcOUaNEtbvQ8stBL7JtnWft00cs0bcPp/N\n7ozZ7+qGxr5Y9RtN3383Qgw8m5msZwUfkGmmBpF9hLAOTGszqLmUTVK78Dyu\nl1Zet5tkwErNnVNk8sfHGfFltW956h14c9lgDk73qeBgitZsD5q2ZE6p2mw5\n9p98\r\n=/ipo\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"9417f5bb3b0489f04b554e4200801061ce224b52","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"najafi@snu.ac.kr"},"deprecated":"The gasPrices has been changed on the chain and this version does not support that","_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^1.3.6"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^1.3.6","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.0.0_1620745402736_0.01075226909953697","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@anchor-protocol/anchor-earn","version":"1.0.1","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.0.1","maintainers":[{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"saad.najafi","email":"najafi@snu.ac.kr"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"ssen","email":"i@ssen.name"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"46a7ac0d1b37402362fc78dc072b6436dd0220c2","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.0.1.tgz","fileCount":78,"integrity":"sha512-lxW1g25mVCG3lMmesBOTBUMcJaqDjHYiHB5ylVTw68FwyllZMOjZDYJxSM0eBtMPAb4yF0sa4R3AZbogwX0phw==","signatures":[{"sig":"MEYCIQC0SryuhdSvEwBQLSSFZOvq/1GaK6XsrHS+tcM5RqVx9gIhAJx/k8nTs5el7i46rOYzfxtEH24+cy/pluWt+bm3KoSY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":129567,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgm0ycCRA9TVsSAnZWagAABYsQAKJ1lLJNagIGEf4IlKlg\nSuTPxPHBuBjbP7WOHz09cmH7gtq78TLDiQsTfZa6ZrdbhfifnYUgbdtAnc4k\ndD06Fw4VX7qdi1jPTV2vObztq3J89YAgjdASgrY+hH5Z5lL0CD3ioehQnWM7\nzCnCna5Hpsg0NG+1utY3HBXuZdAjijipZa8SwNsYm5nvqUqOX3IlvXvqYEhn\nFOJkVPTKk/iDliBEji06x0oQnfoRaV9kf9ZEg8RWn+KoeFoslTe1n9PlEDov\neMpbYhwokFARBGTwlpJ48VvvpenC9FlMtUDYW2v62lrhZev0guB5yiecGwxN\nGyTa4AizHLIhL21guCBTLkA8vvSrR4hmsBY4mHtJlpc2t40UL2wfQ0uneyMO\neapF06FWXW4V7yUUVii+0eCoWpr6m/e62uO1WzrCpJnLs0dBVGRumOZ5EyGY\nayeZGxUOhT5Bv+Yab8KNMn+nav29TNBFAx8/ysvYS2oEVD8wnUA2bstM2Ay8\nTbc21gz+P4ojjptwW5Ljoua4R3X53v6dGt5EXpwS91vvzU/I9TzPUGgRaUdj\n19VRlc8q9y7w5BZKg06/yeO9/K6jyjit8ytDwdDOY7ghOwRbtE+GUjjQEje0\n4rRuz5y9UH5Pf+0amDQYrycFLKmWr+ue5TSchwWFbmh95wt+Wq1lBiDgjtRd\nxI7/\r\n=XFg+\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"4c43c6f35381603d58c2f33f61ccb61c7477c68e","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"najafi@snu.ac.kr"},"deprecated":"The gasPrices has been changed on the chain and this version does not support that","repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^1.3.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^1.3.6","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.0.1_1620790427501_0.9886110885526249","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@anchor-protocol/anchor-earn","version":"1.0.2","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.0.2","maintainers":[{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"ssen","email":"i@ssen.name"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"0c0a6541520bf7a94569edb365b6f0f21ef2e5c7","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.0.2.tgz","fileCount":78,"integrity":"sha512-wLJewdOBsBUExarDXElQhAmjdOaDL8/GbQhFmXua59OSd7/s4zfYs7dEQlnrnKIzcb2bSbj+nI4p+9QLrQ3eOA==","signatures":[{"sig":"MEUCIDizsqyhc+BzwdgUGSmvqRyn/4xp4630rNHIvXVcGGZFAiEA7TOPgpKSi2LQNhPPdZRKiUQy9f1zU6PlYUj2Jc8TDGI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":129997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzHRVCRA9TVsSAnZWagAASEAP+wVxZmr32dAak76RJm1N\nmE52+/GEtPEW/hVA/Ihai9MSIyTxNERFcQtGsv71AiRbiUZ/uSLHH2lU6Bb7\nNKN5hd7pvdbBsE41O57hCA/kl237FO33/HH+hy+03FLUcUlhOIIkGXns01Lw\n1tM9vdUmFTmSOQW/pCL6aNvjKfI/nK9AK5iF8+OaVFo3380Uf44Ld99WQ18F\nxq980udiy2uVqxDqUAJ44trwxAoN0nwz5598ROaQGCfKvsjnGN5ryESQFaZh\nziEXBe1a/LaMxlopIa3iJfasxi/qHL3Vto6Fge3hICiY9z4RGs89x8Y7O0EA\n62xqwaeZNjJEqHhFte4fB8aZTZRiO+3hVaFBC15GyAYWw6w4+UzsqH+/nSC/\nTrQQMFFF8Q7BGTvdnQoOdxNFRG69ErLcfohqvfNmQKO00oJOPVM8KAiz3oLH\nIWMDnos+w6ZEm5GoSpZShAKxN8zLLPmI5uZC60yxB8fqIq76q3lD9LGJATgU\nE8e73GBN++RAfyip1yLN4oL7fQyMd0D9pBVE4FcQOATncCFL1Q11roRQr7Nn\ngylN6qdX13MTyFrcUoHpXPYgYsOGdIbOtY07KCDWld+MJNfr6g/vba+cnVYB\nbGaaAFE/r7c9mTH+zZQCLiteLxNV/5j1mrwTOTbVQJXLEcMlWpR7Q6HH99WU\no4Br\r\n=S3Bq\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"cfddf82475ddd90323ce8770c2cf7f9dc3577843","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"msnajafi405@gmail.com"},"deprecated":"The gasPrices has been changed on the chain and this version does not support that","repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^1.3.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^1.3.6","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.0.2_1624011860607_0.5499749023207319","host":"s3://npm-registry-packages"}},"1.0.3":{"name":"@anchor-protocol/anchor-earn","version":"1.0.3","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.0.3","maintainers":[{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"5a4eebf4462adf1362d16d6010ab3e452c2c4103","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.0.3.tgz","fileCount":78,"integrity":"sha512-8GH1hIgSGQz8WAMWhQeOZPIJeo+KVYilgbfrq4k3sbNJRZUFh0b7Tv4Ji69Xq1GxE45UX5WO3pL2Y+5E/JTPzA==","signatures":[{"sig":"MEUCIEnoCkGbSnYPdPkwzXAxNiraZ3ItQHM9RDEXG8TIqM8CAiEAlALEY0/CQOAjgHEdgFaNIKGsHD0uCzdzVsirYTcyf/Y=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":129995,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhI6aNCRA9TVsSAnZWagAAg5gQAI60RCOTxrkrPdhKub5+\nYCyiKtOBgQRmXA6KqT8y13lcuJepMEQIwqCduJI8OADTI8lMoUQ32RkwCnjV\nhcwNFCZTlpNv5XQaEdpUPwaqDw0R3XHSAiGX228FP7gSNAwmR+BM6+mbS3iF\nnpfcv71uGHIROSG+LIaM/a6torqlvqggBP9Lhnweody+KUTQU9gUP5HwgMgv\n6LKgUZl8uQ5LJGrPdjHJVeIlrNGPNhjUo3xlsy+EHC7+wVUKw09FnFotZjwK\nK4RSZJzWsw0gturzGDeRDgXuVHqarbhH7L/qM1efyh8U5wtZXDNvBiCGLxBI\nfjV6MOT3orZ2v9dm8TSav/Zfa5q221phdyJYvekhJVnLdD19URbiYGKYj2vk\n1kqO0JUWxODGlqVbW99EHcBKr3YeZ6JhsFfMARvVntJK3qRWVTFTzmv3wZWC\nSw/fUuKktvXsmT6xrYYBxpIhz/aNe+sXSdgOCwv0YoEFK2O0AUDm2+lSMwXl\nzmHnKFDLt36pmPg1c15ujzsPo3JzDd4Dm1jFCbPSAZSyCnSHszAd8KFKBCYg\nGAWCJn3laiuH3Aa00pMQKSbwjC3AkRHNIN3F/9Wd1gdG6en5ZRj0BBOKvkek\nVxw5vA5hUrvbQboVLGDO8Echt9xYGcM8oYgE7ihJCrS/fwcsVmX8iCrCcc8X\nqd6D\r\n=2LJ3\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"d82a3f8054c5b8c435e8c40ab7cefbf58a897c7d","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"msnajafi405@gmail.com"},"deprecated":"The gasPrices has been changed on the chain and this version does not support that","repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^1.3.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^1.3.6","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.0.3_1629726349480_0.8289004379656366","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@anchor-protocol/anchor-earn","version":"1.0.4","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.0.4","maintainers":[{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"afeb46b93ec1ad11a4900592b9d53a2c6f28ac91","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.0.4.tgz","fileCount":78,"integrity":"sha512-+iteXYyLrSs4YnNm5SHSsfF4YeN52tns5IvvPLEOPGZqJ1kIgxBzJdJnVxeM6zKp8mMm9Ida6msx8ryeXvbJXA==","signatures":[{"sig":"MEUCIFSprUnRda/XFpilbMkQ8KVXQlP5PRl98OcSkmt1Up0PAiEAxWIgNiaTZnFxRpltkgMQpaEKKfSgcPA6jbG9GkGuhWE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":129996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhJOK3CRA9TVsSAnZWagAAQHYP/i4Bwj31/tI2fzPxjWUI\nRXJJBxBOB/h3Wfav1hr4J+oLhQc+ImepFU0hOW3b/CFIvagfPVGXCTIMJZVy\nxLOkuXY7QfmYs7qcFa+ZxjlEwbXGEyEr4bsC4x9nfiPjLNVWSxHSKdJr9XE9\nWXYqhk8USngBLhBSB+8tzcs63G8yzgWmMayJb/0IYJzefmf2/wksSGXmJDSu\nnTCfC6HskJbv61fMlVI6OgdpOv7a30fIPKU7DkZovH5WL8G43X8BRmbPmXxj\nTt9Quxi+p8vspzA1nuTaF0DvtF/rwiVd7l4khH+ejjVx+gCDnAs5bzqKq2KR\nyypvB7sPzjr9cxG42GVe+LaF8LJUwI4765A/fXqZQqcJPPqlX3SKdp9JjeBp\nf4ULfhY9N52lS5g68AgPL4N7N4X1ZYvNbKk2R8pZ4AKjLixNrSXn4e3SzRGM\ntXdEYFvp9boR3ERqW/Owf0TaN3KhwWArSKoMuZs4aNoTwOWSO8r/zIki9I2G\n5abLeIvjfRjWV1qPfjgJPraBWxui52jJ0NmXbWCaAeMqf4TcqMVVFHqTdgwe\nRmunZ4dth3xWokjc5npO+3UZuVXFO+q6VIlXdylsSdYW2qBw8bfyM0ne39F5\nBhZqTYMCTmryhF3pZZuWVX21C9Y0kBrp/1Zrnlo9T52Hlrs5K9ZCN2tjbP9o\nuwOI\r\n=WN4O\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"529e23e195da9a3dc60cb5b5bdb1dc4818879b92","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"msnajafi405@gmail.com"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^1.3.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^1.3.6","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.0.4_1629807287500_0.6898396874149695","host":"s3://npm-registry-packages"}},"1.1.0-alpha.0":{"name":"@anchor-protocol/anchor-earn","version":"1.1.0-alpha.0","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.1.0-alpha.0","maintainers":[{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"0557aafd7253a4d58cf0320b9dd48ff0f00ee441","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.1.0-alpha.0.tgz","fileCount":84,"integrity":"sha512-Tn1B3rzMGZ9KXYZTFQYeyWqNAiDTxAPNcrDmKXJOw5CyoNULKx11qjxLLdjGU0HZBybji/n0sTySfaHd76hLTw==","signatures":[{"sig":"MEUCIAXEp03B/C1TQEXRKJaG9ffdZvLMq5miauHYaD9opspiAiEA04HJH4ePipSPSUVWqYiaxSVZa4BvYCrdWg8AEMVqhmQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132584},"main":"./dist/index.js","types":"./dist/index.d.ts","readme":"\n<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>\n\n# Anchor Earn\nAnchor Earn is a client SDK for building applications that can interact with the earn functionality of Anchor Protocol from within JavaScript runtimes. \n> **NOTE**\nThis SDK only supports the earn functionalities of anchor protocol and cannot be used for other functionalities like bond or borrow.\n## Table of Contents <!-- omit in toc -->\n- [Getting Started](#getting-started)\n    - [Requirements](#requirements)\n    - [Installation](#installation) \n    - [Dependencies](#dependencies)\n    - [Test](#test)\n- [Usage](#usage)\n  - [Fund Account with UST](#fund-account-with-ust)\n  - [Executor](#executor)\n  - [Querier](#querier)\n  - [CustomSigner](#customsigner)\n  - [CustomBroadcaster](#custombroadcaster)\n  - [Loggable](#loggable)\n- [License](#license)\n## Getting Started\nA walk through of the steps to get started with the Anchor Earn SDK alongside with a few use case examples are provided below.\n### Requirements\n- Node.js 12+\n- NPM\n### Installation\nAnchor Earn is available as a package on NPM and it is independent from other Terra and Anchor SDKs.\\\nTo add to your JavaScript project's `package.json` as a dependency using preferred package manager: \n```bash\nnpm install -S @anchor-protocol/anchor-earn\n```\nor\n```bash\nyarn add @anchor-protocol/anchor-earn\n```\n### Dependencies\nAnchor earn uses only Terra.js as a dependency. To get set up with the required dependencies, run:\n```shell\n# debug\nyarn install\n```\n### Test\nAnchor earn provides extensive tests for data classes and functions. To run them, after the steps in [Dependencies](#dependencies):\n```shell\n# debug\nyarn test\n```\n## Usage\n#### `Account` object\nAnchor Earn provides a facility to create a wallet on the Terra blockchain.\\\nThis functionality is accessible through the `Account` object.\n```ts\nconst account = new Account();\n```  \n> **NOTE** It is crucial to store or write down your account information before doing any interactions with the SDK. A user can have access to this info by printing the account.\n```ts\nconsole.log(account.toData());\n```\n```\nAccount{\n      acc_address: 'terra1awnxng53rlnzw3lcwwzsydrx2nj2fuas5nm3gm',\n      public_key: 'terrapub1addwnpepqwke39mta5903ac05a42ug37hs5khrmsw7ffc7lzemy3vwzypjpzqju9f5d',\n      private_key: <Buffer da 8e 5d b9 c4 df 74 57 9c ea d5 a7 c5 8b 50 80 7e 1c 1c e6 39 ce e2 60 10 9c cd bf 26 36 31 26>,\n      mnemonic: 'cry pilot west bench pepper jeans joke slow gadget cloud chuckle wedding canal crop dolphin route ridge mouse canoe rural actor luxury guide buzz'\n }\n```\n`private_key` and `mnemonic` are essential for later usage. \n\n#### `Wallet` and `MnemonicKey` objects\nThe `Wallet` and `MnemonicKey` objects are borrowed from Terra.js, but users have access to them in Anchor Earn without any dependency on Terra.js.\nIn case users have a previous account on the Terra chain, they can use their private key and MnemonicKey to recover their keys.\n ```ts\nimport { Wallet, MnemonicKey } from '@anchor-protocol/anchor-earn';\n    const account = new MnemonicKey({\n      mnemonic:\n        '...',\n});\n```\nAnother usage of the `wallet` object is being used inside the [customSigner](#customsigner). An example is provided in the [customSigner](#customsigner) section.\n\n#### `AnchorEarn` object\nAnchor Earn provides facilities for two main use cases: \n- execute: Signs the message and broadcasts it using Terra.js\n- query: Runs a series of smart contract and chain queries through LCD\nBoth of these functions are accessible through the `AnchorEarn` object. \nTo create the `AnchorEarn` object.\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_11,\n      privateKey: account.privateKey,\n});\n```\nThe above example uses the `Account` object for instantiating `anchor-earn`.\nFor the case that a user has a previous account on the Terra chain, the user can recover their key using `MnemonicKey` and use the following code to instantiate `AnchorEarn`.\n ```ts\nimport { MnemonicKey } from '@anchor-protocol/anchor-earn';\nconst account = new MnemonicKey({\n      mnemonic:\n        '...',\n});\n\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_11,\n      privateKey: account.privateKey,\n});\n```\n### Fund Account with UST\nFor Terra testnet (bombay-11), users can top up their balance with UST using [faucet](https://faucet.terra.money/).\n### Executor\n`AnchorEarn` helps execute three functionalities:\n- deposit: deposit funds in the Anchor protocol\n- withdraw: withdraw previously deposited funds\n- send: transfer `UST` and `AUST` to other accounts\nThe following code snippets show how to use the `AnchorEarn` object.\n> **NOTE**: Currently, Anchor Earn supports the deposit of the`UST` currency only.\n#### Deposit \nTo deposit funds in the Anchor Protocol, use the following example:\n```ts\nconst deposit = await anchorEarn.deposit({\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n      currency: DENOMS.UST,\n    });\n```\n#### Withdraw\nTo withdraw funds from the protocol, use the following example:\n```ts\nconst deposit = await anchorEarn.withdraw({\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n      currency: DENOMS.UST,\n});\n```\n#### Send\nTo send `UST` and `AUST` to other accounts, use the following example: \n<br/>\n<sub>(For this functionality, the `AUST` denom is also supported.) </sub>\n```ts\n const sendUst = await anchorEarn.send({\n      currency: DENOMS.UST,\n      recipient: 'terra1....',\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n    });\n```\n### Querier\n`AnchorEarn` querier facilitates both querying smart contracts and the chain. There are two queries provided by the `AnchorEarn` object:\n- balance: query user balance and user deposit based on currency\n- market: return the state of the specified currency's market\nIf a user wishes to use only the queries, there is no need to instantiate the object as explained [here](#anchorearn-object);\ninstead, they can provide the address for queries as demonstrated by the following examples: \n#### Balance\nTo get the current state of an account, use the following example:\n> > **Note**: The address of the account must be specified in construction.\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_11,\n    });\nconst userBalance = await anchorEarn.balance({\n      currencies: [DENOMS.UST],\n});\n```\n#### Market\nTo get the current state of the market, use the example below:\n```ts\nconst market = await anchorEarn.market({\n      currencies: [DENOMS.UST],\n});\n```\n### CustomSigner\nAnchor Earn also provides users with the functionality to sign transactions and leave the signed transaction to the SDK to perform the broadcasting.\n \n `CustomSigner` is a callback function with which the users can sign `deposit`, `withdraw`, and `send` transactions.\n  \nThe following code snippet specifies an example of the `CustomSigner` usage:\n```ts\nconst customSigner = async (tx: Msg[]) => {\n      const account = new MnemonicKey({\n        mnemonic:\n          '...',\n      });\n\n      const wallet = new Wallet(\n        new LCDClient({\n          URL: 'https://bombay-lcd.terra.dev',\n          chainID: 'bombay-11',\n        }),\n        account,\n      );\n\n      return await wallet.createAndSignTx({\n        msgs: tx,\n        gasAdjustment: 2,\n        gasPrices: { uusd: 0.15 },\n      });\n    };\n\n    await anchorEarn.deposit({\n      amount: '0.01',\n      currency: DENOMS.UST,\n      log: (data) => {\n        console.log(data);\n      },\n      customSigner: customSigner,\n});\n```\n### CustomBroadcaster\nAnchor Earn facilitates a custom broadcast. This can be helpful in the case of applications that rely on external toolings to broadcast transactions. Here is an example of its usage:\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_11,\n      mnemonic:\n        '...',\n});\nconst customBroadcaster = async (tx: Msg[]) => {\n          const lcd = new LCDClient({\n            URL: 'https://bombay-lcd.terra.dev',\n            chainID: 'bombay-11',\n          });\n\n          const wallet = new Wallet(\n              lcd,\n              new MnemonicKey({\n                mnemonic:\n                    '...',\n              }),\n          );\n\n          const signedTx = await wallet.createAndSignTx({\n            msgs: tx,\n            gasAdjustment: 2,\n            gasPrices: { uusd: 0.15 },\n          });\n\n          return lcd.tx.broadcastSync(signedTx).then((result) => {\n            return result.txhash;\n          });\n};\nawait anchorEarn.withdraw({\n      amount: '0.01',\n      currency: DENOMS.AUST,\n      log: (data) => {\n        console.log(data);\n      },\n      customBroadcaster: customBroadcaster\n});\n``` \n\n### Loggable \nFor seeing the progress of the transaction on the chain, `loggable` is provided. The following code shows how to use it:\n```ts\nconst deposit = await anchorEarn.deposit({\n      amount: '...',\n      currency: DENOMS.UST,\n      log: (data) => {\n        console.log(data);\n      }\n    });\n```\n## License\nThis software is licensed under the Apache 2.0 license. Read more about it [here](./LICENSE).\n© 2021 Anchor Protocol","engines":{"node":">=12"},"gitHead":"783e7f43ad8ab66ff68b5ce738f57f91aad801c3","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"msnajafi405@gmail.com"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^2.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^2.1.3","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.1.0-alpha.0_1632805362486_0.22526579517539957","host":"s3://npm-registry-packages"}},"1.1.0-alpha.1":{"name":"@anchor-protocol/anchor-earn","version":"1.1.0-alpha.1","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.1.0-alpha.1","maintainers":[{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"4f92365b279f1c377684267d645ba585ed8f43f9","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.1.0-alpha.1.tgz","fileCount":78,"integrity":"sha512-lmXK4JyKnzqjd22SbeZ1poikjrMyjHzVmR6VW18ITUhyStMollMmjvYpaIIjVDFrmU7VtLN2wljmY0akRjKEnA==","signatures":[{"sig":"MEYCIQCMHcQZjPDwYUmmRsmbslCoDs/+8Em+4kBWYN7w25rEfgIhAP+El5AfPapZSAtMwWAmVyDHDhKMAjL/jzUl9FwjBAFw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":130420},"main":"./dist/index.js","types":"./dist/index.d.ts","readme":"\n<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>\n\n# Anchor Earn\nAnchor Earn is a client SDK for building applications that can interact with the earn functionality of Anchor Protocol from within JavaScript runtimes. \n> **NOTE**\nThis SDK only supports the earn functionalities of anchor protocol and cannot be used for other functionalities like bond or borrow.\n## Table of Contents <!-- omit in toc -->\n- [Getting Started](#getting-started)\n    - [Requirements](#requirements)\n    - [Installation](#installation) \n    - [Dependencies](#dependencies)\n    - [Test](#test)\n- [Usage](#usage)\n  - [Fund Account with UST](#fund-account-with-ust)\n  - [Executor](#executor)\n  - [Querier](#querier)\n  - [CustomSigner](#customsigner)\n  - [CustomBroadcaster](#custombroadcaster)\n  - [Loggable](#loggable)\n- [License](#license)\n## Getting Started\nA walk through of the steps to get started with the Anchor Earn SDK alongside with a few use case examples are provided below.\n### Requirements\n- Node.js 12+\n- NPM\n### Installation\nAnchor Earn is available as a package on NPM and it is independent from other Terra and Anchor SDKs.\\\nTo add to your JavaScript project's `package.json` as a dependency using preferred package manager: \n```bash\nnpm install -S @anchor-protocol/anchor-earn\n```\nor\n```bash\nyarn add @anchor-protocol/anchor-earn\n```\n### Dependencies\nAnchor earn uses only Terra.js as a dependency. To get set up with the required dependencies, run:\n```shell\n# debug\nyarn install\n```\n### Test\nAnchor earn provides extensive tests for data classes and functions. To run them, after the steps in [Dependencies](#dependencies):\n```shell\n# debug\nyarn test\n```\n## Usage\n#### `Account` object\nAnchor Earn provides a facility to create a wallet on the Terra blockchain.\\\nThis functionality is accessible through the `Account` object.\n```ts\nconst account = new Account();\n```  \n> **NOTE** It is crucial to store or write down your account information before doing any interactions with the SDK. A user can have access to this info by printing the account.\n```ts\nconsole.log(account.toData());\n```\n```\nAccount{\n      acc_address: 'terra1awnxng53rlnzw3lcwwzsydrx2nj2fuas5nm3gm',\n      public_key: 'terrapub1addwnpepqwke39mta5903ac05a42ug37hs5khrmsw7ffc7lzemy3vwzypjpzqju9f5d',\n      private_key: <Buffer da 8e 5d b9 c4 df 74 57 9c ea d5 a7 c5 8b 50 80 7e 1c 1c e6 39 ce e2 60 10 9c cd bf 26 36 31 26>,\n      mnemonic: 'cry pilot west bench pepper jeans joke slow gadget cloud chuckle wedding canal crop dolphin route ridge mouse canoe rural actor luxury guide buzz'\n }\n```\n`private_key` and `mnemonic` are essential for later usage. \n\n#### `Wallet` and `MnemonicKey` objects\nThe `Wallet` and `MnemonicKey` objects are borrowed from Terra.js, but users have access to them in Anchor Earn without any dependency on Terra.js.\nIn case users have a previous account on the Terra chain, they can use their private key and MnemonicKey to recover their keys.\n ```ts\nimport { Wallet, MnemonicKey } from '@anchor-protocol/anchor-earn';\n    const account = new MnemonicKey({\n      mnemonic:\n        '...',\n});\n```\nAnother usage of the `wallet` object is being used inside the [customSigner](#customsigner). An example is provided in the [customSigner](#customsigner) section.\n\n#### `AnchorEarn` object\nAnchor Earn provides facilities for two main use cases: \n- execute: Signs the message and broadcasts it using Terra.js\n- query: Runs a series of smart contract and chain queries through LCD\nBoth of these functions are accessible through the `AnchorEarn` object. \nTo create the `AnchorEarn` object.\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n      privateKey: account.privateKey,\n});\n```\nThe above example uses the `Account` object for instantiating `anchor-earn`.\nFor the case that a user has a previous account on the Terra chain, the user can recover their key using `MnemonicKey` and use the following code to instantiate `AnchorEarn`.\n ```ts\nimport { MnemonicKey } from '@anchor-protocol/anchor-earn';\nconst account = new MnemonicKey({\n      mnemonic:\n        '...',\n});\n\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n      privateKey: account.privateKey,\n});\n```\n### Fund Account with UST\nFor Terra testnet (bombay-12), users can top up their balance with UST using [faucet](https://faucet.terra.money/).\n### Executor\n`AnchorEarn` helps execute three functionalities:\n- deposit: deposit funds in the Anchor protocol\n- withdraw: withdraw previously deposited funds\n- send: transfer `UST` and `AUST` to other accounts\nThe following code snippets show how to use the `AnchorEarn` object.\n> **NOTE**: Currently, Anchor Earn supports the deposit of the`UST` currency only.\n#### Deposit \nTo deposit funds in the Anchor Protocol, use the following example:\n```ts\nconst deposit = await anchorEarn.deposit({\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n      currency: DENOMS.UST,\n    });\n```\n#### Withdraw\nTo withdraw funds from the protocol, use the following example:\n```ts\nconst deposit = await anchorEarn.withdraw({\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n      currency: DENOMS.UST,\n});\n```\n#### Send\nTo send `UST` and `AUST` to other accounts, use the following example: \n<br/>\n<sub>(For this functionality, the `AUST` denom is also supported.) </sub>\n```ts\n const sendUst = await anchorEarn.send({\n      currency: DENOMS.UST,\n      recipient: 'terra1....',\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n    });\n```\n### Querier\n`AnchorEarn` querier facilitates both querying smart contracts and the chain. There are two queries provided by the `AnchorEarn` object:\n- balance: query user balance and user deposit based on currency\n- market: return the state of the specified currency's market\nIf a user wishes to use only the queries, there is no need to instantiate the object as explained [here](#anchorearn-object);\ninstead, they can provide the address for queries as demonstrated by the following examples: \n#### Balance\nTo get the current state of an account, use the following example:\n> > **Note**: The address of the account must be specified in construction.\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n    });\nconst userBalance = await anchorEarn.balance({\n      currencies: [DENOMS.UST],\n});\n```\n#### Market\nTo get the current state of the market, use the example below:\n```ts\nconst market = await anchorEarn.market({\n      currencies: [DENOMS.UST],\n});\n```\n### CustomSigner\nAnchor Earn also provides users with the functionality to sign transactions and leave the signed transaction to the SDK to perform the broadcasting.\n \n `CustomSigner` is a callback function with which the users can sign `deposit`, `withdraw`, and `send` transactions.\n  \nThe following code snippet specifies an example of the `CustomSigner` usage:\n```ts\nconst customSigner = async (tx: Msg[]) => {\n      const account = new MnemonicKey({\n        mnemonic:\n          '...',\n      });\n\n      const wallet = new Wallet(\n        new LCDClient({\n          URL: 'https://bombay-lcd.terra.dev',\n          chainID: 'bombay-12',\n        }),\n        account,\n      );\n\n      return await wallet.createAndSignTx({\n        msgs: tx,\n        gasAdjustment: 2,\n        gasPrices: { uusd: 0.15 },\n      });\n    };\n\n    await anchorEarn.deposit({\n      amount: '0.01',\n      currency: DENOMS.UST,\n      log: (data) => {\n        console.log(data);\n      },\n      customSigner: customSigner,\n});\n```\n### CustomBroadcaster\nAnchor Earn facilitates a custom broadcast. This can be helpful in the case of applications that rely on external toolings to broadcast transactions. Here is an example of its usage:\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n      mnemonic:\n        '...',\n});\nconst customBroadcaster = async (tx: Msg[]) => {\n          const lcd = new LCDClient({\n            URL: 'https://bombay-lcd.terra.dev',\n            chainID: 'bombay-12',\n          });\n\n          const wallet = new Wallet(\n              lcd,\n              new MnemonicKey({\n                mnemonic:\n                    '...',\n              }),\n          );\n\n          const signedTx = await wallet.createAndSignTx({\n            msgs: tx,\n            gasAdjustment: 2,\n            gasPrices: { uusd: 0.15 },\n          });\n\n          return lcd.tx.broadcastSync(signedTx).then((result) => {\n            return result.txhash;\n          });\n};\nawait anchorEarn.withdraw({\n      amount: '0.01',\n      currency: DENOMS.AUST,\n      log: (data) => {\n        console.log(data);\n      },\n      customBroadcaster: customBroadcaster\n});\n``` \n\n### Loggable \nFor seeing the progress of the transaction on the chain, `loggable` is provided. The following code shows how to use it:\n```ts\nconst deposit = await anchorEarn.deposit({\n      amount: '...',\n      currency: DENOMS.UST,\n      log: (data) => {\n        console.log(data);\n      }\n    });\n```\n## License\nThis software is licensed under the Apache 2.0 license. Read more about it [here](./LICENSE).\n© 2021 Anchor Protocol","engines":{"node":">=12"},"gitHead":"9dbf7ccd2860a006f56c5e51e50da4542ca74e7a","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"kjessec","email":"jesse@soob.co"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"6.14.14","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"14.17.5","dependencies":{"@terra-money/terra.js":"^2.1.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^2.1.3","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.1.0-alpha.1_1632885847365_0.24310181430197453","host":"s3://npm-registry-packages"}},"1.1.0-alpha.2":{"name":"@anchor-protocol/anchor-earn","version":"1.1.0-alpha.2","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.1.0-alpha.2","maintainers":[{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"ac6ede6280952163bfb39774a8defbc5877921ff","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.1.0-alpha.2.tgz","fileCount":84,"integrity":"sha512-iMfyzZZGGFbK8Y7ZKX9H600gNrgb4KBKv/JMvkoAk7v3IoYGdOhFQ9JlbW3IhiN3P/U5Zl1fJdsgICq2CkiQWw==","signatures":[{"sig":"MEQCIGZ2rpX8uWLSowP6JTSRZqXqeLRp5dePbgsOG0JgaqtaAiB/+5TriBUt7hU2cP3dCqdpqpozF6GGefbiJp1AaFcDJA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132636},"main":"./dist/index.js","types":"./dist/index.d.ts","readme":"\n<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>\n\n# Anchor Earn\nAnchor Earn is a client SDK for building applications that can interact with the earn functionality of Anchor Protocol from within JavaScript runtimes. \n> **NOTE**\nThis SDK only supports the earn functionalities of anchor protocol and cannot be used for other functionalities like bond or borrow.\n## Table of Contents <!-- omit in toc -->\n- [Getting Started](#getting-started)\n    - [Requirements](#requirements)\n    - [Installation](#installation) \n    - [Dependencies](#dependencies)\n    - [Test](#test)\n- [Usage](#usage)\n  - [Fund Account with UST](#fund-account-with-ust)\n  - [Executor](#executor)\n  - [Querier](#querier)\n  - [CustomSigner](#customsigner)\n  - [CustomBroadcaster](#custombroadcaster)\n  - [Loggable](#loggable)\n- [License](#license)\n## Getting Started\nA walk through of the steps to get started with the Anchor Earn SDK alongside with a few use case examples are provided below.\n### Requirements\n- Node.js 12+\n- NPM\n### Installation\nAnchor Earn is available as a package on NPM and it is independent from other Terra and Anchor SDKs.\\\nTo add to your JavaScript project's `package.json` as a dependency using preferred package manager: \n```bash\nnpm install -S @anchor-protocol/anchor-earn\n```\nor\n```bash\nyarn add @anchor-protocol/anchor-earn\n```\n### Dependencies\nAnchor earn uses only Terra.js as a dependency. To get set up with the required dependencies, run:\n```shell\n# debug\nyarn install\n```\n### Test\nAnchor earn provides extensive tests for data classes and functions. To run them, after the steps in [Dependencies](#dependencies):\n```shell\n# debug\nyarn test\n```\n## Usage\n#### `Account` object\nAnchor Earn provides a facility to create a wallet on the Terra blockchain.\\\nThis functionality is accessible through the `Account` object.\n```ts\nconst account = new Account();\n```  \n> **NOTE** It is crucial to store or write down your account information before doing any interactions with the SDK. A user can have access to this info by printing the account.\n```ts\nconsole.log(account.toData());\n```\n```\nAccount{\n      acc_address: 'terra1awnxng53rlnzw3lcwwzsydrx2nj2fuas5nm3gm',\n      public_key: 'terrapub1addwnpepqwke39mta5903ac05a42ug37hs5khrmsw7ffc7lzemy3vwzypjpzqju9f5d',\n      private_key: <Buffer da 8e 5d b9 c4 df 74 57 9c ea d5 a7 c5 8b 50 80 7e 1c 1c e6 39 ce e2 60 10 9c cd bf 26 36 31 26>,\n      mnemonic: 'cry pilot west bench pepper jeans joke slow gadget cloud chuckle wedding canal crop dolphin route ridge mouse canoe rural actor luxury guide buzz'\n }\n```\n`private_key` and `mnemonic` are essential for later usage. \n\n#### `Wallet` and `MnemonicKey` objects\nThe `Wallet` and `MnemonicKey` objects are borrowed from Terra.js, but users have access to them in Anchor Earn without any dependency on Terra.js.\nIn case users have a previous account on the Terra chain, they can use their private key and MnemonicKey to recover their keys.\n ```ts\nimport { Wallet, MnemonicKey } from '@anchor-protocol/anchor-earn';\n    const account = new MnemonicKey({\n      mnemonic:\n        '...',\n});\n```\nAnother usage of the `wallet` object is being used inside the [customSigner](#customsigner). An example is provided in the [customSigner](#customsigner) section.\n\n#### `AnchorEarn` object\nAnchor Earn provides facilities for two main use cases: \n- execute: Signs the message and broadcasts it using Terra.js\n- query: Runs a series of smart contract and chain queries through LCD\nBoth of these functions are accessible through the `AnchorEarn` object. \nTo create the `AnchorEarn` object.\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n      privateKey: account.privateKey,\n});\n```\nThe above example uses the `Account` object for instantiating `anchor-earn`.\nFor the case that a user has a previous account on the Terra chain, the user can recover their key using `MnemonicKey` and use the following code to instantiate `AnchorEarn`.\n ```ts\nimport { MnemonicKey } from '@anchor-protocol/anchor-earn';\nconst account = new MnemonicKey({\n      mnemonic:\n        '...',\n});\n\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n      privateKey: account.privateKey,\n});\n```\n### Fund Account with UST\nFor Terra testnet (bombay-12), users can top up their balance with UST using [faucet](https://faucet.terra.money/).\n### Executor\n`AnchorEarn` helps execute three functionalities:\n- deposit: deposit funds in the Anchor protocol\n- withdraw: withdraw previously deposited funds\n- send: transfer `UST` and `AUST` to other accounts\nThe following code snippets show how to use the `AnchorEarn` object.\n> **NOTE**: Currently, Anchor Earn supports the deposit of the`UST` currency only.\n#### Deposit \nTo deposit funds in the Anchor Protocol, use the following example:\n```ts\nconst deposit = await anchorEarn.deposit({\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n      currency: DENOMS.UST,\n    });\n```\n#### Withdraw\nTo withdraw funds from the protocol, use the following example:\n```ts\nconst deposit = await anchorEarn.withdraw({\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n      currency: DENOMS.UST,\n});\n```\n#### Send\nTo send `UST` and `AUST` to other accounts, use the following example: \n<br/>\n<sub>(For this functionality, the `AUST` denom is also supported.) </sub>\n```ts\n const sendUst = await anchorEarn.send({\n      currency: DENOMS.UST,\n      recipient: 'terra1....',\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\n    });\n```\n### Querier\n`AnchorEarn` querier facilitates both querying smart contracts and the chain. There are two queries provided by the `AnchorEarn` object:\n- balance: query user balance and user deposit based on currency\n- market: return the state of the specified currency's market\nIf a user wishes to use only the queries, there is no need to instantiate the object as explained [here](#anchorearn-object);\ninstead, they can provide the address for queries as demonstrated by the following examples: \n#### Balance\nTo get the current state of an account, use the following example:\n> > **Note**: The address of the account must be specified in construction.\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n    });\nconst userBalance = await anchorEarn.balance({\n      currencies: [DENOMS.UST],\n});\n```\n#### Market\nTo get the current state of the market, use the example below:\n```ts\nconst market = await anchorEarn.market({\n      currencies: [DENOMS.UST],\n});\n```\n### CustomSigner\nAnchor Earn also provides users with the functionality to sign transactions and leave the signed transaction to the SDK to perform the broadcasting.\n \n `CustomSigner` is a callback function with which the users can sign `deposit`, `withdraw`, and `send` transactions.\n  \nThe following code snippet specifies an example of the `CustomSigner` usage:\n```ts\nconst customSigner = async (tx: Msg[]) => {\n      const account = new MnemonicKey({\n        mnemonic:\n          '...',\n      });\n\n      const wallet = new Wallet(\n        new LCDClient({\n          URL: 'https://bombay-lcd.terra.dev',\n          chainID: 'bombay-12',\n        }),\n        account,\n      );\n\n      return await wallet.createAndSignTx({\n        msgs: tx,\n        gasAdjustment: 2,\n        gasPrices: { uusd: 0.15 },\n      });\n    };\n\n    await anchorEarn.deposit({\n      amount: '0.01',\n      currency: DENOMS.UST,\n      log: (data) => {\n        console.log(data);\n      },\n      customSigner: customSigner,\n});\n```\n### CustomBroadcaster\nAnchor Earn facilitates a custom broadcast. This can be helpful in the case of applications that rely on external toolings to broadcast transactions. Here is an example of its usage:\n```ts\nconst anchorEarn = new AnchorEarn({\n      chain: CHAINS.TERRA,\n      network: NETWORKS.BOMBAY_12,\n      mnemonic:\n        '...',\n});\nconst customBroadcaster = async (tx: Msg[]) => {\n          const lcd = new LCDClient({\n            URL: 'https://bombay-lcd.terra.dev',\n            chainID: 'bombay-12',\n          });\n\n          const wallet = new Wallet(\n              lcd,\n              new MnemonicKey({\n                mnemonic:\n                    '...',\n              }),\n          );\n\n          const signedTx = await wallet.createAndSignTx({\n            msgs: tx,\n            gasAdjustment: 2,\n            gasPrices: { uusd: 0.15 },\n          });\n\n          return lcd.tx.broadcastSync(signedTx).then((result) => {\n            return result.txhash;\n          });\n};\nawait anchorEarn.withdraw({\n      amount: '0.01',\n      currency: DENOMS.AUST,\n      log: (data) => {\n        console.log(data);\n      },\n      customBroadcaster: customBroadcaster\n});\n``` \n\n### Loggable \nFor seeing the progress of the transaction on the chain, `loggable` is provided. The following code shows how to use it:\n```ts\nconst deposit = await anchorEarn.deposit({\n      amount: '...',\n      currency: DENOMS.UST,\n      log: (data) => {\n        console.log(data);\n      }\n    });\n```\n## License\nThis software is licensed under the Apache 2.0 license. Read more about it [here](./LICENSE).\n© 2021 Anchor Protocol","engines":{"node":">=12"},"gitHead":"0cf2a6683be09206dfe3e3d11568d4dfa428b405","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"msnajafi405@gmail.com"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^2.0.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^26.6.3","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^2.0.10","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.1.0-alpha.2_1632901675206_0.8918744289733975","host":"s3://npm-registry-packages"}},"1.1.0":{"name":"@anchor-protocol/anchor-earn","version":"1.1.0","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.1.0","maintainers":[{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"a13891b7d618dcab6dc2c23c3665c0ca9a4bcd8d","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.1.0.tgz","fileCount":84,"integrity":"sha512-2qL7wuW4BSY7BpYdP9/zUQdZr2aXCsRvX8V0EexbHnijDwu3Ax64aDQI3OnpVl4UZ3HVLibcSpFA0oqMm9POxw==","signatures":[{"sig":"MEUCIQD94daKNKD6cgDT0C5gYZ2/PERAhNOqmEEn4MzWbl0xRQIgWEdCWEN4n5ZDtE7xasKDUNZ13BJvgEiMvlDuVtPsmoQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":132628},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"a7dd0c2f36530dbab078539ee7b599715d26f32d","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"msnajafi405@gmail.com"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^2.0.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^2.0.10","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.1.0_1635164972090_0.8829775916848175","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@anchor-protocol/anchor-earn","version":"1.1.1","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@1.1.1","maintainers":[{"name":"cosullivan","email":"cain.osullivan@gmail.com"},{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"5180b2ce9237e475c1261e6bf3dcf099b8246b17","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-1.1.1.tgz","fileCount":84,"integrity":"sha512-iinaTziBEfVHt27zExiRylKnB2QpAyzhLhSdjE1bkSHeMquC9QZgJkgj5RYTek78ccPDDPs5ivCSR7XPA4ub7Q==","signatures":[{"sig":"MEQCIG8kb68/3V98cibVfTrsH9tpOIme5ja+kxp5m7i1usBjAiAjvKEN78Y0SvPN0lRXPx1l7A5VJCfvTOQgeZSRGwLLug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":133023},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"07adbfa108864118235416d466bfb3d4d2e58d93","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"saad.najafi","email":"msnajafi405@gmail.com"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"7.0.3","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"_nodeVersion":"15.0.1","dependencies":{"@terra-money/terra.js":"^2.0.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.3.1","husky":"^5.2.0","eslint":"^7.21.3","ts-jest":"^26.5.4","ts-node":"^9.1.1","typedoc":"^0.20.34","prettier":"^2.2.1","typescript":"^4.2.3","@types/jest":"^26.0.21","@types/node":"^14.14.22","@ssen/eslint-config":"^1.3.1","@ssen/prettier-config":"^1.2.0","@terra-money/terra.js":"^2.0.10","eslint-config-prettier":"^8.1.0","@typescript-eslint/parser":"^4.19.0","@typescript-eslint/eslint-plugin":"^4.19.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_1.1.1_1636695289143_0.5711378524038759","host":"s3://npm-registry-packages"}},"2.0.0-alpha1":{"name":"@anchor-protocol/anchor-earn","version":"2.0.0-alpha1","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@2.0.0-alpha1","maintainers":[{"name":"cosullivan","email":"cain.osullivan@gmail.com"},{"name":"jarcodallo","email":"jarcodallo@gmail.com"},{"name":"ssen","email":"i@ssen.name"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"},{"name":"etienne.napoleone","email":"etienne.napoleone@gmail.com"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"c96fdd68fe436425da428528bba58d50b11255c6","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-2.0.0-alpha1.tgz","fileCount":78,"integrity":"sha512-n6E8mQWik8U0N+6H4+ck6NVkR5zbtXgEpP/Fsj8OQLeB2F0QAZlCImWW/QGUyQT0KO4rhV1bTtc0BYlrj617Yw==","signatures":[{"sig":"MEYCIQD6+OIDRrN+Z9ltzk0G//OUDDd8WStKuqCesHX34WqnZQIhAMb+HpyfLE7T9+eXiaC6NYoV7owzitjsjzGHTWsUMwpH","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":135736,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhnDhGCRA9TVsSAnZWagAAHsEP/iW6RTNAYsdISQ+eXT8g\ngeRMwwY8kqDRLsuLI+fZtHesjby8h1lGeok1IVALltDIODQK9xvdBRt+J//p\nhd3tlQ6QJoJ2TUfhtj1KgTvKgLNAATcT/W6TZXa0xQ36BuW7EtcPqQYJZjNI\nNPjKxLPiT5YI07IsfgdoRB0+aNzolFs6SjR+LwAySJKfxbbmTr1Xyy6FTL7K\nLt/Uyjdeu16fn3P+GBhSDuSQtAcB6G9hBz7quKBEBm7jJKGdV40N4rWoQdq8\nqJMum16w8Zlc5nbQfPL3DqorWfDUvAk+TUXt+nCg9PdZkG5MIdZQNkBfbWNZ\n7u8LhUePRes814+bhPkfHkpmooNzMzzNqqC8hY6xXVBp2JaxDwZ35sFc6DbZ\n68NwGHMFdPokJJqGv5UDCoPWKBQ1a8zzgPblPngKg6qS2CZUjNttoPV1yV/i\nzDpZmsFIQyd8CJot7X9+iKpYhaU73EzrUY2FHz/IWrp8uDeIQONpXCB+fsGq\nAYX/NGylm+wSiapBFwmPPBYXGqZ0s+ZVicielrpe3RSMR9tSN0n4OMEDIkPr\npsX5GMahFhry174ipSU0Dz73bE8AGNGsdIODz2gJqvqtFy4iYukSNYJ+g6NS\nQPEFcmT5l+UEj7n1OQQ5VB1TFfvuJYagmH+MhlcaTUSm18yBo9DLxM5aMg62\n4Z+V\r\n=Exir\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"./dist/index.d.ts","readme":"\r\n<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>\r\n\r\n# Anchor Earn\r\nAnchor Earn is a client SDK for building applications that can interact with the earn functionality of Anchor Protocol from within JavaScript runtimes. \r\n> **NOTE**\r\nThis SDK only supports the earn functionalities of anchor protocol and cannot be used for other functionalities like bond or borrow.\r\n## Table of Contents <!-- omit in toc -->\r\n- [Getting Started](#getting-started)\r\n    - [Requirements](#requirements)\r\n    - [Installation](#installation) \r\n    - [Dependencies](#dependencies)\r\n    - [Test](#test)\r\n- [Usage](#usage)\r\n  - [Fund Account with UST](#fund-account-with-ust)\r\n  - [Executor](#executor)\r\n  - [Querier](#querier)\r\n  - [CustomSigner](#customsigner)\r\n  - [CustomBroadcaster](#custombroadcaster)\r\n  - [Loggable](#loggable)\r\n- [License](#license)\r\n## Getting Started\r\nA walk through of the steps to get started with the Anchor Earn SDK alongside with a few use case examples are provided below.\r\n### Requirements\r\n- Node.js 12+\r\n- NPM\r\n### Installation\r\nAnchor Earn is available as a package on NPM and it is independent from other Terra and Anchor SDKs.\\\r\nTo add to your JavaScript project's `package.json` as a dependency using preferred package manager: \r\n```bash\r\nnpm install -S @anchor-protocol/anchor-earn\r\n```\r\nor\r\n```bash\r\nyarn add @anchor-protocol/anchor-earn\r\n```\r\n### Dependencies\r\nAnchor earn uses only Terra.js as a dependency. To get set up with the required dependencies, run:\r\n```shell\r\n# debug\r\nyarn install\r\n```\r\n### Test\r\nAnchor earn provides extensive tests for data classes and functions. To run them, after the steps in [Dependencies](#dependencies):\r\n```shell\r\n# debug\r\nyarn test\r\n```\r\n## Usage\r\n#### `Account` object\r\nAnchor Earn provides a facility to create a wallet on the Terra blockchain.\\\r\nThis functionality is accessible through the `Account` object.\r\n```ts\r\nconst account = new Account();\r\n```  \r\n> **NOTE** It is crucial to store or write down your account information before doing any interactions with the SDK. A user can have access to this info by printing the account.\r\n```ts\r\nconsole.log(account.toData());\r\n```\r\n```\r\nAccount{\r\n      acc_address: 'terra1awnxng53rlnzw3lcwwzsydrx2nj2fuas5nm3gm',\r\n      public_key: 'terrapub1addwnpepqwke39mta5903ac05a42ug37hs5khrmsw7ffc7lzemy3vwzypjpzqju9f5d',\r\n      private_key: <Buffer da 8e 5d b9 c4 df 74 57 9c ea d5 a7 c5 8b 50 80 7e 1c 1c e6 39 ce e2 60 10 9c cd bf 26 36 31 26>,\r\n      mnemonic: 'cry pilot west bench pepper jeans joke slow gadget cloud chuckle wedding canal crop dolphin route ridge mouse canoe rural actor luxury guide buzz'\r\n }\r\n```\r\n`private_key` and `mnemonic` are essential for later usage. \r\n\r\n#### `Wallet` and `MnemonicKey` objects\r\nThe `Wallet` and `MnemonicKey` objects are borrowed from Terra.js, but users have access to them in Anchor Earn without any dependency on Terra.js.\r\nIn case users have a previous account on the Terra chain, they can use their private key and MnemonicKey to recover their keys.\r\n ```ts\r\nimport { Wallet, MnemonicKey } from '@anchor-protocol/anchor-earn';\r\n    const account = new MnemonicKey({\r\n      mnemonic:\r\n        '...',\r\n});\r\n```\r\nAnother usage of the `wallet` object is being used inside the [customSigner](#customsigner). An example is provided in the [customSigner](#customsigner) section.\r\n\r\n#### `AnchorEarn` object\r\nAnchor Earn provides facilities for two main use cases: \r\n- execute: Signs the message and broadcasts it using Terra.js\r\n- query: Runs a series of smart contract and chain queries through LCD\r\nBoth of these functions are accessible through the `AnchorEarn` object. \r\nTo create the `AnchorEarn` object.\r\n```ts\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n      privateKey: account.privateKey,\r\n});\r\n```\r\nThe above example uses the `Account` object for instantiating `anchor-earn`.\r\nFor the case that a user has a previous account on the Terra chain, the user can recover their key using `MnemonicKey` and use the following code to instantiate `AnchorEarn`.\r\n ```ts\r\nimport { MnemonicKey } from '@anchor-protocol/anchor-earn';\r\nconst account = new MnemonicKey({\r\n      mnemonic:\r\n        '...',\r\n});\r\n\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n      privateKey: account.privateKey,\r\n});\r\n```\r\n### Fund Account with UST\r\nFor Terra testnet (bombay-12), users can top up their balance with UST using [faucet](https://faucet.terra.money/).\r\n### Executor\r\n`AnchorEarn` helps execute three functionalities:\r\n- deposit: deposit funds in the Anchor protocol\r\n- withdraw: withdraw previously deposited funds\r\n- send: transfer `UST` and `AUST` to other accounts\r\nThe following code snippets show how to use the `AnchorEarn` object.\r\n> **NOTE**: Currently, Anchor Earn supports the deposit of the`UST` currency only.\r\n#### Deposit \r\nTo deposit funds in the Anchor Protocol, use the following example:\r\n```ts\r\nconst deposit = await anchorEarn.deposit({\r\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\r\n      currency: DENOMS.UST,\r\n    });\r\n```\r\n#### Withdraw\r\nTo withdraw funds from the protocol, use the following example:\r\n```ts\r\nconst deposit = await anchorEarn.withdraw({\r\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\r\n      currency: DENOMS.UST,\r\n});\r\n```\r\n#### Send\r\nTo send `UST` and `AUST` to other accounts, use the following example: \r\n<br/>\r\n<sub>(For this functionality, the `AUST` denom is also supported.) </sub>\r\n```ts\r\n const sendUst = await anchorEarn.send({\r\n      currency: DENOMS.UST,\r\n      recipient: 'terra1....',\r\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\r\n    });\r\n```\r\n### Querier\r\n`AnchorEarn` querier facilitates both querying smart contracts and the chain. There are two queries provided by the `AnchorEarn` object:\r\n- balance: query user balance and user deposit based on currency\r\n- market: return the state of the specified currency's market\r\nIf a user wishes to use only the queries, there is no need to instantiate the object as explained [here](#anchorearn-object);\r\ninstead, they can provide the address for queries as demonstrated by the following examples: \r\n#### Balance\r\nTo get the current state of an account, use the following example:\r\n> > **Note**: The address of the account must be specified in construction.\r\n```ts\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n    });\r\nconst userBalance = await anchorEarn.balance({\r\n      currencies: [DENOMS.UST],\r\n});\r\n```\r\n#### Market\r\nTo get the current state of the market, use the example below:\r\n```ts\r\nconst market = await anchorEarn.market({\r\n      currencies: [DENOMS.UST],\r\n});\r\n```\r\n### CustomSigner\r\nAnchor Earn also provides users with the functionality to sign transactions and leave the signed transaction to the SDK to perform the broadcasting.\r\n \r\n `CustomSigner` is a callback function with which the users can sign `deposit`, `withdraw`, and `send` transactions.\r\n  \r\nThe following code snippet specifies an example of the `CustomSigner` usage:\r\n```ts\r\nconst customSigner = async (tx: Msg[]) => {\r\n      const account = new MnemonicKey({\r\n        mnemonic:\r\n          '...',\r\n      });\r\n\r\n      const wallet = new Wallet(\r\n        new LCDClient({\r\n          URL: 'https://bombay-lcd.terra.dev',\r\n          chainID: 'bombay-12',\r\n        }),\r\n        account,\r\n      );\r\n\r\n      return await wallet.createAndSignTx({\r\n        msgs: tx,\r\n        gasAdjustment: 2,\r\n        gasPrices: { uusd: 0.15 },\r\n      });\r\n    };\r\n\r\n    await anchorEarn.deposit({\r\n      amount: '0.01',\r\n      currency: DENOMS.UST,\r\n      log: (data) => {\r\n        console.log(data);\r\n      },\r\n      customSigner: customSigner,\r\n});\r\n```\r\n### CustomBroadcaster\r\nAnchor Earn facilitates a custom broadcast. This can be helpful in the case of applications that rely on external toolings to broadcast transactions. Here is an example of its usage:\r\n```ts\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n      mnemonic:\r\n        '...',\r\n});\r\nconst customBroadcaster = async (tx: Msg[]) => {\r\n          const lcd = new LCDClient({\r\n            URL: 'https://bombay-lcd.terra.dev',\r\n            chainID: 'bombay-12',\r\n          });\r\n\r\n          const wallet = new Wallet(\r\n              lcd,\r\n              new MnemonicKey({\r\n                mnemonic:\r\n                    '...',\r\n              }),\r\n          );\r\n\r\n          const signedTx = await wallet.createAndSignTx({\r\n            msgs: tx,\r\n            gasAdjustment: 2,\r\n            gasPrices: { uusd: 0.15 },\r\n          });\r\n\r\n          return lcd.tx.broadcastSync(signedTx).then((result) => {\r\n            return result.txhash;\r\n          });\r\n};\r\nawait anchorEarn.withdraw({\r\n      amount: '0.01',\r\n      currency: DENOMS.AUST,\r\n      log: (data) => {\r\n        console.log(data);\r\n      },\r\n      customBroadcaster: customBroadcaster\r\n});\r\n``` \r\n\r\n### Loggable \r\nFor seeing the progress of the transaction on the chain, `loggable` is provided. The following code shows how to use it:\r\n```ts\r\nconst deposit = await anchorEarn.deposit({\r\n      amount: '...',\r\n      currency: DENOMS.UST,\r\n      log: (data) => {\r\n        console.log(data);\r\n      }\r\n    });\r\n```\r\n## License\r\nThis software is licensed under the Apache 2.0 license. Read more about it [here](./LICENSE).\r\n© 2021 Anchor Protocol","engines":{"node":">=12"},"gitHead":"bac623aa3bbe77c8ee9ad751d65baedb30cfd684","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","precommit":"auto-changelog","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"cosullivan","email":"cain.osullivan@gmail.com"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"6.14.15","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"lint-staged":{"**/src/{**/*,*}.{ts,tsx}":["prettier --write","eslint --max-warnings 0"]},"_nodeVersion":"14.18.1","dependencies":{"node-gyp-build":"^4.3.0","@terra-money/terra.js":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"jest":"^27.2.4","husky":"^7.0.4","eslint":"^7.32.0","ts-jest":"^27.0.7","ts-node":"^10.2.1","typedoc":"^0.22.5","prettier":"^2.4.1","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.10.9","lint-staged":"^11.2.6","auto-changelog":"^2.3.0","@ssen/eslint-config":"^2.0.1","@ssen/prettier-config":"^2.0.1","@terra-money/terra.js":"^3.0.0","eslint-config-prettier":"^8.3.0","@typescript-eslint/parser":"^4.33.0","@typescript-eslint/eslint-plugin":"^4.33.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_2.0.0-alpha1_1637627974621_0.3373114539317772","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@anchor-protocol/anchor-earn","version":"2.0.0","author":{"name":"Anchor Protocol"},"license":"MIT","_id":"@anchor-protocol/anchor-earn@2.0.0","maintainers":[{"name":"cosullivan","email":"cain.osullivan@gmail.com"},{"name":"hanjukim","email":"hanjukim@gmail.com"},{"name":"saad.najafi","email":"msnajafi405@gmail.com"},{"name":"kjessec","email":"jesse@soob.co"}],"homepage":"https://github.com/Anchor-Protocol/anchor-earn","bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"dist":{"shasum":"71a073154bf466a7fcad60bb4525a4d176d92329","tarball":"https://registry.npmjs.org/@anchor-protocol/anchor-earn/-/anchor-earn-2.0.0.tgz","fileCount":78,"integrity":"sha512-NbujxaPU2l9uFu/7MapC5KgDdc8+iCrxI086iGH7pfgvrVpsc/TikX/Um+4CrhQVQ1rCKRKaZ59dk5IDPWh2Lg==","signatures":[{"sig":"MEUCIA6fCMCNk4l6fyq1Z4o368cJqYBvmnzroNM8z839bM8bAiEAvHU15t9WWQKjpu82yaMu+ZlZ2jXrvyHP2AWqandMWtY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":136399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFIpFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqx8RAAhZiWdQ+2SmLWnbx4Q+3fXwgCg8HYnaXrCCR+308aOIIDdFXb\r\nvOv5k9QIlDbuQBO69SwmJpg34hRo6t9XpUCAt+8HSVbICkYqlbeecksJSqnW\r\nfW4UbrNH4Z09HraqLVTldEysFu/U+yWckYXjQRXi9CW572goS/19KhUzS8zM\r\n8LSsGKig8BSofCuLd+FfMIHbmYqmvjAMEUl08Pt0eXycdlDfRx/9RKFlOqCR\r\nX3ru7DExH/nc8qsqyJMtaio46Z0Whu0q19laPieqYefjN3oZIMjwjAmr+80z\r\njkYhqC9PkPmiEZLodRxULATWIO28Zf+3IyMIrGGqp16oHZJJ0CX815cPstVZ\r\nProxmaOanwgcuihEMTiTEOlx3Ry7A3P9mcOreAA9vSz2BIq/RGowXT+/QpIv\r\nG2OJqwC0UGYcg0Dw0th1DkB+ymf6wwwS9nfcIX/G7cyzxS08W30zsnufv3ml\r\nmGs2O+COefGhqkzdehXlJCfQv1e22G32NTupkKsca/77lZ+xqw7BrH8GX501\r\n/6jv7p6j06udKdpHXuAN5RJykndqjeONrCmCr7FhqWF7CzVSCv5npX//Eqba\r\nHhliI2jATEdNpY3OrOfr42T9cZYv2mj+gAcWDdRUEDSdLcO+IrLOoSFAdBy5\r\nRiidNnO+wsAYdQeK8E925B+ZY+cOUotMpVA=\r\n=Ma45\r\n-----END PGP SIGNATURE-----\r\n"},"main":"./dist/index.js","types":"./dist/index.d.ts","engines":{"node":">=12"},"gitHead":"f75ecfdc0856c4b44bed145b6f0ec240ffe8ee54","scripts":{"doc":"typedoc","lint":"eslint src --ext .js,.jsx,.ts,.tsx","test":"jest --testTimeout 10000000","build":"tsc --module commonjs","format":"prettier --write ./src/**/**/*.ts","prepare":"husky install","precommit":"auto-changelog","prepublish":"npm run build","test-watch":"jest --testTimeout 100000000 --watch","prepublishOnly":"npm run build","integration-test":"ts-node ./integration-test/index.ts"},"_npmUser":{"name":"cosullivan","email":"cain.osullivan@gmail.com"},"repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"_npmVersion":"6.14.15","description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","directories":{},"lint-staged":{"**/src/{**/*,*}.{ts,tsx}":["prettier --write","eslint --max-warnings 0"]},"_nodeVersion":"14.18.1","dependencies":{"node-gyp-build":"^4.3.0","@terra-money/terra.js":"^3.0.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^27.2.4","husky":"^7.0.4","eslint":"^7.32.0","ts-jest":"^27.0.7","ts-node":"^10.2.1","typedoc":"^0.22.5","prettier":"^2.4.1","typescript":"^4.4.4","@types/jest":"^27.0.2","@types/node":"^16.10.9","lint-staged":"^11.2.6","auto-changelog":"^2.3.0","@ssen/eslint-config":"^2.0.1","@ssen/prettier-config":"^2.0.1","@terra-money/terra.js":"^3.0.0","eslint-config-prettier":"^8.3.0","@typescript-eslint/parser":"^4.33.0","@typescript-eslint/eslint-plugin":"^4.33.0"},"_npmOperationalInternal":{"tmp":"tmp/anchor-earn_2.0.0_1645513285374_0.23267347064649324","host":"s3://npm-registry-packages"}}},"time":{"created":"2021-05-11T15:03:22.735Z","modified":"2026-07-07T17:54:47.561Z","1.0.0":"2021-05-11T15:03:22.931Z","1.0.1":"2021-05-12T03:33:47.665Z","1.0.2":"2021-06-18T10:24:20.747Z","1.0.3":"2021-08-23T13:45:49.590Z","1.0.4":"2021-08-24T12:14:47.634Z","1.1.0-alpha.0":"2021-09-28T05:02:42.714Z","1.1.0-alpha.1":"2021-09-29T03:24:07.536Z","1.1.0-alpha.2":"2021-09-29T07:47:55.402Z","1.1.0":"2021-10-25T12:29:32.278Z","1.1.1":"2021-11-12T05:34:49.314Z","2.0.0-alpha1":"2021-11-23T00:39:34.758Z","2.0.0":"2022-02-22T07:01:25.556Z"},"bugs":{"url":"https://github.com/Anchor-Protocol/anchor-earn/issues"},"author":{"name":"Anchor Protocol"},"license":"MIT","homepage":"https://github.com/Anchor-Protocol/anchor-earn","repository":{"url":"git+https://github.com/Anchor-Protocol/anchor-earn.git","type":"git"},"description":"<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>","maintainers":[{"email":"hanjukim@gmail.com","name":"hanjukim"},{"email":"jesse@soob.co","name":"kjessec"},{"email":"cain.osullivan@gmail.com","name":"cosullivan"},{"email":"radzion@terra.money","name":"radzionchachura"},{"email":"mandrean@pm.me","name":"mandrean"},{"email":"17amitprasad@gmail.com","name":"amitpr"},{"email":"devops@terra.money","name":"terra-devops"}],"readme":"\r\n<p align=\"center\"><img src=\"./docs/img/anchor_earn_logo2.png\" width=750 alt=\"earn-logo\"></p>\r\n\r\n# Anchor Earn\r\nAnchor Earn is a client SDK for building applications that can interact with the earn functionality of Anchor Protocol from within JavaScript runtimes. \r\n> **NOTE**\r\nThis SDK only supports the earn functionalities of anchor protocol and cannot be used for other functionalities like bond or borrow.\r\n## Table of Contents <!-- omit in toc -->\r\n- [Getting Started](#getting-started)\r\n    - [Requirements](#requirements)\r\n    - [Installation](#installation) \r\n    - [Dependencies](#dependencies)\r\n    - [Test](#test)\r\n- [Usage](#usage)\r\n  - [Fund Account with UST](#fund-account-with-ust)\r\n  - [Executor](#executor)\r\n  - [Querier](#querier)\r\n  - [CustomSigner](#customsigner)\r\n  - [CustomBroadcaster](#custombroadcaster)\r\n  - [Loggable](#loggable)\r\n- [License](#license)\r\n## Getting Started\r\nA walk through of the steps to get started with the Anchor Earn SDK alongside with a few use case examples are provided below.\r\n### Requirements\r\n- Node.js 12+\r\n- NPM\r\n### Installation\r\nAnchor Earn is available as a package on NPM and it is independent from other Terra and Anchor SDKs.\\\r\nTo add to your JavaScript project's `package.json` as a dependency using preferred package manager: \r\n```bash\r\nnpm install -S @anchor-protocol/anchor-earn\r\n```\r\nor\r\n```bash\r\nyarn add @anchor-protocol/anchor-earn\r\n```\r\n### Dependencies\r\nAnchor earn uses only Terra.js as a dependency. To get set up with the required dependencies, run:\r\n```shell\r\n# debug\r\nyarn install\r\n```\r\n### Test\r\nAnchor earn provides extensive tests for data classes and functions. To run them, after the steps in [Dependencies](#dependencies):\r\n```shell\r\n# debug\r\nyarn test\r\n```\r\n## Usage\r\n#### `Account` object\r\nAnchor Earn provides a facility to create a wallet on the Terra blockchain.\\\r\nThis functionality is accessible through the `Account` object.\r\n```ts\r\nconst account = new Account();\r\n```  \r\n> **NOTE** It is crucial to store or write down your account information before doing any interactions with the SDK. A user can have access to this info by printing the account.\r\n```ts\r\nconsole.log(account.toData());\r\n```\r\n```\r\nAccount{\r\n      acc_address: 'terra1awnxng53rlnzw3lcwwzsydrx2nj2fuas5nm3gm',\r\n      public_key: 'terrapub1addwnpepqwke39mta5903ac05a42ug37hs5khrmsw7ffc7lzemy3vwzypjpzqju9f5d',\r\n      private_key: <Buffer da 8e 5d b9 c4 df 74 57 9c ea d5 a7 c5 8b 50 80 7e 1c 1c e6 39 ce e2 60 10 9c cd bf 26 36 31 26>,\r\n      mnemonic: 'cry pilot west bench pepper jeans joke slow gadget cloud chuckle wedding canal crop dolphin route ridge mouse canoe rural actor luxury guide buzz'\r\n }\r\n```\r\n`private_key` and `mnemonic` are essential for later usage. \r\n\r\n#### `Wallet` and `MnemonicKey` objects\r\nThe `Wallet` and `MnemonicKey` objects are borrowed from Terra.js, but users have access to them in Anchor Earn without any dependency on Terra.js.\r\nIn case users have a previous account on the Terra chain, they can use their private key and MnemonicKey to recover their keys.\r\n ```ts\r\nimport { Wallet, MnemonicKey } from '@anchor-protocol/anchor-earn';\r\n    const account = new MnemonicKey({\r\n      mnemonic:\r\n        '...',\r\n});\r\n```\r\nAnother usage of the `wallet` object is being used inside the [customSigner](#customsigner). An example is provided in the [customSigner](#customsigner) section.\r\n\r\n#### `AnchorEarn` object\r\nAnchor Earn provides facilities for two main use cases: \r\n- execute: Signs the message and broadcasts it using Terra.js\r\n- query: Runs a series of smart contract and chain queries through LCD\r\nBoth of these functions are accessible through the `AnchorEarn` object. \r\nTo create the `AnchorEarn` object.\r\n```ts\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n      privateKey: account.privateKey,\r\n});\r\n```\r\nThe above example uses the `Account` object for instantiating `anchor-earn`.\r\nFor the case that a user has a previous account on the Terra chain, the user can recover their key using `MnemonicKey` and use the following code to instantiate `AnchorEarn`.\r\n ```ts\r\nimport { MnemonicKey } from '@anchor-protocol/anchor-earn';\r\nconst account = new MnemonicKey({\r\n      mnemonic:\r\n        '...',\r\n});\r\n\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n      privateKey: account.privateKey,\r\n});\r\n```\r\n### Fund Account with UST\r\nFor Terra testnet (bombay-12), users can top up their balance with UST using [faucet](https://faucet.terra.money/).\r\n### Executor\r\n`AnchorEarn` helps execute three functionalities:\r\n- deposit: deposit funds in the Anchor protocol\r\n- withdraw: withdraw previously deposited funds\r\n- send: transfer `UST` and `AUST` to other accounts\r\nThe following code snippets show how to use the `AnchorEarn` object.\r\n> **NOTE**: Currently, Anchor Earn supports the deposit of the`UST` currency only.\r\n#### Deposit \r\nTo deposit funds in the Anchor Protocol, use the following example:\r\n```ts\r\nconst deposit = await anchorEarn.deposit({\r\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\r\n      currency: DENOMS.UST,\r\n    });\r\n```\r\n#### Withdraw\r\nTo withdraw funds from the protocol, use the following example:\r\n```ts\r\nconst deposit = await anchorEarn.withdraw({\r\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\r\n      currency: DENOMS.UST,\r\n});\r\n```\r\n#### Send\r\nTo send `UST` and `AUST` to other accounts, use the following example: \r\n<br/>\r\n<sub>(For this functionality, the `AUST` denom is also supported.) </sub>\r\n```ts\r\n const sendUst = await anchorEarn.send({\r\n      currency: DENOMS.UST,\r\n      recipient: 'terra1....',\r\n      amount: '...', // amount in natural decimal e.g. 100.5. The amount will be handled in macro.\r\n    });\r\n```\r\n### Querier\r\n`AnchorEarn` querier facilitates both querying smart contracts and the chain. There are two queries provided by the `AnchorEarn` object:\r\n- balance: query user balance and user deposit based on currency\r\n- market: return the state of the specified currency's market\r\nIf a user wishes to use only the queries, there is no need to instantiate the object as explained [here](#anchorearn-object);\r\ninstead, they can provide the address for queries as demonstrated by the following examples: \r\n#### Balance\r\nTo get the current state of an account, use the following example:\r\n> > **Note**: The address of the account must be specified in construction.\r\n```ts\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n    });\r\nconst userBalance = await anchorEarn.balance({\r\n      currencies: [DENOMS.UST],\r\n});\r\n```\r\n#### Market\r\nTo get the current state of the market, use the example below:\r\n```ts\r\nconst market = await anchorEarn.market({\r\n      currencies: [DENOMS.UST],\r\n});\r\n```\r\n### CustomSigner\r\nAnchor Earn also provides users with the functionality to sign transactions and leave the signed transaction to the SDK to perform the broadcasting.\r\n \r\n `CustomSigner` is a callback function with which the users can sign `deposit`, `withdraw`, and `send` transactions.\r\n  \r\nThe following code snippet specifies an example of the `CustomSigner` usage:\r\n```ts\r\nconst customSigner = async (tx: Msg[]) => {\r\n      const account = new MnemonicKey({\r\n        mnemonic:\r\n          '...',\r\n      });\r\n\r\n      const wallet = new Wallet(\r\n        new LCDClient({\r\n          URL: 'https://bombay-lcd.terra.dev',\r\n          chainID: 'bombay-12',\r\n        }),\r\n        account,\r\n      );\r\n\r\n      return await wallet.createAndSignTx({\r\n        msgs: tx,\r\n        gasAdjustment: 2,\r\n        gasPrices: { uusd: 0.15 },\r\n      });\r\n    };\r\n\r\n    await anchorEarn.deposit({\r\n      amount: '0.01',\r\n      currency: DENOMS.UST,\r\n      log: (data) => {\r\n        console.log(data);\r\n      },\r\n      customSigner: customSigner,\r\n});\r\n```\r\n### CustomBroadcaster\r\nAnchor Earn facilitates a custom broadcast. This can be helpful in the case of applications that rely on external toolings to broadcast transactions. Here is an example of its usage:\r\n```ts\r\nconst anchorEarn = new AnchorEarn({\r\n      chain: CHAINS.TERRA,\r\n      network: NETWORKS.BOMBAY_12,\r\n      mnemonic:\r\n        '...',\r\n});\r\nconst customBroadcaster = async (tx: Msg[]) => {\r\n          const lcd = new LCDClient({\r\n            URL: 'https://bombay-lcd.terra.dev',\r\n            chainID: 'bombay-12',\r\n          });\r\n\r\n          const wallet = new Wallet(\r\n              lcd,\r\n              new MnemonicKey({\r\n                mnemonic:\r\n                    '...',\r\n              }),\r\n          );\r\n\r\n          const signedTx = await wallet.createAndSignTx({\r\n            msgs: tx,\r\n            gasAdjustment: 2,\r\n            gasPrices: { uusd: 0.15 },\r\n          });\r\n\r\n          return lcd.tx.broadcastSync(signedTx).then((result) => {\r\n            return result.txhash;\r\n          });\r\n};\r\nawait anchorEarn.withdraw({\r\n      amount: '0.01',\r\n      currency: DENOMS.AUST,\r\n      log: (data) => {\r\n        console.log(data);\r\n      },\r\n      customBroadcaster: customBroadcaster\r\n});\r\n``` \r\n\r\n### Loggable \r\nFor seeing the progress of the transaction on the chain, `loggable` is provided. The following code shows how to use it:\r\n```ts\r\nconst deposit = await anchorEarn.deposit({\r\n      amount: '...',\r\n      currency: DENOMS.UST,\r\n      log: (data) => {\r\n        console.log(data);\r\n      }\r\n    });\r\n```\r\n## License\r\nThis software is licensed under the Apache 2.0 license. Read more about it [here](./LICENSE).\r\n© 2021 Anchor Protocol","readmeFilename":"README.md"}