diff --git a/src/utils.js b/src/utils.js index b057f2df44eee7464baea1f3a21f9310a5163364..095ca44e273d699e77fb4c3e3474282bbbaaa30b 100644 --- a/src/utils.js +++ b/src/utils.js @@ -1,10 +1,10 @@ import types from "./auth/serializer/src/types" import Serializer from "./auth/serializer/src/serializer" +import { Hive } from './api' import config from './config' -import { Promise } from 'bluebird'; const ByteBuffer = require('bytebuffer') -const hiveApi = require('./api') + const { uint16, uint32, @@ -127,8 +127,10 @@ export function buildWitnessUpdateOp( return ["witness_set_properties", data]; } +// doesn't work - hiveApi is empty - couldn't import api here - feel free to try export function autoDetectApiVersion() { return new Promise((resolve, reject) => { + const hiveApi = new Hive(config) hiveApi.getVersionAsync().then(res => { if (res.blockchain_version !== "0.23.0") { config.set("rebranded_api", true)