Skip to content

Commit

Permalink
added stop mining
Browse files Browse the repository at this point in the history
  • Loading branch information
CoNETProject committed Apr 21, 2024
1 parent d94a7a6 commit b7cb1f2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/API/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type WorkerCommandType = 'READY'|'testPasscode'|'getCONETBalance'|'getRegiestNod
'isAddress'|'getFaucet'|'syncAsset'|'sendAsset'|'getUSDCPrice'|'registerReferrer'|'showSRP'|'getAllProfiles'|
'buyUSDC'|'mintCoNETCash'|'getSINodes'|'getRecipientCoNETCashAddress'|'setRegion'|'ipaddress'|'startLiveness'|'stopLiveness'|
'isLivenessRunning'|'getRefereesList'|'getAllNodes'|'getContainer'|'importWallet'|'updateProfile'|'resetPasscode'|'recoverAccount'|'addProfile'|
'getAssetsPrice'|'CONETFaucet'|'prePurchase'|'guardianPurchase'|'fx168PrePurchase'|'startMining'
'getAssetsPrice'|'CONETFaucet'|'prePurchase'|'guardianPurchase'|'fx168PrePurchase'|'startMining'|'stoptMining'

export type WorkerCallStatus = 'SUCCESS' | 'NOT_READY' | 'UNKNOWN_COMMAND' |
'TIME_OUT' | 'SYSTEM_ERROR'
Expand Down
15 changes: 15 additions & 0 deletions src/API/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,4 +429,19 @@ export class platform {
return resolve (data[0])
})
})

public stopMining: () => Promise<type_platformStatus> = () => new Promise(async resolve=> {
const cmd: WorkerCommand = {
cmd: 'stoptMining',
uuid: v4(),
data: []
}
return postMessage (cmd, false, null, (err: any, data: any) => {
if (err) {
return resolve (err)
}

return resolve (data[0])
})
})
}

0 comments on commit b7cb1f2

Please sign in to comment.