├── .eslintrc.json ├── .gitignore ├── README.md ├── next.config.js ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── next.svg ├── shareQrcode.png └── vercel.svg ├── src ├── app │ ├── favicon.ico │ ├── globals.css │ ├── layout.tsx │ └── page.tsx └── components │ └── Minter.tsx ├── tailwind.config.ts └── tsconfig.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | # or 12 | pnpm dev 13 | # or 14 | bun dev 15 | ``` 16 | 17 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 18 | 19 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. 20 | 21 | This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. 22 | 23 | ## Learn More 24 | 25 | To learn more about Next.js, take a look at the following resources: 26 | 27 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 28 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 29 | 30 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! 31 | 32 | ## Deploy on Vercel 33 | 34 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 35 | 36 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 37 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {} 3 | 4 | module.exports = nextConfig 5 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sei20-super-minter", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "@cosmjs/proto-signing": "^0.32.1", 13 | "@cosmjs/stargate": "^0.32.1", 14 | "@sei-js/core": "^3.1.2", 15 | "next": "14.0.4", 16 | "react": "^18", 17 | "react-dom": "^18", 18 | "react-hot-toast": "^2.4.1" 19 | }, 20 | "devDependencies": { 21 | "@types/node": "^20", 22 | "@types/react": "^18", 23 | "@types/react-dom": "^18", 24 | "autoprefixer": "^10.0.1", 25 | "eslint": "^8", 26 | "eslint-config-next": "14.0.4", 27 | "postcss": "^8", 28 | "tailwindcss": "^3.3.0", 29 | "typescript": "^5" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/shareQrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobotLivermore/sei20-super-minter/5b7c963cd014a86a47da79db3ab6f7ad3a3375f5/public/shareQrcode.png -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RobotLivermore/sei20-super-minter/5b7c963cd014a86a47da79db3ab6f7ad3a3375f5/src/app/favicon.ico -------------------------------------------------------------------------------- /src/app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | 6 | body { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import { Inter } from "next/font/google"; 3 | import "./globals.css"; 4 | import { Toaster } from "react-hot-toast"; 5 | 6 | const inter = Inter({ subsets: ["latin"] }); 7 | 8 | export const metadata: Metadata = { 9 | title: "Super Seis Minter", 10 | description: "Generated by create next app", 11 | }; 12 | 13 | export default function RootLayout({ 14 | children, 15 | }: { 16 | children: React.ReactNode; 17 | }) { 18 | return ( 19 | 20 | 21 | {children} 22 | 23 | 24 | 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /src/app/page.tsx: -------------------------------------------------------------------------------- 1 | import Minter from "@/components/Minter"; 2 | import Image from "next/image"; 3 | import Link from "next/link"; 4 | 5 | export default function Home() { 6 | return ( 7 |
8 |
9 |

欢迎加入科学家的队伍

10 |

进群免费领工具

11 | 12 |
13 | 18 | 30 | 31 |
32 | 37 | 50 | 开源安全可直接下载代码 51 | 52 |
53 | 54 |
55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /src/components/Minter.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React, { useCallback, useRef, useState } from "react"; 4 | import { 5 | restoreWallet, 6 | getSigningCosmWasmClient, 7 | getQueryClient, 8 | } from "@sei-js/core"; 9 | import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; 10 | 11 | import { calculateFee } from "@cosmjs/stargate"; 12 | 13 | // const RPC_URL = "https://sei-rpc.polkachu.com/"; 14 | const REST_URL = "https://sei-api.polkachu.com/"; 15 | 16 | const RPC_URL_2 = "https://sei-rpc.brocha.in/"; 17 | // const RPC_URL_3 = "https://rpc.sei-apis.com/"; 18 | // const RPC_URL_4 = "https://sei-m.rpc.n0ok.net/"; 19 | // const RPC_URL_5 = "https://sei-rpc.lavenderfive.com/"; 20 | 21 | const generateWalletFromMnemonic = async (mnemonic: string) => { 22 | const wallet = await restoreWallet(mnemonic, 0); 23 | return wallet; 24 | }; 25 | 26 | const querySeiBalance = async (address: string) => { 27 | const queryClient = await getQueryClient(REST_URL); 28 | const result = await queryClient.cosmos.bank.v1beta1.balance({ 29 | address: address, 30 | denom: "usei", 31 | }); 32 | return result.balance; 33 | }; 34 | 35 | const Minter: React.FC = () => { 36 | const [mnemonic, setMnemonic] = useState(""); 37 | const [isEnd, setIsEnd] = useState(false); 38 | const isEndRef = useRef(false); 39 | isEndRef.current = isEnd; 40 | const [logs, setLogs] = useState([]); 41 | 42 | const mintFn = useCallback( 43 | async (client: SigningCosmWasmClient, address: string) => { 44 | try { 45 | const msg = { 46 | p: "sei-20", 47 | op: "mint", 48 | tick: "seis", 49 | amt: "1000", 50 | }; 51 | const msg_base64 = btoa(`data:,${JSON.stringify(msg)}`); 52 | const fee = calculateFee(100000, "0.13usei"); 53 | const response = await client.sendTokens( 54 | address, 55 | address, 56 | [{ amount: "1", denom: "usei" }], 57 | fee, 58 | msg_base64 59 | ); 60 | setLogs((pre) => [ 61 | ...pre, 62 | `铸造完成, txhash: ${response.transactionHash}`, 63 | ]); 64 | } catch (e) { 65 | // sleep 1s 66 | await new Promise((resolve) => setTimeout(resolve, 1000)); 67 | } 68 | }, 69 | [] 70 | ); 71 | 72 | const walletMint = useCallback(async (m: string) => { 73 | const wallet = await generateWalletFromMnemonic(m); 74 | 75 | const accounts = await wallet.getAccounts(); 76 | setLogs((pre) => [...pre, `成功导入钱包: ${accounts[0].address}`]); 77 | 78 | const balance = await querySeiBalance(accounts[0].address); 79 | console.log(balance); 80 | if (Number(balance.amount) === 0) { 81 | setLogs((pre) => [...pre, `账户余额不足`]); 82 | return; 83 | } 84 | 85 | const signingCosmWasmClient = await getSigningCosmWasmClient( 86 | RPC_URL_2, 87 | wallet 88 | ); 89 | 90 | while (true) { 91 | if (isEndRef.current) { 92 | setLogs((pre) => [...pre, `暂停铸造`]); 93 | break; 94 | } 95 | await mintFn(signingCosmWasmClient, accounts[0].address); 96 | // await new Promise((resolve) => setTimeout(resolve, 300)); 97 | } 98 | }, [mintFn]) 99 | 100 | const handleMint = async () => { 101 | setIsEnd(false); 102 | setLogs((pre) => [...pre, `开始铸造`]); 103 | 104 | // 验证助记词 105 | if (!mnemonic) { 106 | setLogs((pre) => [...pre, `请输入助记词`]); 107 | return; 108 | } 109 | const walletMnemonics = mnemonic.split(","); 110 | 111 | for (let i = 0; i < walletMnemonics.length; i++) { 112 | walletMint(walletMnemonics[i]); 113 | } 114 | 115 | }; 116 | 117 | const handleEnd = () => { 118 | setIsEnd(true); 119 | isEndRef.current = true; 120 | }; 121 | 122 | return ( 123 |
124 |

Seis疯狂铸造脚本

125 |

打到账户没钱为止

126 |
127 |