├── .editorconfig ├── .env.example ├── .gitignore ├── .npmrc ├── LICENSE ├── README.md ├── package.json ├── pnpm-lock.yaml ├── src ├── main.ts └── scirpts │ ├── abi.ts │ └── qna3ai.ts └── tsconfig.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | max_line_length = 188 10 | indent_size = 2 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | WALLET_PRIVATEKEY=0x6623c5f41a4b295f5fadc4069a05c5d4166a558ba0a7c62e0e781bd0c1d325b3 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig 2 | # Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,jetbrains,node,yarn 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,macos,jetbrains,node,yarn 4 | 5 | ### JetBrains ### 6 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider 7 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 8 | 9 | # User-specific stuff 10 | .idea/**/workspace.xml 11 | .idea/**/tasks.xml 12 | .idea/**/usage.statistics.xml 13 | .idea/**/dictionaries 14 | .idea/**/shelf 15 | 16 | # AWS User-specific 17 | .idea/**/aws.xml 18 | 19 | # Generated files 20 | .idea/**/contentModel.xml 21 | 22 | # Sensitive or high-churn files 23 | .idea/**/dataSources/ 24 | .idea/**/dataSources.ids 25 | .idea/**/dataSources.local.xml 26 | .idea/**/sqlDataSources.xml 27 | .idea/**/dynamic.xml 28 | .idea/**/uiDesigner.xml 29 | .idea/**/dbnavigator.xml 30 | 31 | # Gradle 32 | .idea/**/gradle.xml 33 | .idea/**/libraries 34 | 35 | # Gradle and Maven with auto-import 36 | # When using Gradle or Maven with auto-import, you should exclude module files, 37 | # since they will be recreated, and may cause churn. Uncomment if using 38 | # auto-import. 39 | # .idea/artifacts 40 | # .idea/compiler.xml 41 | # .idea/jarRepositories.xml 42 | # .idea/modules.xml 43 | # .idea/*.iml 44 | # .idea/modules 45 | # *.iml 46 | # *.ipr 47 | 48 | # CMake 49 | cmake-build-*/ 50 | 51 | # Mongo Explorer plugin 52 | .idea/**/mongoSettings.xml 53 | 54 | # File-based project format 55 | *.iws 56 | 57 | # IntelliJ 58 | out/ 59 | 60 | # mpeltonen/sbt-idea plugin 61 | .idea_modules/ 62 | 63 | # JIRA plugin 64 | atlassian-ide-plugin.xml 65 | 66 | # Cursive Clojure plugin 67 | .idea/replstate.xml 68 | 69 | # SonarLint plugin 70 | .idea/sonarlint/ 71 | 72 | # Crashlytics plugin (for Android Studio and IntelliJ) 73 | com_crashlytics_export_strings.xml 74 | crashlytics.properties 75 | crashlytics-build.properties 76 | fabric.properties 77 | 78 | # Editor-based Rest Client 79 | .idea/httpRequests 80 | 81 | # Android studio 3.1+ serialized cache file 82 | .idea/caches/build_file_checksums.ser 83 | 84 | ### JetBrains Patch ### 85 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 86 | 87 | # *.iml 88 | # modules.xml 89 | # .idea/misc.xml 90 | # *.ipr 91 | 92 | # Sonarlint plugin 93 | # https://plugins.jetbrains.com/plugin/7973-sonarlint 94 | .idea/**/sonarlint/ 95 | 96 | # SonarQube Plugin 97 | # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin 98 | .idea/**/sonarIssues.xml 99 | 100 | # Markdown Navigator plugin 101 | # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced 102 | .idea/**/markdown-navigator.xml 103 | .idea/**/markdown-navigator-enh.xml 104 | .idea/**/markdown-navigator/ 105 | 106 | # Cache file creation bug 107 | # See https://youtrack.jetbrains.com/issue/JBR-2257 108 | .idea/$CACHE_FILE$ 109 | 110 | # CodeStream plugin 111 | # https://plugins.jetbrains.com/plugin/12206-codestream 112 | .idea/codestream.xml 113 | 114 | # Azure Toolkit for IntelliJ plugin 115 | # https://plugins.jetbrains.com/plugin/8053-azure-toolkit-for-intellij 116 | .idea/**/azureSettings.xml 117 | 118 | ### macOS ### 119 | # General 120 | .DS_Store 121 | .AppleDouble 122 | .LSOverride 123 | 124 | # Icon must end with two \r 125 | Icon 126 | 127 | 128 | # Thumbnails 129 | ._* 130 | 131 | # Files that might appear in the root of a volume 132 | .DocumentRevisions-V100 133 | .fseventsd 134 | .Spotlight-V100 135 | .TemporaryItems 136 | .Trashes 137 | .VolumeIcon.icns 138 | .com.apple.timemachine.donotpresent 139 | 140 | # Directories potentially created on remote AFP share 141 | .AppleDB 142 | .AppleDesktop 143 | Network Trash Folder 144 | Temporary Items 145 | .apdisk 146 | 147 | ### macOS Patch ### 148 | # iCloud generated files 149 | *.icloud 150 | 151 | ### Node ### 152 | # Logs 153 | logs 154 | *.log 155 | npm-debug.log* 156 | yarn-debug.log* 157 | yarn-error.log* 158 | lerna-debug.log* 159 | .pnpm-debug.log* 160 | 161 | # Diagnostic reports (https://nodejs.org/api/report.html) 162 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 163 | 164 | # Runtime data 165 | pids 166 | *.pid 167 | *.seed 168 | *.pid.lock 169 | 170 | # Directory for instrumented libs generated by jscoverage/JSCover 171 | lib-cov 172 | 173 | # Coverage directory used by tools like istanbul 174 | coverage 175 | *.lcov 176 | 177 | # nyc test coverage 178 | .nyc_output 179 | 180 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 181 | .grunt 182 | 183 | # Bower dependency directory (https://bower.io/) 184 | bower_components 185 | 186 | # node-waf configuration 187 | .lock-wscript 188 | 189 | # Compiled binary addons (https://nodejs.org/api/addons.html) 190 | build/Release 191 | 192 | # Dependency directories 193 | node_modules/ 194 | jspm_packages/ 195 | 196 | # Snowpack dependency directory (https://snowpack.dev/) 197 | web_modules/ 198 | 199 | # TypeScript cache 200 | *.tsbuildinfo 201 | 202 | # Optional npm cache directory 203 | .npm 204 | 205 | # Optional eslint cache 206 | .eslintcache 207 | 208 | # Optional stylelint cache 209 | .stylelintcache 210 | 211 | # Microbundle cache 212 | .rpt2_cache/ 213 | .rts2_cache_cjs/ 214 | .rts2_cache_es/ 215 | .rts2_cache_umd/ 216 | 217 | # Optional REPL history 218 | .node_repl_history 219 | 220 | # Output of 'npm pack' 221 | *.tgz 222 | 223 | # Yarn Integrity file 224 | .yarn-integrity 225 | 226 | # dotenv environment variable files 227 | .env 228 | .env.development.local 229 | .env.test.local 230 | .env.production.local 231 | .env.local 232 | 233 | # parcel-bundler cache (https://parceljs.org/) 234 | .cache 235 | .parcel-cache 236 | 237 | # Next.js build output 238 | .next 239 | out 240 | 241 | # Nuxt.js build / generate output 242 | .nuxt 243 | dist 244 | 245 | # Gatsby files 246 | .cache/ 247 | # Comment in the public line in if your project uses Gatsby and not Next.js 248 | # https://nextjs.org/blog/next-9-1#public-directory-support 249 | # public 250 | 251 | # vuepress build output 252 | .vuepress/dist 253 | 254 | # vuepress v2.x temp and cache directory 255 | .temp 256 | 257 | # Docusaurus cache and generated files 258 | .docusaurus 259 | 260 | # Serverless directories 261 | .serverless/ 262 | 263 | # FuseBox cache 264 | .fusebox/ 265 | 266 | # DynamoDB Local files 267 | .dynamodb/ 268 | 269 | # TernJS port file 270 | .tern-port 271 | 272 | # Stores VSCode versions used for testing VSCode extensions 273 | .vscode-test 274 | 275 | # yarn v2 276 | .yarn/cache 277 | .yarn/unplugged 278 | .yarn/build-state.yml 279 | .yarn/install-state.gz 280 | .pnp.* 281 | 282 | ### Node Patch ### 283 | # Serverless Webpack directories 284 | .webpack/ 285 | 286 | # Optional stylelint cache 287 | 288 | # SvelteKit build / generate output 289 | .svelte-kit 290 | 291 | ### VisualStudioCode ### 292 | .vscode/* 293 | !.vscode/settings.json 294 | !.vscode/tasks.json 295 | !.vscode/launch.json 296 | !.vscode/extensions.json 297 | !.vscode/*.code-snippets 298 | 299 | # Local History for Visual Studio Code 300 | .history/ 301 | 302 | # Built Visual Studio Code Extensions 303 | *.vsix 304 | 305 | ### VisualStudioCode Patch ### 306 | # Ignore all local history of files 307 | .history 308 | .ionide 309 | 310 | ### yarn ### 311 | # https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored 312 | 313 | .yarn/* 314 | !.yarn/releases 315 | !.yarn/patches 316 | !.yarn/plugins 317 | !.yarn/sdks 318 | !.yarn/versions 319 | 320 | # if you are NOT using Zero-installs, then: 321 | # comment the following lines 322 | !.yarn/cache 323 | 324 | # and uncomment the following lines 325 | # .pnp.* 326 | 327 | # End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,jetbrains,node,yarn 328 | 329 | # Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option) 330 | .env 331 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | auto-install-peers=true 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [2024] [wy] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 撸毛脚本 2 | 3 | ## Qna3 Ai 4 | 5 | [Qna3 Ai](https://qna3.ai/) 6 | 7 | ### Quick start 8 | 9 | ``` bash 10 | # .env 11 | WALLET_PRIVATEKEY=0x6623c5f41a4b295f5fadc4069a05c5d4166a558ba0a7c62e0e781bd0c1d325b3 12 | ``` 13 | 14 | ```js 15 | const wallet = new Wallet(process.env.WALLET_PRIVATEKEY); 16 | const qna3 = new Qna3(wallet, 204); 17 | 18 | // 登录(第一次登录就需要绑定邀请码) 19 | await qna3.login("78yppP2H"); 20 | 21 | // 每日签到 22 | await qna3.checkIn(); 23 | 24 | ``` 25 | 26 | ``` bash 27 | pnpm install 28 | 29 | pnpm run start 30 | ``` 31 | 32 | # 免责声明 33 | 34 | 该项目是一个开源项目,您可以自由使用、修改和分发。然而,请注意以下事项: 35 | 36 | 1. 该项目的所有代码、文档和其他内容是按原样提供的,没有任何形式的明示或暗示的保证。作者对代码的适用性、可靠性和安全性不作任何保证。 37 | 38 | 2. 作者对于因使用该项目而导致的任何损失或损害概不负责,包括但不限于直接、间接、偶然、特殊或后果性的损失。 39 | 40 | 3. 作者不承担任何修复或维护的责任。使用者有责任对代码进行充分的测试和验证。 41 | 42 | 4. 作者保留拒绝对任何问题提供支持或解决方案的权利。 43 | 44 | 5. 任何人在使用该项目时,应当遵循适用的法律和法规,以及第三方的权利和许可要求。 45 | 46 | 通过使用该项目,您表明您已经阅读、理解并接受了这些免责声明。 47 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "qna3ai-scripts", 3 | "version": "1.0.0", 4 | "description": "qna3ai 自动签到脚本", 5 | "scripts": { 6 | "start": "ts-node src/main.ts" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "git@github.com:AxyLm/qna3ai-script.git" 11 | }, 12 | "keywords": [], 13 | "devDependencies": { 14 | "@ethersproject/abi": "^5.7.0", 15 | "@ethersproject/abstract-provider": "^5.7.0", 16 | "@ethersproject/contracts": "^5.7.0", 17 | "@ethersproject/providers": "^5.7.2", 18 | "@ethersproject/wallet": "^5.7.0", 19 | "@total-typescript/ts-reset": "^0.4.2", 20 | "@types/node": "^18.7.13", 21 | "axios": "^1.6.5", 22 | "bignumber.js": "^9.1.1", 23 | "buffer": "^6.0.3", 24 | "dotenv": "^16.3.1", 25 | "ethers": "5.7.2", 26 | "ts-node": "^10.9.1", 27 | "tslib": "^2.4.0", 28 | "typedoc": "^0.23.28", 29 | "typescript": "^4.8.2" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: '6.0' 2 | 3 | settings: 4 | autoInstallPeers: true 5 | excludeLinksFromLockfile: false 6 | 7 | devDependencies: 8 | '@ethersproject/abi': 9 | specifier: ^5.7.0 10 | version: 5.7.0 11 | '@ethersproject/abstract-provider': 12 | specifier: ^5.7.0 13 | version: 5.7.0 14 | '@ethersproject/contracts': 15 | specifier: ^5.7.0 16 | version: 5.7.0 17 | '@ethersproject/providers': 18 | specifier: ^5.7.2 19 | version: 5.7.2 20 | '@ethersproject/wallet': 21 | specifier: ^5.7.0 22 | version: 5.7.0 23 | '@total-typescript/ts-reset': 24 | specifier: ^0.4.2 25 | version: 0.4.2 26 | '@types/node': 27 | specifier: ^18.7.13 28 | version: 18.19.4 29 | axios: 30 | specifier: ^1.6.5 31 | version: 1.6.5 32 | bignumber.js: 33 | specifier: ^9.1.1 34 | version: 9.1.2 35 | buffer: 36 | specifier: ^6.0.3 37 | version: 6.0.3 38 | dotenv: 39 | specifier: ^16.3.1 40 | version: 16.3.1 41 | ethers: 42 | specifier: 5.7.2 43 | version: 5.7.2 44 | ts-node: 45 | specifier: ^10.9.1 46 | version: 10.9.2(@types/node@18.19.4)(typescript@4.9.5) 47 | tslib: 48 | specifier: ^2.4.0 49 | version: 2.6.2 50 | typedoc: 51 | specifier: ^0.23.28 52 | version: 0.23.28(typescript@4.9.5) 53 | typescript: 54 | specifier: ^4.8.2 55 | version: 4.9.5 56 | 57 | packages: 58 | 59 | /@cspotcode/source-map-support@0.8.1: 60 | resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} 61 | engines: {node: '>=12'} 62 | dependencies: 63 | '@jridgewell/trace-mapping': 0.3.9 64 | dev: true 65 | 66 | /@ethersproject/abi@5.7.0: 67 | resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} 68 | dependencies: 69 | '@ethersproject/address': 5.7.0 70 | '@ethersproject/bignumber': 5.7.0 71 | '@ethersproject/bytes': 5.7.0 72 | '@ethersproject/constants': 5.7.0 73 | '@ethersproject/hash': 5.7.0 74 | '@ethersproject/keccak256': 5.7.0 75 | '@ethersproject/logger': 5.7.0 76 | '@ethersproject/properties': 5.7.0 77 | '@ethersproject/strings': 5.7.0 78 | dev: true 79 | 80 | /@ethersproject/abstract-provider@5.7.0: 81 | resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} 82 | dependencies: 83 | '@ethersproject/bignumber': 5.7.0 84 | '@ethersproject/bytes': 5.7.0 85 | '@ethersproject/logger': 5.7.0 86 | '@ethersproject/networks': 5.7.1 87 | '@ethersproject/properties': 5.7.0 88 | '@ethersproject/transactions': 5.7.0 89 | '@ethersproject/web': 5.7.1 90 | dev: true 91 | 92 | /@ethersproject/abstract-signer@5.7.0: 93 | resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} 94 | dependencies: 95 | '@ethersproject/abstract-provider': 5.7.0 96 | '@ethersproject/bignumber': 5.7.0 97 | '@ethersproject/bytes': 5.7.0 98 | '@ethersproject/logger': 5.7.0 99 | '@ethersproject/properties': 5.7.0 100 | dev: true 101 | 102 | /@ethersproject/address@5.7.0: 103 | resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} 104 | dependencies: 105 | '@ethersproject/bignumber': 5.7.0 106 | '@ethersproject/bytes': 5.7.0 107 | '@ethersproject/keccak256': 5.7.0 108 | '@ethersproject/logger': 5.7.0 109 | '@ethersproject/rlp': 5.7.0 110 | dev: true 111 | 112 | /@ethersproject/base64@5.7.0: 113 | resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} 114 | dependencies: 115 | '@ethersproject/bytes': 5.7.0 116 | dev: true 117 | 118 | /@ethersproject/basex@5.7.0: 119 | resolution: {integrity: sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==} 120 | dependencies: 121 | '@ethersproject/bytes': 5.7.0 122 | '@ethersproject/properties': 5.7.0 123 | dev: true 124 | 125 | /@ethersproject/bignumber@5.7.0: 126 | resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} 127 | dependencies: 128 | '@ethersproject/bytes': 5.7.0 129 | '@ethersproject/logger': 5.7.0 130 | bn.js: 5.2.1 131 | dev: true 132 | 133 | /@ethersproject/bytes@5.7.0: 134 | resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} 135 | dependencies: 136 | '@ethersproject/logger': 5.7.0 137 | dev: true 138 | 139 | /@ethersproject/constants@5.7.0: 140 | resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} 141 | dependencies: 142 | '@ethersproject/bignumber': 5.7.0 143 | dev: true 144 | 145 | /@ethersproject/contracts@5.7.0: 146 | resolution: {integrity: sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==} 147 | dependencies: 148 | '@ethersproject/abi': 5.7.0 149 | '@ethersproject/abstract-provider': 5.7.0 150 | '@ethersproject/abstract-signer': 5.7.0 151 | '@ethersproject/address': 5.7.0 152 | '@ethersproject/bignumber': 5.7.0 153 | '@ethersproject/bytes': 5.7.0 154 | '@ethersproject/constants': 5.7.0 155 | '@ethersproject/logger': 5.7.0 156 | '@ethersproject/properties': 5.7.0 157 | '@ethersproject/transactions': 5.7.0 158 | dev: true 159 | 160 | /@ethersproject/hash@5.7.0: 161 | resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} 162 | dependencies: 163 | '@ethersproject/abstract-signer': 5.7.0 164 | '@ethersproject/address': 5.7.0 165 | '@ethersproject/base64': 5.7.0 166 | '@ethersproject/bignumber': 5.7.0 167 | '@ethersproject/bytes': 5.7.0 168 | '@ethersproject/keccak256': 5.7.0 169 | '@ethersproject/logger': 5.7.0 170 | '@ethersproject/properties': 5.7.0 171 | '@ethersproject/strings': 5.7.0 172 | dev: true 173 | 174 | /@ethersproject/hdnode@5.7.0: 175 | resolution: {integrity: sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==} 176 | dependencies: 177 | '@ethersproject/abstract-signer': 5.7.0 178 | '@ethersproject/basex': 5.7.0 179 | '@ethersproject/bignumber': 5.7.0 180 | '@ethersproject/bytes': 5.7.0 181 | '@ethersproject/logger': 5.7.0 182 | '@ethersproject/pbkdf2': 5.7.0 183 | '@ethersproject/properties': 5.7.0 184 | '@ethersproject/sha2': 5.7.0 185 | '@ethersproject/signing-key': 5.7.0 186 | '@ethersproject/strings': 5.7.0 187 | '@ethersproject/transactions': 5.7.0 188 | '@ethersproject/wordlists': 5.7.0 189 | dev: true 190 | 191 | /@ethersproject/json-wallets@5.7.0: 192 | resolution: {integrity: sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==} 193 | dependencies: 194 | '@ethersproject/abstract-signer': 5.7.0 195 | '@ethersproject/address': 5.7.0 196 | '@ethersproject/bytes': 5.7.0 197 | '@ethersproject/hdnode': 5.7.0 198 | '@ethersproject/keccak256': 5.7.0 199 | '@ethersproject/logger': 5.7.0 200 | '@ethersproject/pbkdf2': 5.7.0 201 | '@ethersproject/properties': 5.7.0 202 | '@ethersproject/random': 5.7.0 203 | '@ethersproject/strings': 5.7.0 204 | '@ethersproject/transactions': 5.7.0 205 | aes-js: 3.0.0 206 | scrypt-js: 3.0.1 207 | dev: true 208 | 209 | /@ethersproject/keccak256@5.7.0: 210 | resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} 211 | dependencies: 212 | '@ethersproject/bytes': 5.7.0 213 | js-sha3: 0.8.0 214 | dev: true 215 | 216 | /@ethersproject/logger@5.7.0: 217 | resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} 218 | dev: true 219 | 220 | /@ethersproject/networks@5.7.1: 221 | resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} 222 | dependencies: 223 | '@ethersproject/logger': 5.7.0 224 | dev: true 225 | 226 | /@ethersproject/pbkdf2@5.7.0: 227 | resolution: {integrity: sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==} 228 | dependencies: 229 | '@ethersproject/bytes': 5.7.0 230 | '@ethersproject/sha2': 5.7.0 231 | dev: true 232 | 233 | /@ethersproject/properties@5.7.0: 234 | resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} 235 | dependencies: 236 | '@ethersproject/logger': 5.7.0 237 | dev: true 238 | 239 | /@ethersproject/providers@5.7.2: 240 | resolution: {integrity: sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==} 241 | dependencies: 242 | '@ethersproject/abstract-provider': 5.7.0 243 | '@ethersproject/abstract-signer': 5.7.0 244 | '@ethersproject/address': 5.7.0 245 | '@ethersproject/base64': 5.7.0 246 | '@ethersproject/basex': 5.7.0 247 | '@ethersproject/bignumber': 5.7.0 248 | '@ethersproject/bytes': 5.7.0 249 | '@ethersproject/constants': 5.7.0 250 | '@ethersproject/hash': 5.7.0 251 | '@ethersproject/logger': 5.7.0 252 | '@ethersproject/networks': 5.7.1 253 | '@ethersproject/properties': 5.7.0 254 | '@ethersproject/random': 5.7.0 255 | '@ethersproject/rlp': 5.7.0 256 | '@ethersproject/sha2': 5.7.0 257 | '@ethersproject/strings': 5.7.0 258 | '@ethersproject/transactions': 5.7.0 259 | '@ethersproject/web': 5.7.1 260 | bech32: 1.1.4 261 | ws: 7.4.6 262 | transitivePeerDependencies: 263 | - bufferutil 264 | - utf-8-validate 265 | dev: true 266 | 267 | /@ethersproject/random@5.7.0: 268 | resolution: {integrity: sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==} 269 | dependencies: 270 | '@ethersproject/bytes': 5.7.0 271 | '@ethersproject/logger': 5.7.0 272 | dev: true 273 | 274 | /@ethersproject/rlp@5.7.0: 275 | resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} 276 | dependencies: 277 | '@ethersproject/bytes': 5.7.0 278 | '@ethersproject/logger': 5.7.0 279 | dev: true 280 | 281 | /@ethersproject/sha2@5.7.0: 282 | resolution: {integrity: sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==} 283 | dependencies: 284 | '@ethersproject/bytes': 5.7.0 285 | '@ethersproject/logger': 5.7.0 286 | hash.js: 1.1.7 287 | dev: true 288 | 289 | /@ethersproject/signing-key@5.7.0: 290 | resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} 291 | dependencies: 292 | '@ethersproject/bytes': 5.7.0 293 | '@ethersproject/logger': 5.7.0 294 | '@ethersproject/properties': 5.7.0 295 | bn.js: 5.2.1 296 | elliptic: 6.5.4 297 | hash.js: 1.1.7 298 | dev: true 299 | 300 | /@ethersproject/solidity@5.7.0: 301 | resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==} 302 | dependencies: 303 | '@ethersproject/bignumber': 5.7.0 304 | '@ethersproject/bytes': 5.7.0 305 | '@ethersproject/keccak256': 5.7.0 306 | '@ethersproject/logger': 5.7.0 307 | '@ethersproject/sha2': 5.7.0 308 | '@ethersproject/strings': 5.7.0 309 | dev: true 310 | 311 | /@ethersproject/strings@5.7.0: 312 | resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} 313 | dependencies: 314 | '@ethersproject/bytes': 5.7.0 315 | '@ethersproject/constants': 5.7.0 316 | '@ethersproject/logger': 5.7.0 317 | dev: true 318 | 319 | /@ethersproject/transactions@5.7.0: 320 | resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} 321 | dependencies: 322 | '@ethersproject/address': 5.7.0 323 | '@ethersproject/bignumber': 5.7.0 324 | '@ethersproject/bytes': 5.7.0 325 | '@ethersproject/constants': 5.7.0 326 | '@ethersproject/keccak256': 5.7.0 327 | '@ethersproject/logger': 5.7.0 328 | '@ethersproject/properties': 5.7.0 329 | '@ethersproject/rlp': 5.7.0 330 | '@ethersproject/signing-key': 5.7.0 331 | dev: true 332 | 333 | /@ethersproject/units@5.7.0: 334 | resolution: {integrity: sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==} 335 | dependencies: 336 | '@ethersproject/bignumber': 5.7.0 337 | '@ethersproject/constants': 5.7.0 338 | '@ethersproject/logger': 5.7.0 339 | dev: true 340 | 341 | /@ethersproject/wallet@5.7.0: 342 | resolution: {integrity: sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==} 343 | dependencies: 344 | '@ethersproject/abstract-provider': 5.7.0 345 | '@ethersproject/abstract-signer': 5.7.0 346 | '@ethersproject/address': 5.7.0 347 | '@ethersproject/bignumber': 5.7.0 348 | '@ethersproject/bytes': 5.7.0 349 | '@ethersproject/hash': 5.7.0 350 | '@ethersproject/hdnode': 5.7.0 351 | '@ethersproject/json-wallets': 5.7.0 352 | '@ethersproject/keccak256': 5.7.0 353 | '@ethersproject/logger': 5.7.0 354 | '@ethersproject/properties': 5.7.0 355 | '@ethersproject/random': 5.7.0 356 | '@ethersproject/signing-key': 5.7.0 357 | '@ethersproject/transactions': 5.7.0 358 | '@ethersproject/wordlists': 5.7.0 359 | dev: true 360 | 361 | /@ethersproject/web@5.7.1: 362 | resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} 363 | dependencies: 364 | '@ethersproject/base64': 5.7.0 365 | '@ethersproject/bytes': 5.7.0 366 | '@ethersproject/logger': 5.7.0 367 | '@ethersproject/properties': 5.7.0 368 | '@ethersproject/strings': 5.7.0 369 | dev: true 370 | 371 | /@ethersproject/wordlists@5.7.0: 372 | resolution: {integrity: sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==} 373 | dependencies: 374 | '@ethersproject/bytes': 5.7.0 375 | '@ethersproject/hash': 5.7.0 376 | '@ethersproject/logger': 5.7.0 377 | '@ethersproject/properties': 5.7.0 378 | '@ethersproject/strings': 5.7.0 379 | dev: true 380 | 381 | /@jridgewell/resolve-uri@3.1.1: 382 | resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} 383 | engines: {node: '>=6.0.0'} 384 | dev: true 385 | 386 | /@jridgewell/sourcemap-codec@1.4.15: 387 | resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} 388 | dev: true 389 | 390 | /@jridgewell/trace-mapping@0.3.9: 391 | resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} 392 | dependencies: 393 | '@jridgewell/resolve-uri': 3.1.1 394 | '@jridgewell/sourcemap-codec': 1.4.15 395 | dev: true 396 | 397 | /@total-typescript/ts-reset@0.4.2: 398 | resolution: {integrity: sha512-vqd7ZUDSrXFVT1n8b2kc3LnklncDQFPvR58yUS1kEP23/nHPAO9l1lMjUfnPrXYYk4Hj54rrLKMW5ipwk7k09A==} 399 | dev: true 400 | 401 | /@tsconfig/node10@1.0.9: 402 | resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} 403 | dev: true 404 | 405 | /@tsconfig/node12@1.0.11: 406 | resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} 407 | dev: true 408 | 409 | /@tsconfig/node14@1.0.3: 410 | resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} 411 | dev: true 412 | 413 | /@tsconfig/node16@1.0.4: 414 | resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} 415 | dev: true 416 | 417 | /@types/node@18.19.4: 418 | resolution: {integrity: sha512-xNzlUhzoHotIsnFoXmJB+yWmBvFZgKCI9TtPIEdYIMM1KWfwuY8zh7wvc1u1OAXlC7dlf6mZVx/s+Y5KfFz19A==} 419 | dependencies: 420 | undici-types: 5.26.5 421 | dev: true 422 | 423 | /acorn-walk@8.3.1: 424 | resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==} 425 | engines: {node: '>=0.4.0'} 426 | dev: true 427 | 428 | /acorn@8.11.3: 429 | resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} 430 | engines: {node: '>=0.4.0'} 431 | hasBin: true 432 | dev: true 433 | 434 | /aes-js@3.0.0: 435 | resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} 436 | dev: true 437 | 438 | /ansi-sequence-parser@1.1.1: 439 | resolution: {integrity: sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==} 440 | dev: true 441 | 442 | /arg@4.1.3: 443 | resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} 444 | dev: true 445 | 446 | /asynckit@0.4.0: 447 | resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} 448 | dev: true 449 | 450 | /axios@1.6.5: 451 | resolution: {integrity: sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==} 452 | dependencies: 453 | follow-redirects: 1.15.4 454 | form-data: 4.0.0 455 | proxy-from-env: 1.1.0 456 | transitivePeerDependencies: 457 | - debug 458 | dev: true 459 | 460 | /balanced-match@1.0.2: 461 | resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} 462 | dev: true 463 | 464 | /base64-js@1.5.1: 465 | resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} 466 | dev: true 467 | 468 | /bech32@1.1.4: 469 | resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} 470 | dev: true 471 | 472 | /bignumber.js@9.1.2: 473 | resolution: {integrity: sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==} 474 | dev: true 475 | 476 | /bn.js@4.12.0: 477 | resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} 478 | dev: true 479 | 480 | /bn.js@5.2.1: 481 | resolution: {integrity: sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==} 482 | dev: true 483 | 484 | /brace-expansion@2.0.1: 485 | resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} 486 | dependencies: 487 | balanced-match: 1.0.2 488 | dev: true 489 | 490 | /brorand@1.1.0: 491 | resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} 492 | dev: true 493 | 494 | /buffer@6.0.3: 495 | resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} 496 | dependencies: 497 | base64-js: 1.5.1 498 | ieee754: 1.2.1 499 | dev: true 500 | 501 | /combined-stream@1.0.8: 502 | resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} 503 | engines: {node: '>= 0.8'} 504 | dependencies: 505 | delayed-stream: 1.0.0 506 | dev: true 507 | 508 | /create-require@1.1.1: 509 | resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} 510 | dev: true 511 | 512 | /delayed-stream@1.0.0: 513 | resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} 514 | engines: {node: '>=0.4.0'} 515 | dev: true 516 | 517 | /diff@4.0.2: 518 | resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} 519 | engines: {node: '>=0.3.1'} 520 | dev: true 521 | 522 | /dotenv@16.3.1: 523 | resolution: {integrity: sha512-IPzF4w4/Rd94bA9imS68tZBaYyBWSCE47V1RGuMrB94iyTOIEwRmVL2x/4An+6mETpLrKJ5hQkB8W4kFAadeIQ==} 524 | engines: {node: '>=12'} 525 | dev: true 526 | 527 | /elliptic@6.5.4: 528 | resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} 529 | dependencies: 530 | bn.js: 4.12.0 531 | brorand: 1.1.0 532 | hash.js: 1.1.7 533 | hmac-drbg: 1.0.1 534 | inherits: 2.0.4 535 | minimalistic-assert: 1.0.1 536 | minimalistic-crypto-utils: 1.0.1 537 | dev: true 538 | 539 | /ethers@5.7.2: 540 | resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==} 541 | dependencies: 542 | '@ethersproject/abi': 5.7.0 543 | '@ethersproject/abstract-provider': 5.7.0 544 | '@ethersproject/abstract-signer': 5.7.0 545 | '@ethersproject/address': 5.7.0 546 | '@ethersproject/base64': 5.7.0 547 | '@ethersproject/basex': 5.7.0 548 | '@ethersproject/bignumber': 5.7.0 549 | '@ethersproject/bytes': 5.7.0 550 | '@ethersproject/constants': 5.7.0 551 | '@ethersproject/contracts': 5.7.0 552 | '@ethersproject/hash': 5.7.0 553 | '@ethersproject/hdnode': 5.7.0 554 | '@ethersproject/json-wallets': 5.7.0 555 | '@ethersproject/keccak256': 5.7.0 556 | '@ethersproject/logger': 5.7.0 557 | '@ethersproject/networks': 5.7.1 558 | '@ethersproject/pbkdf2': 5.7.0 559 | '@ethersproject/properties': 5.7.0 560 | '@ethersproject/providers': 5.7.2 561 | '@ethersproject/random': 5.7.0 562 | '@ethersproject/rlp': 5.7.0 563 | '@ethersproject/sha2': 5.7.0 564 | '@ethersproject/signing-key': 5.7.0 565 | '@ethersproject/solidity': 5.7.0 566 | '@ethersproject/strings': 5.7.0 567 | '@ethersproject/transactions': 5.7.0 568 | '@ethersproject/units': 5.7.0 569 | '@ethersproject/wallet': 5.7.0 570 | '@ethersproject/web': 5.7.1 571 | '@ethersproject/wordlists': 5.7.0 572 | transitivePeerDependencies: 573 | - bufferutil 574 | - utf-8-validate 575 | dev: true 576 | 577 | /follow-redirects@1.15.4: 578 | resolution: {integrity: sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==} 579 | engines: {node: '>=4.0'} 580 | peerDependencies: 581 | debug: '*' 582 | peerDependenciesMeta: 583 | debug: 584 | optional: true 585 | dev: true 586 | 587 | /form-data@4.0.0: 588 | resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} 589 | engines: {node: '>= 6'} 590 | dependencies: 591 | asynckit: 0.4.0 592 | combined-stream: 1.0.8 593 | mime-types: 2.1.35 594 | dev: true 595 | 596 | /hash.js@1.1.7: 597 | resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} 598 | dependencies: 599 | inherits: 2.0.4 600 | minimalistic-assert: 1.0.1 601 | dev: true 602 | 603 | /hmac-drbg@1.0.1: 604 | resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} 605 | dependencies: 606 | hash.js: 1.1.7 607 | minimalistic-assert: 1.0.1 608 | minimalistic-crypto-utils: 1.0.1 609 | dev: true 610 | 611 | /ieee754@1.2.1: 612 | resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} 613 | dev: true 614 | 615 | /inherits@2.0.4: 616 | resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} 617 | dev: true 618 | 619 | /js-sha3@0.8.0: 620 | resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} 621 | dev: true 622 | 623 | /jsonc-parser@3.2.0: 624 | resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} 625 | dev: true 626 | 627 | /lunr@2.3.9: 628 | resolution: {integrity: sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==} 629 | dev: true 630 | 631 | /make-error@1.3.6: 632 | resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} 633 | dev: true 634 | 635 | /marked@4.3.0: 636 | resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} 637 | engines: {node: '>= 12'} 638 | hasBin: true 639 | dev: true 640 | 641 | /mime-db@1.52.0: 642 | resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} 643 | engines: {node: '>= 0.6'} 644 | dev: true 645 | 646 | /mime-types@2.1.35: 647 | resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} 648 | engines: {node: '>= 0.6'} 649 | dependencies: 650 | mime-db: 1.52.0 651 | dev: true 652 | 653 | /minimalistic-assert@1.0.1: 654 | resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} 655 | dev: true 656 | 657 | /minimalistic-crypto-utils@1.0.1: 658 | resolution: {integrity: sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==} 659 | dev: true 660 | 661 | /minimatch@7.4.6: 662 | resolution: {integrity: sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==} 663 | engines: {node: '>=10'} 664 | dependencies: 665 | brace-expansion: 2.0.1 666 | dev: true 667 | 668 | /proxy-from-env@1.1.0: 669 | resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} 670 | dev: true 671 | 672 | /scrypt-js@3.0.1: 673 | resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} 674 | dev: true 675 | 676 | /shiki@0.14.7: 677 | resolution: {integrity: sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==} 678 | dependencies: 679 | ansi-sequence-parser: 1.1.1 680 | jsonc-parser: 3.2.0 681 | vscode-oniguruma: 1.7.0 682 | vscode-textmate: 8.0.0 683 | dev: true 684 | 685 | /ts-node@10.9.2(@types/node@18.19.4)(typescript@4.9.5): 686 | resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} 687 | hasBin: true 688 | peerDependencies: 689 | '@swc/core': '>=1.2.50' 690 | '@swc/wasm': '>=1.2.50' 691 | '@types/node': '*' 692 | typescript: '>=2.7' 693 | peerDependenciesMeta: 694 | '@swc/core': 695 | optional: true 696 | '@swc/wasm': 697 | optional: true 698 | dependencies: 699 | '@cspotcode/source-map-support': 0.8.1 700 | '@tsconfig/node10': 1.0.9 701 | '@tsconfig/node12': 1.0.11 702 | '@tsconfig/node14': 1.0.3 703 | '@tsconfig/node16': 1.0.4 704 | '@types/node': 18.19.4 705 | acorn: 8.11.3 706 | acorn-walk: 8.3.1 707 | arg: 4.1.3 708 | create-require: 1.1.1 709 | diff: 4.0.2 710 | make-error: 1.3.6 711 | typescript: 4.9.5 712 | v8-compile-cache-lib: 3.0.1 713 | yn: 3.1.1 714 | dev: true 715 | 716 | /tslib@2.6.2: 717 | resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} 718 | dev: true 719 | 720 | /typedoc@0.23.28(typescript@4.9.5): 721 | resolution: {integrity: sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==} 722 | engines: {node: '>= 14.14'} 723 | hasBin: true 724 | peerDependencies: 725 | typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x 726 | dependencies: 727 | lunr: 2.3.9 728 | marked: 4.3.0 729 | minimatch: 7.4.6 730 | shiki: 0.14.7 731 | typescript: 4.9.5 732 | dev: true 733 | 734 | /typescript@4.9.5: 735 | resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} 736 | engines: {node: '>=4.2.0'} 737 | hasBin: true 738 | dev: true 739 | 740 | /undici-types@5.26.5: 741 | resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} 742 | dev: true 743 | 744 | /v8-compile-cache-lib@3.0.1: 745 | resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} 746 | dev: true 747 | 748 | /vscode-oniguruma@1.7.0: 749 | resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} 750 | dev: true 751 | 752 | /vscode-textmate@8.0.0: 753 | resolution: {integrity: sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==} 754 | dev: true 755 | 756 | /ws@7.4.6: 757 | resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==} 758 | engines: {node: '>=8.3.0'} 759 | peerDependencies: 760 | bufferutil: ^4.0.1 761 | utf-8-validate: ^5.0.2 762 | peerDependenciesMeta: 763 | bufferutil: 764 | optional: true 765 | utf-8-validate: 766 | optional: true 767 | dev: true 768 | 769 | /yn@3.1.1: 770 | resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} 771 | engines: {node: '>=6'} 772 | dev: true 773 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { Wallet } from "ethers"; 2 | import { Qna3 } from "./scirpts/qna3ai"; 3 | 4 | (async () => { 5 | if (!process.env.WALLET_PRIVATEKEY) { 6 | console.error("%c !!! WALLET_PRIVATEKEY is not set, please create .env file and set it ", "color: red"); 7 | process.exit(1); 8 | } 9 | 10 | const wallet = new Wallet(process.env.WALLET_PRIVATEKEY); 11 | const qna3 = new Qna3(wallet, 204); 12 | 13 | // login and check in 14 | 15 | await qna3.login("78yppP2H"); 16 | await qna3.checkIn(); 17 | })(); 18 | -------------------------------------------------------------------------------- /src/scirpts/abi.ts: -------------------------------------------------------------------------------- 1 | // https://bscscan.com/address/0xB342e7D33b806544609370271A8D074313B7bc30 2 | 3 | export default [ 4 | { 5 | inputs: [], 6 | name: "acceptOwnership", 7 | outputs: [], 8 | stateMutability: "nonpayable", 9 | type: "function", 10 | }, 11 | { 12 | inputs: [], 13 | stateMutability: "nonpayable", 14 | type: "constructor", 15 | }, 16 | { 17 | anonymous: !1, 18 | inputs: [ 19 | { 20 | indexed: !1, 21 | internalType: "uint256", 22 | name: "activityIndex", 23 | type: "uint256", 24 | }, 25 | { 26 | indexed: !1, 27 | internalType: "uint64", 28 | name: "_endTs", 29 | type: "uint64", 30 | }, 31 | ], 32 | name: "ActivityEndTsModify", 33 | type: "event", 34 | }, 35 | { 36 | inputs: [ 37 | { 38 | internalType: "uint64", 39 | name: "_startTs", 40 | type: "uint64", 41 | }, 42 | { 43 | internalType: "uint64", 44 | name: "_endTs", 45 | type: "uint64", 46 | }, 47 | { 48 | internalType: "uint16", 49 | name: "_maxQuestionId", 50 | type: "uint16", 51 | }, 52 | ], 53 | name: "addActivity", 54 | outputs: [], 55 | stateMutability: "nonpayable", 56 | type: "function", 57 | }, 58 | { 59 | inputs: [ 60 | { 61 | internalType: "uint32", 62 | name: "newDefaultCredit", 63 | type: "uint32", 64 | }, 65 | ], 66 | name: "changeDefaultCredit", 67 | outputs: [], 68 | stateMutability: "nonpayable", 69 | type: "function", 70 | }, 71 | { 72 | inputs: [ 73 | { 74 | internalType: "uint32", 75 | name: "newVoteInterval", 76 | type: "uint32", 77 | }, 78 | ], 79 | name: "changeDefaultVoteInterval", 80 | outputs: [], 81 | stateMutability: "nonpayable", 82 | type: "function", 83 | }, 84 | { 85 | inputs: [ 86 | { 87 | internalType: "uint256", 88 | name: "code", 89 | type: "uint256", 90 | }, 91 | ], 92 | name: "checkIn", 93 | outputs: [], 94 | stateMutability: "nonpayable", 95 | type: "function", 96 | }, 97 | { 98 | anonymous: !1, 99 | inputs: [ 100 | { 101 | indexed: !1, 102 | internalType: "uint256", 103 | name: "code", 104 | type: "uint256", 105 | }, 106 | ], 107 | name: "CheckIn", 108 | type: "event", 109 | }, 110 | { 111 | inputs: [ 112 | { 113 | internalType: "uint32", 114 | name: "amount", 115 | type: "uint32", 116 | }, 117 | { 118 | internalType: "uint256", 119 | name: "nonce", 120 | type: "uint256", 121 | }, 122 | { 123 | internalType: "bytes", 124 | name: "signature", 125 | type: "bytes", 126 | }, 127 | ], 128 | name: "claimCredit", 129 | outputs: [], 130 | stateMutability: "nonpayable", 131 | type: "function", 132 | }, 133 | { 134 | anonymous: !1, 135 | inputs: [ 136 | { 137 | indexed: !1, 138 | internalType: "address", 139 | name: "user", 140 | type: "address", 141 | }, 142 | { 143 | indexed: !1, 144 | internalType: "uint32", 145 | name: "amount", 146 | type: "uint32", 147 | }, 148 | { 149 | indexed: !1, 150 | internalType: "uint256", 151 | name: "nonce", 152 | type: "uint256", 153 | }, 154 | ], 155 | name: "CreditClaim", 156 | type: "event", 157 | }, 158 | { 159 | anonymous: !1, 160 | inputs: [ 161 | { 162 | indexed: !1, 163 | internalType: "uint256", 164 | name: "oldDefaultCredit", 165 | type: "uint256", 166 | }, 167 | { 168 | indexed: !1, 169 | internalType: "uint256", 170 | name: "newDefaultCredit", 171 | type: "uint256", 172 | }, 173 | ], 174 | name: "DefaultCreditSet", 175 | type: "event", 176 | }, 177 | { 178 | anonymous: !1, 179 | inputs: [ 180 | { 181 | indexed: !1, 182 | internalType: "uint256", 183 | name: "oldDefaultVoteInterval", 184 | type: "uint256", 185 | }, 186 | { 187 | indexed: !1, 188 | internalType: "uint256", 189 | name: "newVoteInterval", 190 | type: "uint256", 191 | }, 192 | ], 193 | name: "DefaultVoteIntervalSet", 194 | type: "event", 195 | }, 196 | { 197 | inputs: [], 198 | name: "initialize", 199 | outputs: [], 200 | stateMutability: "nonpayable", 201 | type: "function", 202 | }, 203 | { 204 | anonymous: !1, 205 | inputs: [ 206 | { 207 | indexed: !1, 208 | internalType: "uint8", 209 | name: "version", 210 | type: "uint8", 211 | }, 212 | ], 213 | name: "Initialized", 214 | type: "event", 215 | }, 216 | { 217 | inputs: [ 218 | { 219 | internalType: "uint256", 220 | name: "_activityIndex", 221 | type: "uint256", 222 | }, 223 | { 224 | internalType: "uint64", 225 | name: "_endTs", 226 | type: "uint64", 227 | }, 228 | ], 229 | name: "modifyActivityEndTs", 230 | outputs: [], 231 | stateMutability: "nonpayable", 232 | type: "function", 233 | }, 234 | { 235 | anonymous: !1, 236 | inputs: [ 237 | { 238 | indexed: !1, 239 | internalType: "address", 240 | name: "oldOperator", 241 | type: "address", 242 | }, 243 | { 244 | indexed: !1, 245 | internalType: "address", 246 | name: "newOperator", 247 | type: "address", 248 | }, 249 | ], 250 | name: "OperatorSet", 251 | type: "event", 252 | }, 253 | { 254 | anonymous: !1, 255 | inputs: [ 256 | { 257 | indexed: !0, 258 | internalType: "address", 259 | name: "previousOwner", 260 | type: "address", 261 | }, 262 | { 263 | indexed: !0, 264 | internalType: "address", 265 | name: "newOwner", 266 | type: "address", 267 | }, 268 | ], 269 | name: "OwnershipTransferStarted", 270 | type: "event", 271 | }, 272 | { 273 | anonymous: !1, 274 | inputs: [ 275 | { 276 | indexed: !0, 277 | internalType: "address", 278 | name: "previousOwner", 279 | type: "address", 280 | }, 281 | { 282 | indexed: !0, 283 | internalType: "address", 284 | name: "newOwner", 285 | type: "address", 286 | }, 287 | ], 288 | name: "OwnershipTransferred", 289 | type: "event", 290 | }, 291 | { 292 | inputs: [], 293 | name: "renounceOwnership", 294 | outputs: [], 295 | stateMutability: "nonpayable", 296 | type: "function", 297 | }, 298 | { 299 | inputs: [ 300 | { 301 | internalType: "address", 302 | name: "newOperatorAddress", 303 | type: "address", 304 | }, 305 | ], 306 | name: "setOperatorAddress", 307 | outputs: [], 308 | stateMutability: "nonpayable", 309 | type: "function", 310 | }, 311 | { 312 | inputs: [ 313 | { 314 | internalType: "address", 315 | name: "newSigner", 316 | type: "address", 317 | }, 318 | ], 319 | name: "setSignerAddress", 320 | outputs: [], 321 | stateMutability: "nonpayable", 322 | type: "function", 323 | }, 324 | { 325 | anonymous: !1, 326 | inputs: [ 327 | { 328 | indexed: !1, 329 | internalType: "address", 330 | name: "oldSigner", 331 | type: "address", 332 | }, 333 | { 334 | indexed: !1, 335 | internalType: "address", 336 | name: "newSigner", 337 | type: "address", 338 | }, 339 | ], 340 | name: "SignerSet", 341 | type: "event", 342 | }, 343 | { 344 | inputs: [ 345 | { 346 | internalType: "address", 347 | name: "newOwner", 348 | type: "address", 349 | }, 350 | ], 351 | name: "transferOwnership", 352 | outputs: [], 353 | stateMutability: "nonpayable", 354 | type: "function", 355 | }, 356 | { 357 | inputs: [ 358 | { 359 | internalType: "uint256", 360 | name: "activityIndex", 361 | type: "uint256", 362 | }, 363 | { 364 | internalType: "uint256", 365 | name: "questionID", 366 | type: "uint256", 367 | }, 368 | { 369 | internalType: "uint32", 370 | name: "credit", 371 | type: "uint32", 372 | }, 373 | ], 374 | name: "vote", 375 | outputs: [], 376 | stateMutability: "nonpayable", 377 | type: "function", 378 | }, 379 | { 380 | anonymous: !1, 381 | inputs: [ 382 | { 383 | indexed: !1, 384 | internalType: "address", 385 | name: "user", 386 | type: "address", 387 | }, 388 | { 389 | indexed: !1, 390 | internalType: "uint256", 391 | name: "activityIndex", 392 | type: "uint256", 393 | }, 394 | { 395 | indexed: !1, 396 | internalType: "uint256", 397 | name: "questionID", 398 | type: "uint256", 399 | }, 400 | { 401 | indexed: !1, 402 | internalType: "uint32", 403 | name: "credit", 404 | type: "uint32", 405 | }, 406 | ], 407 | name: "VoteQuestion", 408 | type: "event", 409 | }, 410 | { 411 | inputs: [ 412 | { 413 | internalType: "uint256", 414 | name: "", 415 | type: "uint256", 416 | }, 417 | ], 418 | name: "activityList", 419 | outputs: [ 420 | { 421 | internalType: "uint64", 422 | name: "startTs", 423 | type: "uint64", 424 | }, 425 | { 426 | internalType: "uint64", 427 | name: "endTs", 428 | type: "uint64", 429 | }, 430 | { 431 | internalType: "uint16", 432 | name: "maxQuestionId", 433 | type: "uint16", 434 | }, 435 | ], 436 | stateMutability: "view", 437 | type: "function", 438 | }, 439 | { 440 | inputs: [], 441 | name: "activityListLength", 442 | outputs: [ 443 | { 444 | internalType: "uint256", 445 | name: "", 446 | type: "uint256", 447 | }, 448 | ], 449 | stateMutability: "view", 450 | type: "function", 451 | }, 452 | { 453 | inputs: [ 454 | { 455 | internalType: "uint256", 456 | name: "", 457 | type: "uint256", 458 | }, 459 | { 460 | internalType: "uint256", 461 | name: "", 462 | type: "uint256", 463 | }, 464 | ], 465 | name: "activityQuestionVote", 466 | outputs: [ 467 | { 468 | internalType: "uint256", 469 | name: "", 470 | type: "uint256", 471 | }, 472 | ], 473 | stateMutability: "view", 474 | type: "function", 475 | }, 476 | { 477 | inputs: [], 478 | name: "defaultCredit", 479 | outputs: [ 480 | { 481 | internalType: "uint32", 482 | name: "", 483 | type: "uint32", 484 | }, 485 | ], 486 | stateMutability: "view", 487 | type: "function", 488 | }, 489 | { 490 | inputs: [], 491 | name: "defaultVoteInterval", 492 | outputs: [ 493 | { 494 | internalType: "uint32", 495 | name: "", 496 | type: "uint32", 497 | }, 498 | ], 499 | stateMutability: "view", 500 | type: "function", 501 | }, 502 | { 503 | inputs: [ 504 | { 505 | internalType: "uint256", 506 | name: "activityIndex", 507 | type: "uint256", 508 | }, 509 | ], 510 | name: "getActivityInfo", 511 | outputs: [ 512 | { 513 | components: [ 514 | { 515 | internalType: "uint64", 516 | name: "startTs", 517 | type: "uint64", 518 | }, 519 | { 520 | internalType: "uint64", 521 | name: "endTs", 522 | type: "uint64", 523 | }, 524 | { 525 | internalType: "uint16", 526 | name: "maxQuestionId", 527 | type: "uint16", 528 | }, 529 | ], 530 | internalType: "struct QnaVotes.ActivityInfo", 531 | name: "", 532 | type: "tuple", 533 | }, 534 | ], 535 | stateMutability: "view", 536 | type: "function", 537 | }, 538 | { 539 | inputs: [ 540 | { 541 | internalType: "address", 542 | name: "user", 543 | type: "address", 544 | }, 545 | ], 546 | name: "getCredit", 547 | outputs: [ 548 | { 549 | internalType: "uint256", 550 | name: "", 551 | type: "uint256", 552 | }, 553 | ], 554 | stateMutability: "view", 555 | type: "function", 556 | }, 557 | { 558 | inputs: [ 559 | { 560 | internalType: "address", 561 | name: "to", 562 | type: "address", 563 | }, 564 | { 565 | internalType: "uint32", 566 | name: "amount", 567 | type: "uint32", 568 | }, 569 | { 570 | internalType: "uint256", 571 | name: "nonce", 572 | type: "uint256", 573 | }, 574 | ], 575 | name: "getMessageHash", 576 | outputs: [ 577 | { 578 | internalType: "bytes32", 579 | name: "", 580 | type: "bytes32", 581 | }, 582 | ], 583 | stateMutability: "pure", 584 | type: "function", 585 | }, 586 | { 587 | inputs: [], 588 | name: "getSignerAddress", 589 | outputs: [ 590 | { 591 | internalType: "address", 592 | name: "", 593 | type: "address", 594 | }, 595 | ], 596 | stateMutability: "view", 597 | type: "function", 598 | }, 599 | { 600 | inputs: [], 601 | name: "operatorAddress", 602 | outputs: [ 603 | { 604 | internalType: "address", 605 | name: "", 606 | type: "address", 607 | }, 608 | ], 609 | stateMutability: "view", 610 | type: "function", 611 | }, 612 | { 613 | inputs: [], 614 | name: "owner", 615 | outputs: [ 616 | { 617 | internalType: "address", 618 | name: "", 619 | type: "address", 620 | }, 621 | ], 622 | stateMutability: "view", 623 | type: "function", 624 | }, 625 | { 626 | inputs: [], 627 | name: "pendingOwner", 628 | outputs: [ 629 | { 630 | internalType: "address", 631 | name: "", 632 | type: "address", 633 | }, 634 | ], 635 | stateMutability: "view", 636 | type: "function", 637 | }, 638 | { 639 | inputs: [ 640 | { 641 | internalType: "bytes32", 642 | name: "hash", 643 | type: "bytes32", 644 | }, 645 | ], 646 | name: "toEthSignedMessageHash", 647 | outputs: [ 648 | { 649 | internalType: "bytes32", 650 | name: "", 651 | type: "bytes32", 652 | }, 653 | ], 654 | stateMutability: "pure", 655 | type: "function", 656 | }, 657 | { 658 | inputs: [ 659 | { 660 | internalType: "address", 661 | name: "", 662 | type: "address", 663 | }, 664 | ], 665 | name: "userInfoMap", 666 | outputs: [ 667 | { 668 | internalType: "bool", 669 | name: "creditInit", 670 | type: "bool", 671 | }, 672 | { 673 | internalType: "uint32", 674 | name: "creditNum", 675 | type: "uint32", 676 | }, 677 | { 678 | internalType: "uint64", 679 | name: "voteTs", 680 | type: "uint64", 681 | }, 682 | ], 683 | stateMutability: "view", 684 | type: "function", 685 | }, 686 | { 687 | inputs: [ 688 | { 689 | internalType: "bytes32", 690 | name: "_msgHash", 691 | type: "bytes32", 692 | }, 693 | { 694 | internalType: "bytes", 695 | name: "_signature", 696 | type: "bytes", 697 | }, 698 | ], 699 | name: "verify", 700 | outputs: [ 701 | { 702 | internalType: "bool", 703 | name: "", 704 | type: "bool", 705 | }, 706 | ], 707 | stateMutability: "view", 708 | type: "function", 709 | }, 710 | ]; 711 | -------------------------------------------------------------------------------- /src/scirpts/qna3ai.ts: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright 2024 Google LLC 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | import { Wallet, ethers } from "ethers"; 17 | import axios from "axios"; 18 | import abi from "./abi"; 19 | import BigNumber from "bignumber.js"; 20 | 21 | const chainIds = { 22 | 204: { 23 | provider: new ethers.providers.JsonRpcProvider("https://opbnb.publicnode.com"), 24 | }, 25 | 56: { 26 | provider: new ethers.providers.JsonRpcProvider("https://rpc.ankr.com/bsc"), 27 | }, 28 | }; 29 | 30 | interface LoginResult { 31 | accessToken: string; 32 | user: User; 33 | } 34 | 35 | interface User { 36 | id: string; 37 | created_at: string; 38 | updated_at: string; 39 | email?: any; 40 | internal_address?: any; 41 | user_wallet_address: string; 42 | auth0_id?: any; 43 | invite_code: string; 44 | invite_chain: string[]; 45 | invited_by_id?: any; 46 | } 47 | 48 | export class Qna3 { 49 | readonly name = "qna3.ai"; 50 | 51 | private readonly contract: ethers.Contract; 52 | request = axios.create({ 53 | baseURL: "https://api.qna3.ai/", 54 | headers: { 55 | "Content-Type": "application/json", 56 | Origin: "https://qna3.ai", 57 | }, 58 | }); 59 | 60 | readonly provider: ethers.providers.JsonRpcProvider; 61 | 62 | /** 63 | * Qna3 64 | * @param wallet user wallet 65 | * @param chainId 56 | 204 66 | */ 67 | constructor(private readonly wallet: Wallet, readonly chainId: 56 | 204) { 68 | this.provider = chainIds[chainId].provider; 69 | this.wallet.connect(this.provider); 70 | this.contract = new ethers.Contract("0xB342e7D33b806544609370271A8D074313B7bc30", abi, wallet.connect(this.provider)); 71 | this.login(); 72 | } 73 | 74 | accessToken?: string; 75 | id?: string; 76 | invite_id?: string; 77 | loginPromise: Promise | undefined; 78 | 79 | /** 80 | * login 81 | * @docs 登录,获取 accessToken 82 | * 83 | * @param inviteCode 邀请人,上级 84 | * @returns 85 | */ 86 | async login(inviteCode?: string) { 87 | if (!this.loginPromise) { 88 | this.loginPromise = this._login(inviteCode); 89 | } 90 | return this.loginPromise; 91 | } 92 | 93 | async _login(inviteCode?: string) { 94 | const signature = this.wallet.signMessage("AI + DYOR = Ultimate Answer to Unlock Web3 Universe"); 95 | 96 | const params = { 97 | invite_code: inviteCode, 98 | wallet_address: await this.wallet.getAddress(), 99 | signature: await signature, 100 | }; 101 | const { data } = await this.request.post<{ 102 | data: LoginResult; 103 | }>("/api/v2/auth/login?via=wallet", params); 104 | const user = data.data.user; 105 | const accessToken = data.data.accessToken; 106 | this.accessToken = accessToken; 107 | this.id = user.id; 108 | this.invite_id = user.invite_chain[0]; 109 | await this.getMeInfo(); 110 | 111 | this.request = axios.create({ 112 | timeout: 30 * 1000, 113 | baseURL: "https://api.qna3.ai/", 114 | headers: { 115 | "Content-Type": "application/json", 116 | Origin: "https://qna3.ai", 117 | Authorization: `Bearer ${accessToken}`, 118 | }, 119 | }); 120 | 121 | return data.data; 122 | } 123 | 124 | async getMeInfo() { 125 | const auth = { 126 | headers: { 127 | Authorization: `Bearer ${await this.getAccessToken()}`, 128 | }, 129 | }; 130 | const [me, credit] = await Promise.all([this.request.get("/user/me", auth).then((e) => e.data), this.request.get("/user/credit", auth).then((e) => e.data)]).catch((e) => { 131 | console.error(e); 132 | return []; 133 | }); 134 | } 135 | 136 | /** 137 | * invitationCode 138 | * @docs 自己的邀请码 139 | * @type {string} 140 | * @memberof Qna3 141 | */ 142 | invitationCode?: string; 143 | async getInvitationCode() { 144 | if (!this.invitationCode) { 145 | await this.getUserDetail(); 146 | } 147 | return this.invitationCode as string; 148 | } 149 | 150 | /** 151 | * @docs 签到天数 152 | * @type {number} 153 | */ 154 | checkInDays: number = 0; 155 | todayCount: number = 0; 156 | async getUserDetail() { 157 | const { data } = await this.request.post("/api/v2/graphql", { 158 | query: 159 | "query loadUserDetail($cursored: CursoredRequestInput!) {\n userDetail {\n checkInStatus {\n checkInDays\n todayCount\n }\n credit\n creditHistories(cursored: $cursored) {\n cursorInfo {\n endCursor\n hasNextPage\n }\n items {\n claimed\n extra\n id\n score\n signDay\n signInId\n txHash\n typ\n }\n total\n }\n invitation {\n code\n inviteeCount\n leftCount\n }\n origin {\n email\n id\n internalAddress\n userWalletAddress\n }\n voteHistoryOfCurrentActivity {\n created_at\n query\n }\n ambassadorProgram {\n bonus\n claimed\n family {\n checkedInUsers\n totalUsers\n }\n }\n }\n}", 160 | variables: { cursored: { after: "", first: 20 } }, 161 | }); 162 | console.log(data.data); 163 | if (data.data) { 164 | this.invitationCode = data.data.userDetail.invitation.code; 165 | this.checkInDays = data.data.userDetail.checkInStatus.checkInDays; 166 | this.todayCount = data.data.userDetail.checkInStatus.todayCount; 167 | } 168 | } 169 | 170 | async getAccessToken() { 171 | if (!this.accessToken) { 172 | await this.login(); 173 | } 174 | return this.accessToken as string; 175 | } 176 | 177 | get via() { 178 | return this.chainId === 56 ? "bnb" : "opbnb"; 179 | } 180 | 181 | async getGasPrice() { 182 | return this.provider.getGasPrice().then((e) => new BigNumber(e.toString()).times(1.5).toFixed(0)); 183 | } 184 | 185 | /** 186 | * checkIn 187 | * @docs 每日签到 188 | * @returns 189 | */ 190 | async checkIn() { 191 | if (this.checkInDays >= 7) { 192 | console.log("check-in days >= 7"); 193 | return; 194 | } 195 | 196 | if (this.checkInDays != 0 && this.todayCount === this.checkInDays) { 197 | console.log("checkIn is success"); 198 | return; 199 | } 200 | 201 | const gasPrice = await this.getGasPrice(); 202 | const loginTx = await this.contract.checkIn("1", { 203 | gasPrice: gasPrice, 204 | }); 205 | await loginTx.wait(1); 206 | 207 | const hash = loginTx.hash; 208 | 209 | await this.request 210 | .request({ 211 | url: "/api/v2/my/check-in", 212 | method: "POST", 213 | data: { 214 | hash: hash, 215 | via: this.via, 216 | }, 217 | }) 218 | .then((res) => { 219 | if (res.data.statusCode == 200) { 220 | console.log("check-in success", hash); 221 | } 222 | }); 223 | } 224 | 225 | /** 226 | * claimCredit 227 | * @docs 领取积分,目前貌似只能在bnb领取 228 | * @returns 229 | */ 230 | async claimCredit() { 231 | const { data: res } = await this.request.post( 232 | "/api/v2/my/claim-all", 233 | {}, 234 | { 235 | headers: { 236 | Authorization: `Bearer ${await this.getAccessToken()}`, 237 | }, 238 | } 239 | ); 240 | 241 | console.log(res); 242 | if (res.data?.amount) { 243 | const gasPrice = await this.getGasPrice(); 244 | 245 | const tx = await this.contract.claimCredit(res.data.amount, res.data.signature.nonce, res.data.signature.signature, { 246 | gasPrice: gasPrice, 247 | }); 248 | 249 | await tx.await(); 250 | console.log(tx); 251 | 252 | await this.request.post(`/api/v2/my/claim/${res.data.signature.nonce}`, { 253 | hash: tx.hash, 254 | }); 255 | 256 | return tx; 257 | } 258 | } 259 | } 260 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/tsconfig", 3 | "display": "Default", 4 | "compilerOptions": { 5 | "rootDir": "./src", 6 | "allowJs": false, 7 | "outDir": "dist", 8 | "allowSyntheticDefaultImports": true, 9 | "alwaysStrict": true, 10 | "declaration": true, 11 | "declarationMap": true, 12 | "emitDecoratorMetadata": true, 13 | "esModuleInterop": true, 14 | "experimentalDecorators": true, 15 | "forceConsistentCasingInFileNames": true, 16 | "importHelpers": true, 17 | "lib": [ 18 | "ESNext" 19 | ], 20 | "module": "ESNext", 21 | "target": "ESNext", 22 | "moduleResolution": "node", 23 | "noFallthroughCasesInSwitch": true, 24 | "noImplicitAny": true, 25 | "noImplicitReturns": true, 26 | "noImplicitThis": true, 27 | "noLib": false, 28 | "noUnusedLocals": false, 29 | "noUnusedParameters": false, 30 | "preserveSymlinks": true, 31 | "resolveJsonModule": true, 32 | "skipLibCheck": true, 33 | "sourceMap": true, 34 | "strict": true, 35 | "strictNullChecks": true, 36 | "strictPropertyInitialization": true, 37 | "noUncheckedIndexedAccess": true, 38 | "emitDeclarationOnly": true, 39 | "typeRoots": [ 40 | "node_modules/@types" 41 | ], 42 | "types": [ 43 | "node" 44 | ] 45 | }, 46 | "include": [ 47 | "src", 48 | "src/**/*.ts" 49 | ], 50 | "exclude": [ 51 | "node_modules", 52 | "example", 53 | "test" 54 | ], 55 | "ts-node": { 56 | "compilerOptions": { 57 | "module": "commonjs" 58 | } 59 | } 60 | } 61 | --------------------------------------------------------------------------------