Skip to content
Snippets Groups Projects
Commit 402334ed authored by Mahdi Yari's avatar Mahdi Yari
Browse files

add helper autoDetectApiVersion()

parent 50f3c9eb
No related branches found
No related tags found
1 merge request!7Rebrand hf24
import types from "./auth/serializer/src/types"
import Serializer from "./auth/serializer/src/serializer"
import hiveApi from './api';
import config from './config';
const ByteBuffer = require('bytebuffer')
const {
......@@ -123,3 +126,15 @@ export function buildWitnessUpdateOp(
data.props.sort((a, b) => a[0].localeCompare(b[0]));
return ["witness_set_properties", data];
}
export function autoDetectApiVersion() {
hiveApi.getVersionAsync().then(res => {
if (res.blockchain_version !== "0.23.0") {
config.set("rebranded_api", true)
return { rebranded_api: true }
} else {
config.set("rebranded_api", false)
return { rebranded_api: false }
}
})
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment