@@ -1151,21 +1151,13 @@ public void shutdown(Promise promise) {
11511151 //////////////////////ANYTHING BELOW IS FOR BLOCKCHAIN/////
11521152 ///////////////////////////////////////////////////////////
11531153 @ ReactMethod
1154- public void createAccount ( String seedString , Promise promise ) {
1154+ public void GetAccount ( Promise promise ) {
11551155 ThreadUtils .runOnExecutor (() -> {
1156- Log .d ("ReactNative" , "createAccount: seedString = " + seedString );
1156+ Log .d ("ReactNative" , "getAccount called " );
11571157 try {
1158- if (this .fula == null || this .fula .id () == null || this .fula .id ().isEmpty ()) {
1159- promise .reject (new Error ("Fula client is not initialized" ));
1160- } else {
1161-
1162- if (!seedString .startsWith ("/" )) {
1163- promise .reject (new Error ("seed should start with /" ));
1164- }
1165- byte [] result = this .fula .seeded (seedString );
1166- String resultString = toString (result );
1167- promise .resolve (resultString );
1168- }
1158+ byte [] result = this .fula .getAccount ();
1159+ String resultString = toString (result );
1160+ promise .resolve (resultString );
11691161 } catch (Exception e ) {
11701162 Log .d ("get" , e .getMessage ());
11711163 promise .reject (e );
@@ -1174,11 +1166,11 @@ public void createAccount(String seedString, Promise promise) {
11741166 }
11751167
11761168 @ ReactMethod
1177- public void checkAccountExists (String accountString , Promise promise ) {
1169+ public void AssetsBalance (String account , String assetId , String classId , Promise promise ) {
11781170 ThreadUtils .runOnExecutor (() -> {
1179- Log .d ("ReactNative" , "checkAccountExists: accountString = " + accountString );
1171+ Log .d ("ReactNative" , "getAccount called " );
11801172 try {
1181- byte [] result = this .fula .accountExists ( accountString );
1173+ byte [] result = this .fula .assetsBalance ( account , assetId , classId );
11821174 String resultString = toString (result );
11831175 promise .resolve (resultString );
11841176 } catch (Exception e ) {
@@ -1189,11 +1181,11 @@ public void checkAccountExists(String accountString, Promise promise) {
11891181 }
11901182
11911183 @ ReactMethod
1192- public void createPool (String seedString , String poolName , Promise promise ) {
1184+ public void checkAccountExists (String accountString , Promise promise ) {
11931185 ThreadUtils .runOnExecutor (() -> {
1194- Log .d ("ReactNative" , "createPool: seedString = " + seedString + "; poolName = " + poolName );
1186+ Log .d ("ReactNative" , "checkAccountExists: accountString = " + accountString );
11951187 try {
1196- byte [] result = this .fula .poolCreate ( seedString , poolName );
1188+ byte [] result = this .fula .accountExists ( accountString );
11971189 String resultString = toString (result );
11981190 promise .resolve (resultString );
11991191 } catch (Exception e ) {
@@ -1264,21 +1256,6 @@ public void listPoolJoinRequests(long poolID, Promise promise) {
12641256 });
12651257 }
12661258
1267- @ ReactMethod
1268- public void votePoolJoinRequest (String seedString , long poolID , String accountString , boolean accept , Promise promise ) {
1269- ThreadUtils .runOnExecutor (() -> {
1270- Log .d ("ReactNative" , "votePoolJoinRequest: seedString = " + seedString + "; poolID = " + poolID + "; accountString = " + accountString + "; accept = " + accept );
1271- try {
1272- byte [] result = this .fula .poolVote (seedString , poolID , accountString , accept );
1273- String resultString = toString (result );
1274- promise .resolve (resultString );
1275- } catch (Exception e ) {
1276- Log .d ("get" , e .getMessage ());
1277- promise .reject (e );
1278- }
1279- });
1280- }
1281-
12821259 @ ReactMethod
12831260 public void leavePool (long poolID , Promise promise ) {
12841261 ThreadUtils .runOnExecutor (() -> {
@@ -1294,36 +1271,6 @@ public void leavePool(long poolID, Promise promise) {
12941271 });
12951272 }
12961273
1297- @ ReactMethod
1298- public void newReplicationRequest (String seedString , long poolID , long replicationFactor , String cid , Promise promise ) {
1299- ThreadUtils .runOnExecutor (() -> {
1300- Log .d ("ReactNative" , "newReplicationRequest: seedString = " + seedString + "; poolID = " + poolID + "; replicationFactor = " + replicationFactor + "; cid = " + cid );
1301- try {
1302- byte [] result = this .fula .manifestUpload (seedString , poolID , replicationFactor , cid );
1303- String resultString = toString (result );
1304- promise .resolve (resultString );
1305- } catch (Exception e ) {
1306- Log .d ("get" , e .getMessage ());
1307- promise .reject (e );
1308- }
1309- });
1310- }
1311-
1312- @ ReactMethod
1313- public void newStoreRequest (String seedString , long poolID , String uploader , String cid , Promise promise ) {
1314- ThreadUtils .runOnExecutor (() -> {
1315- Log .d ("ReactNative" , "newStoreRequest: seedString = " + seedString + "; poolID = " + poolID + "; uploader = " + uploader + "; cid = " + cid );
1316- try {
1317- byte [] result = this .fula .manifestStore (seedString , poolID , uploader , cid );
1318- String resultString = toString (result );
1319- promise .resolve (resultString );
1320- } catch (Exception e ) {
1321- Log .d ("get" , e .getMessage ());
1322- promise .reject (e );
1323- }
1324- });
1325- }
1326-
13271274 @ ReactMethod
13281275 public void listAvailableReplicationRequests (long poolID , Promise promise ) {
13291276 ThreadUtils .runOnExecutor (() -> {
@@ -1339,51 +1286,6 @@ public void listAvailableReplicationRequests(long poolID, Promise promise) {
13391286 });
13401287 }
13411288
1342- @ ReactMethod
1343- public void removeReplicationRequest (String seedString , long poolID , String cid , Promise promise ) {
1344- ThreadUtils .runOnExecutor (() -> {
1345- Log .d ("ReactNative" , "newReplicationRequest: seedString = " + seedString + "; poolID = " + poolID + "; cid = " + cid );
1346- try {
1347- byte [] result = this .fula .manifestRemove (seedString , poolID , cid );
1348- String resultString = toString (result );
1349- promise .resolve (resultString );
1350- } catch (Exception e ) {
1351- Log .d ("get" , e .getMessage ());
1352- promise .reject (e );
1353- }
1354- });
1355- }
1356-
1357- @ ReactMethod
1358- public void removeStorer (String seedString , String storage , long poolID , String cid , Promise promise ) {
1359- ThreadUtils .runOnExecutor (() -> {
1360- Log .d ("ReactNative" , "removeStorer: seedString = " + seedString + "; storage = " + storage + "; poolID = " + poolID + "; cid = " + cid );
1361- try {
1362- byte [] result = this .fula .manifestRemoveStorer (seedString , storage , poolID , cid );
1363- String resultString = toString (result );
1364- promise .resolve (resultString );
1365- } catch (Exception e ) {
1366- Log .d ("get" , e .getMessage ());
1367- promise .reject (e );
1368- }
1369- });
1370- }
1371-
1372- @ ReactMethod
1373- public void removeStoredReplication (String seedString , String uploader , long poolID , String cid , Promise promise ) {
1374- ThreadUtils .runOnExecutor (() -> {
1375- Log .d ("ReactNative" , "removeStoredReplication: seedString = " + seedString + "; uploader = " + uploader + "; poolID = " + poolID + "; cid = " + cid );
1376- try {
1377- byte [] result = this .fula .manifestRemoveStored (seedString , uploader , poolID , cid );
1378- String resultString = toString (result );
1379- promise .resolve (resultString );
1380- } catch (Exception e ) {
1381- Log .d ("get" , e .getMessage ());
1382- promise .reject (e );
1383- }
1384- });
1385- }
1386-
13871289 @ ReactMethod
13881290 private void listRecentCidsAsString (Promise promise ) throws Exception {
13891291 ThreadUtils .runOnExecutor (() -> {
0 commit comments