|
@@ -1,5 +1,5 @@
|
|
|
import { BaseClient } from './BaseClient'
|
|
|
-import { bcs, MsgExecute } from '@initia/initia.js'
|
|
|
+import { bcs, Coin, Coins, Fee, MsgExecute } from '@initia/initia.js'
|
|
|
import { getAxiosClient } from './utils'
|
|
|
|
|
|
export abstract class JennieModule extends BaseClient {
|
|
@@ -20,6 +20,7 @@ export abstract class JennieModule extends BaseClient {
|
|
|
async drawFood() {
|
|
|
const xp = await this.getXpAmount()
|
|
|
if (Number(xp) < 200) {
|
|
|
+ await this.claimableXp()
|
|
|
return `done`
|
|
|
}
|
|
|
const msg = new MsgExecute(
|
|
@@ -258,7 +259,23 @@ export abstract class JennieModule extends BaseClient {
|
|
|
.toBase64(),
|
|
|
],
|
|
|
)
|
|
|
- return await this.broadcast(msg)
|
|
|
+ const randLimit = 370000 + Math.floor(Math.random() * 10000)
|
|
|
+ const signed = await this.wallet.createAndSignTx({
|
|
|
+ msgs: Array.isArray(msg) ? msg : [msg],
|
|
|
+ fee: new Fee(
|
|
|
+ randLimit,
|
|
|
+ new Coins([
|
|
|
+ new Coin(
|
|
|
+ 'move/944f8dd8dc49f96c25fea9849f16436dcfa6d564eec802f3ef7f8b3ea85368ff',
|
|
|
+ randLimit / 2,
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
+ ),
|
|
|
+ })
|
|
|
+ const broadcast = await this.lcd.tx.broadcastAsync(signed)
|
|
|
+ // console.log(broadcast.raw_log)
|
|
|
+ // console.log(this.key.accAddress)
|
|
|
+ return broadcast.txhash
|
|
|
} else {
|
|
|
return `done`
|
|
|
}
|