|
@@ -76,6 +76,22 @@ export abstract class JennieModule extends BaseClient {
|
|
|
// Broadcast the minting message
|
|
|
await this.broadcast(msg)
|
|
|
}
|
|
|
+ async mintPartApprovedAll() {
|
|
|
+ const mintProgress: MintProgress = await this.lcd.move.viewFunction(
|
|
|
+ '0x9065fda28f52bb14ade545411f02e8e07a9cb4ba',
|
|
|
+ 'jennie',
|
|
|
+ 'get_jennie_mint_progress',
|
|
|
+ [],
|
|
|
+ [bcs.address().serialize(this.key.accAddress).toBase64()],
|
|
|
+ )
|
|
|
+ const unApprovedTask = []
|
|
|
+ for (const item of mintProgress.jennie_part_progresses) {
|
|
|
+ // 如果部件已批准但未铸造,创建消息
|
|
|
+
|
|
|
+ unApprovedTask.push(item.task)
|
|
|
+ }
|
|
|
+ return unApprovedTask
|
|
|
+ }
|
|
|
async mintPart() {
|
|
|
// 获取 'jennie' 的铸造进度
|
|
|
const mintProgress: MintProgress = await this.lcd.move.viewFunction(
|
|
@@ -89,26 +105,26 @@ export abstract class JennieModule extends BaseClient {
|
|
|
// 初始化消息数组
|
|
|
const msgs: MsgExecute[] = []
|
|
|
|
|
|
- console.log(mintProgress.jennie_part_progresses)
|
|
|
+ // console.log(mintProgress.jennie_part_progresses)
|
|
|
|
|
|
// 遍历每个部件的进度
|
|
|
- // for (const item of mintProgress.jennie_part_progresses) {
|
|
|
- // // 如果部件已批准但未铸造,创建消息
|
|
|
- // if (item.is_approved && !item.is_minted) {
|
|
|
- // const msg = new MsgExecute(
|
|
|
- // this.key.accAddress,
|
|
|
- // '0x9065fda28f52bb14ade545411f02e8e07a9cb4ba',
|
|
|
- // 'jennie',
|
|
|
- // 'mint_part',
|
|
|
- // [],
|
|
|
- // [bcs.u8().serialize(item.task).toBase64()],
|
|
|
- // )
|
|
|
- // msgs.push(msg)
|
|
|
- // }
|
|
|
- // }
|
|
|
+ for (const item of mintProgress.jennie_part_progresses) {
|
|
|
+ // 如果部件已批准但未铸造,创建消息
|
|
|
+ if (item.is_approved && !item.is_minted) {
|
|
|
+ const msg = new MsgExecute(
|
|
|
+ this.key.accAddress,
|
|
|
+ '0x9065fda28f52bb14ade545411f02e8e07a9cb4ba',
|
|
|
+ 'jennie',
|
|
|
+ 'mint_part',
|
|
|
+ [],
|
|
|
+ [bcs.u8().serialize(item.task).toBase64()],
|
|
|
+ )
|
|
|
+ msgs.push(msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 广播所有消息
|
|
|
- // await this.broadcast(msgs)
|
|
|
+ await this.broadcast(msgs)
|
|
|
}
|
|
|
async claimable() {
|
|
|
//https://xp-api.initiation-1.initia.xyz/xp/claimable/init1w6ftxlsv7y5putq955ymxh2kd0wru7nqshetka
|