hel 1 年間 前
コミット
75c0869ce9
3 ファイル変更22 行追加38 行削除
  1. 1 1
      src/BaseClient.ts
  2. 19 35
      src/InitiaClient.ts
  3. 2 2
      src/onchain/week3/randomWeek3.ts

+ 1 - 1
src/BaseClient.ts

@@ -633,7 +633,7 @@ export abstract class BaseClient {
       this.key.accAddress,
       17,
       this.key.accAddress,
-      new Coin('uinit', 1000000),
+      new Coin('uinit', 1500000),
     )
     return await this.broadcast(msg)
   }

+ 19 - 35
src/InitiaClient.ts

@@ -52,7 +52,6 @@ export class InitiaClient extends InitiaTask {
 
   async week2Task2(toAddr: string) {
     const uinitAmount = await this.getTargetAmount(toAddr)
-    console.log(uinitAmount)
     if (Number(uinitAmount) > 0) {
       return `done`
     } else {
@@ -80,7 +79,6 @@ export class InitiaClient extends InitiaTask {
           this.key.accAddress,
           'l2/aee375e9d0b181f0d9d3a49f9a3d1d6b05d62b0ac81f8c92b9282afa4213d884',
         )
-        console.log(l2InitBalance.amount)
 
         if (info.count < 3 && Number(l2InitBalance.amount) === 0) {
           throw new Error('retry')
@@ -90,11 +88,11 @@ export class InitiaClient extends InitiaTask {
 
     const blackWingsWallet = new Wallet(this.blackWings, this.wallet.key)
 
-    if (Number(l2InitBalance.amount) < 1000000) {
+    if (Number(l2InitBalance.amount) < 300000) {
       await this.newBridge2BlackWings()
       return `l2Init`
-    } else if (Number(l2InitBalance.amount) > 1500000) {
-      const amount = Number(l2InitBalance.amount) - 1500000
+    } else if (Number(l2InitBalance.amount) > 3000000) {
+      const amount = Number(l2InitBalance.amount) - 3000000
       const msg = new MsgTransfer(
         'transfer',
         'channel-0',
@@ -199,10 +197,8 @@ export class InitiaClient extends InitiaTask {
     })
     try {
       const broadcast = await this.blackWings.tx.broadcastAsync(signed)
-      console.log(broadcast)
       return `done`
     } catch (e) {
-      console.log(e)
       return `error`
     }
 
@@ -216,7 +212,6 @@ export class InitiaClient extends InitiaTask {
           this.key.accAddress,
           'l2/aadf1a9da6a38b7e7e11839364ee42002260eff1657f403b9ce608337bcb986b',
         )
-        console.log(l2InitBalance.amount)
         if (info.count < 3 && Number(l2InitBalance.amount) === 0) {
           throw new Error('retry')
         } else {
@@ -226,11 +221,11 @@ export class InitiaClient extends InitiaTask {
 
     const aiWallet = new Wallet(this.initAi, this.wallet.key)
 
-    if (Number(l2InitBalance.amount) < 1500000) {
+    if (Number(l2InitBalance.amount) < 1200000) {
       await this.newBridge2Ai()
       return `l2Init`
-    } else if (Number(l2InitBalance.amount) > 1600000) {
-      const amount = Number(l2InitBalance.amount) - 1600000
+    } else if (Number(l2InitBalance.amount) > 3000000) {
+      const amount = Number(l2InitBalance.amount) - 3000000
       const msg = new MsgTransfer(
         'transfer',
         'channel-0',
@@ -275,7 +270,7 @@ export class InitiaClient extends InitiaTask {
         ),
       })
       try {
-        console.log(await this.initAi.tx.broadcast(signed))
+        await this.initAi.tx.broadcast(signed)
         return `transferBack`
       } catch (e) {
         return `error`
@@ -330,7 +325,6 @@ export class InitiaClient extends InitiaTask {
       const broadcast = await this.initAi.tx.broadcastAsync(signed)
       return `done`
     } catch (e) {
-      console.log(e)
       return `error`
     }
 
@@ -344,7 +338,6 @@ export class InitiaClient extends InitiaTask {
           this.key.accAddress,
           'l2/afaa3f4e1717c75712f8e8073e41f051a4e516cd25daa82d948c4729388edefd',
         )
-        console.log(l2InitBalance.amount)
 
         if (info.count < 3 && Number(l2InitBalance.amount) === 0) {
           throw new Error('retry')
@@ -354,11 +347,11 @@ export class InitiaClient extends InitiaTask {
 
     const civiWallet = new Wallet(this.civi, this.wallet.key)
 
-    if (Number(l2InitBalance.amount) < 1500000) {
+    if (Number(l2InitBalance.amount) < 1100000) {
       await this.newBridge2Civi()
       return `l2Init`
-    } else if (Number(l2InitBalance.amount) > 2000000) {
-      const amount = Number(l2InitBalance.amount) - 2000000
+    } else if (Number(l2InitBalance.amount) > 3000000) {
+      const amount = Number(l2InitBalance.amount) - 3000000
       const msg = new MsgTransfer(
         'transfer',
         'channel-0',
@@ -453,10 +446,8 @@ export class InitiaClient extends InitiaTask {
     })
     try {
       const broadcast = await this.civi.tx.broadcastAsync(signed)
-      console.log(broadcast)
       return `done`
     } catch (e) {
-      console.log(e)
       return `error`
     }
 
@@ -483,7 +474,6 @@ export class InitiaClient extends InitiaTask {
           this.key.accAddress,
           'l2/ffea49d63cbadcfd749b4f635eca198b2f3b44cb1f6b580f5d201d58f3bf7aea',
         )
-        console.log(l2InitBalance.amount)
 
         if (info.count < 3 && Number(l2InitBalance.amount) === 0) {
           throw new Error('retry')
@@ -492,11 +482,11 @@ export class InitiaClient extends InitiaTask {
       })
     const noonWallet = new Wallet(this.noon, this.wallet.key)
 
-    if (Number(l2InitBalance.amount) < 1000000) {
+    if (Number(l2InitBalance.amount) < 1200000) {
       await this.newBridge2Noon()
       return `l2Init`
-    } else if (Number(l2InitBalance.amount) > 1500000) {
-      const amount = Number(l2InitBalance.amount) - 1500000
+    } else if (Number(l2InitBalance.amount) > 3000000) {
+      const amount = Number(l2InitBalance.amount) - 3000000
       const msg = new MsgTransfer(
         'transfer',
         'channel-0',
@@ -624,7 +614,6 @@ export class InitiaClient extends InitiaTask {
       const broadcast = await this.noon.tx.broadcastAsync(signed)
       return `done`
     } catch (e) {
-      console.log(e)
       return `error`
     }
 
@@ -655,7 +644,6 @@ export class InitiaClient extends InitiaTask {
           this.key.accAddress,
           'l2/771d639f30fbe45e3fbca954ffbe2fcc26f915f5513c67a4a2d0bc1d635bdefd',
         )
-        console.log(l2InitBalance.amount)
 
         if (info.count < 3 && Number(l2InitBalance.amount) === 0) {
           throw new Error('retry')
@@ -663,11 +651,11 @@ export class InitiaClient extends InitiaTask {
         return l2InitBalance
       })
 
-    if (Number(l2InitBalance.amount) < 1000000) {
+    if (Number(l2InitBalance.amount) < 400000) {
       await this.newBridge2Minimove()
       return `l2Init`
-    } else if (Number(l2InitBalance.amount) > 1500000) {
-      const amount = Number(l2InitBalance.amount) - 1500000
+    } else if (Number(l2InitBalance.amount) > 2000000) {
+      const amount = Number(l2InitBalance.amount) - 2000000
       const msg = new MsgTransfer(
         'transfer',
         'channel-0',
@@ -787,7 +775,6 @@ export class InitiaClient extends InitiaTask {
       const broadcast = await this.miniMove.tx.broadcastAsync(signed)
       return `done`
     } catch (e) {
-      console.log(e)
       return `error`
     }
 
@@ -814,7 +801,6 @@ export class InitiaClient extends InitiaTask {
           this.key.accAddress,
           'l2/333f8e6ae6855338f99d451126bfefc1b920763c16681d55fbc7df68ccb36972',
         )
-        console.log(l2InitBalance.amount)
 
         if (info.count < 3 && Number(l2InitBalance.amount) === 0) {
           throw new Error('retry')
@@ -823,11 +809,11 @@ export class InitiaClient extends InitiaTask {
       })
     const tucanaWallet = new Wallet(this.tucana, this.wallet.key)
 
-    if (Number(l2InitBalance.amount) < 1000000) {
+    if (Number(l2InitBalance.amount) < 300000) {
       await this.newBridge2Tucana()
       return `l2Init`
-    } else if (Number(l2InitBalance.amount) > 1500000) {
-      const amount = Number(l2InitBalance.amount) - 1500000
+    } else if (Number(l2InitBalance.amount) > 2000000) {
+      const amount = Number(l2InitBalance.amount) - 2000000
       const msg = new MsgTransfer(
         'transfer',
         'channel-0',
@@ -936,10 +922,8 @@ export class InitiaClient extends InitiaTask {
     })
     try {
       const broadcast = await this.tucana.tx.broadcastAsync(signed)
-      console.log(broadcast)
       return `done`
     } catch (e) {
-      console.log(e)
       return `error`
     }
 

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

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