|
@@ -5,7 +5,7 @@ import { InitiaClient } from '../InitiaClient'
|
|
|
async function startCheck(concurrency) {
|
|
|
const accountsRaw = await DBClient.instance.account.findMany({
|
|
|
where: {
|
|
|
- status: 2,
|
|
|
+ status: -3,
|
|
|
},
|
|
|
orderBy: {
|
|
|
lastRun: 'desc',
|
|
@@ -19,7 +19,18 @@ async function startCheck(concurrency) {
|
|
|
// return
|
|
|
// }
|
|
|
const client = new InitiaClient(account.mnemonic, true)
|
|
|
- // const gasGot = await client.gasGot()
|
|
|
+ const gasGot = await client.lcd.bank.balanceByDenom(
|
|
|
+ account.address,
|
|
|
+ `move/944f8dd8dc49f96c25fea9849f16436dcfa6d564eec802f3ef7f8b3ea85368ff`,
|
|
|
+ )
|
|
|
+ if (Number(gasGot.amount) < 300000) {
|
|
|
+ await DBClient.instance.account.update({
|
|
|
+ where: { id: account.id },
|
|
|
+ data: { status: -4 },
|
|
|
+ //可能领过还没到账的
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
// if (!gasGot) {
|
|
|
// console.log(`gas got:`, gasGot)
|
|
|
// await DBClient.instance.account.update({
|
|
@@ -49,4 +60,4 @@ async function startCheck(concurrency) {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-startCheck(10)
|
|
|
+startCheck(20)
|