hel 1 年之前
父節點
當前提交
12bb0b4531
共有 4 個文件被更改,包括 132 次插入18 次删除
  1. 127 13
      src/BaseClient.ts
  2. 2 2
      src/InitiaClient.ts
  3. 2 2
      src/onchain/week3/randomWeek3.ts
  4. 1 1
      src/swapTester.ts

+ 127 - 13
src/BaseClient.ts

@@ -43,16 +43,16 @@ export abstract class BaseClient {
     const rpc = rpcUrl[Math.floor(Math.random() * rpcUrl.length)]
     this.rpcUrlUsing = rpc
     const pass = `test1234_session-${generateRandomString(8)}_lifetime-20m`
-    // const proxyAgent = useProxy
-    //   ? new HttpsProxyAgent(`http://tuxla:${pass}@geo.iproyal.com:12321`)
-    //   : undefined
+    const proxyAgent = useProxy
+      ? new HttpsProxyAgent(`http://tuxla:${pass}@geo.iproyal.com:12321`)
+      : undefined
     const username = `u3e4c2852572e05c5-zone-custom-session-${generateRandomString(
       9,
     )}-sessTime-20`
     const password = 'u3e4c2852572e05c5'
-    const proxyAgent = new HttpsProxyAgent(
-      `http://${username}:${password}@43.152.113.55:2334`,
-    )
+    // const proxyAgent = new HttpsProxyAgent(
+    //   `http://${username}:${password}@43.152.113.55:2334`,
+    // )
 
     const requester = new APIRequester(rpc, {
       httpsAgent: proxyAgent,
@@ -77,45 +77,159 @@ export abstract class BaseClient {
       },
       useProxy ? requester : null,
     )
+    const noonRequester = new APIRequester(
+      'https://burrito-1-lcd.lunchlunch.xyz/',
+      {
+        httpsAgent: proxyAgent,
+        headers: {
+          'User-Agent':
+            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
+          'Sec-Ch-Ua':
+            '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
+          'Sec-Ch-Ua-Mobile': '?0',
+          'Sec-Ch-Ua-Platform': '"Windows"',
+          // Origin: 'https://faucet.testnet.initia.xyz/',
+          // Referer: 'https://faucet.testnet.initia.xyz/',
+          'Sec-Fetch-Dest': 'empty',
+          'Sec-Fetch-Mode': 'cors',
+          'Sec-Fetch-Site': 'same-site',
+        },
+      },
+    )
 
     this.noon = new LCDClient(
       'https://burrito-1-lcd.lunchlunch.xyz/',
       { chainId: 'burrito-1' },
-      useProxy ? requester : null,
+      useProxy ? noonRequester : null,
+    )
+    const miniMoveRequester = new APIRequester(
+      'https://lcd.minimove-1.initia.xyz',
+      {
+        httpsAgent: proxyAgent,
+        headers: {
+          'User-Agent':
+            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
+          'Sec-Ch-Ua':
+            '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
+          'Sec-Ch-Ua-Mobile': '?0',
+          'Sec-Ch-Ua-Platform': '"Windows"',
+          // Origin: 'https://faucet.testnet.initia.xyz/',
+          // Referer: 'https://faucet.testnet.initia.xyz/',
+          'Sec-Fetch-Dest': 'empty',
+          'Sec-Fetch-Mode': 'cors',
+          'Sec-Fetch-Site': 'same-site',
+        },
+      },
     )
+
     this.miniMove = new LCDClient(
       'https://lcd.minimove-1.initia.xyz',
       { chainId: 'minimove-1' },
-      useProxy ? requester : null,
+      useProxy ? miniMoveRequester : null,
+    )
+    const tucanaMoveRequester = new APIRequester(
+      'https://maze-rest-c9796789-107d-49ab-b6de-059724d2a91d.ue1-prod.newmetric.xyz/',
+      {
+        httpsAgent: proxyAgent,
+        headers: {
+          'User-Agent':
+            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
+          'Sec-Ch-Ua':
+            '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
+          'Sec-Ch-Ua-Mobile': '?0',
+          'Sec-Ch-Ua-Platform': '"Windows"',
+          // Origin: 'https://faucet.testnet.initia.xyz/',
+          // Referer: 'https://faucet.testnet.initia.xyz/',
+          'Sec-Fetch-Dest': 'empty',
+          'Sec-Fetch-Mode': 'cors',
+          'Sec-Fetch-Site': 'same-site',
+        },
+      },
     )
-
     this.tucana = new LCDClient(
       'https://maze-rest-c9796789-107d-49ab-b6de-059724d2a91d.ue1-prod.newmetric.xyz/',
       {
         chainId: 'birdee-1',
       },
-      useProxy ? requester : null,
+      useProxy ? tucanaMoveRequester : null,
+    )
+    const civiMoveRequester = new APIRequester(
+      'https://maze-rest-sequencer-beab9b6f-d96d-435e-9caf-5679296d8172.ue1-prod.newmetric.xyz',
+      {
+        httpsAgent: proxyAgent,
+        headers: {
+          'User-Agent':
+            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
+          'Sec-Ch-Ua':
+            '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
+          'Sec-Ch-Ua-Mobile': '?0',
+          'Sec-Ch-Ua-Platform': '"Windows"',
+          // Origin: 'https://faucet.testnet.initia.xyz/',
+          // Referer: 'https://faucet.testnet.initia.xyz/',
+          'Sec-Fetch-Dest': 'empty',
+          'Sec-Fetch-Mode': 'cors',
+          'Sec-Fetch-Site': 'same-site',
+        },
+      },
     )
     this.civi = new LCDClient(
       'https://maze-rest-sequencer-beab9b6f-d96d-435e-9caf-5679296d8172.ue1-prod.newmetric.xyz',
       {
         chainId: 'landlord-1',
       },
-      useProxy ? requester : null,
+      useProxy ? civiMoveRequester : null,
+    )
+    const blackWingsMoveRequester = new APIRequester(
+      'https://maze-rest-18bdff44-3aa4-425e-9bc0-06a2afa40af8.ue1-prod.newmetric.xyz',
+      {
+        httpsAgent: proxyAgent,
+        headers: {
+          'User-Agent':
+            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
+          'Sec-Ch-Ua':
+            '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
+          'Sec-Ch-Ua-Mobile': '?0',
+          'Sec-Ch-Ua-Platform': '"Windows"',
+          // Origin: 'https://faucet.testnet.initia.xyz/',
+          // Referer: 'https://faucet.testnet.initia.xyz/',
+          'Sec-Fetch-Dest': 'empty',
+          'Sec-Fetch-Mode': 'cors',
+          'Sec-Fetch-Site': 'same-site',
+        },
+      },
     )
     this.blackWings = new LCDClient(
       'https://maze-rest-18bdff44-3aa4-425e-9bc0-06a2afa40af8.ue1-prod.newmetric.xyz',
       {
         chainId: 'tomcat-1',
       },
-      useProxy ? requester : null,
+      useProxy ? blackWingsMoveRequester : null,
+    )
+    const initAiRequester = new APIRequester(
+      'https://maze-rest-617bacff-7d34-4eb8-87f4-ee16fb4e0ac7.ue1-prod.newmetric.xyz',
+      {
+        httpsAgent: proxyAgent,
+        headers: {
+          'User-Agent':
+            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3',
+          'Sec-Ch-Ua':
+            '"Google Chrome";v="123", "Not:A-Brand";v="8", "Chromium";v="123"',
+          'Sec-Ch-Ua-Mobile': '?0',
+          'Sec-Ch-Ua-Platform': '"Windows"',
+          // Origin: 'https://faucet.testnet.initia.xyz/',
+          // Referer: 'https://faucet.testnet.initia.xyz/',
+          'Sec-Fetch-Dest': 'empty',
+          'Sec-Fetch-Mode': 'cors',
+          'Sec-Fetch-Site': 'same-site',
+        },
+      },
     )
     this.initAi = new LCDClient(
       'https://maze-rest-617bacff-7d34-4eb8-87f4-ee16fb4e0ac7.ue1-prod.newmetric.xyz',
       {
         chainId: 'init-ai-1',
       },
-      useProxy ? requester : null,
+      useProxy ? initAiRequester : null,
     )
 
     this.wallet = new Wallet(this.lcd, this.key)

+ 2 - 2
src/InitiaClient.ts

@@ -229,8 +229,8 @@ export class InitiaClient extends InitiaTask {
     if (Number(l2InitBalance.amount) < 1500000) {
       await this.newBridge2Ai()
       return `l2Init`
-    } else if (Number(l2InitBalance.amount) > 1500000) {
-      const amount = Number(l2InitBalance.amount) - 1500000
+    } else if (Number(l2InitBalance.amount) > 1600000) {
+      const amount = Number(l2InitBalance.amount) - 1600000
       const msg = new MsgTransfer(
         'transfer',
         'channel-0',

+ 2 - 2
src/onchain/week3/randomWeek3.ts

@@ -7,7 +7,7 @@ async function startCheck(concurrency) {
     where: {
       finish: 0,
     },
-    take: 1,
+    take: 10000,
     orderBy: {
       id: 'asc',
     },
@@ -168,4 +168,4 @@ async function startCheck(concurrency) {
   })
 }
 
-startCheck(1)
+startCheck(50)

+ 1 - 1
src/swapTester.ts

@@ -40,7 +40,7 @@ const lcd = new LCDClient('https://api-initia-testnet.whispernode.com/', {
 // )
 
 async function main() {
-  const client = new InitiaClient(key.mnemonic, false)
+  const client = new InitiaClient(key.mnemonic, true)
   // await client.nameRegister()
   // await client.drawFood()
   // const a = await client.newBridge2Miniwasm()