diff --git a/app/build.gradle b/app/build.gradle index d2f0cc6..199a7e6 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,6 +16,7 @@ android { arguments = ["room.schemaLocation": "$projectDir/schemas".toString()] } } + multiDexEnabled true } buildTypes { release { diff --git a/app/schemas/cy.agorise.crystalwallet.dao.CrystalDatabase/2.json b/app/schemas/cy.agorise.crystalwallet.dao.CrystalDatabase/2.json new file mode 100644 index 0000000..2145cfe --- /dev/null +++ b/app/schemas/cy.agorise.crystalwallet.dao.CrystalDatabase/2.json @@ -0,0 +1,247 @@ +{ + "formatVersion": 1, + "database": { + "version": 2, + "identityHash": "e8e3aa452878e49fb9c7cfa99f356e4e", + "entities": [ + { + "tableName": "account_seed", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `master_seed` TEXT)", + "fields": [ + { + "fieldPath": "mId", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "mName", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mMasterSeed", + "columnName": "master_seed", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + }, + { + "tableName": "crypto_net_account", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `seed_id` INTEGER NOT NULL, `account_number` INTEGER NOT NULL, `account_index` INTEGER NOT NULL, FOREIGN KEY(`seed_id`) REFERENCES `account_seed`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )", + "fields": [ + { + "fieldPath": "mId", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "mSeedId", + "columnName": "seed_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "mAccountNumber", + "columnName": "account_number", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "mAccountIndex", + "columnName": "account_index", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [ + { + "name": "index_crypto_net_account_id", + "unique": false, + "columnNames": [ + "id" + ], + "createSql": "CREATE INDEX `index_crypto_net_account_id` ON `${TABLE_NAME}` (`id`)" + }, + { + "name": "index_crypto_net_account_seed_id", + "unique": false, + "columnNames": [ + "seed_id" + ], + "createSql": "CREATE INDEX `index_crypto_net_account_seed_id` ON `${TABLE_NAME}` (`seed_id`)" + } + ], + "foreignKeys": [ + { + "table": "account_seed", + "onDelete": "NO ACTION", + "onUpdate": "NO ACTION", + "columns": [ + "seed_id" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "crypto_coin_transaction", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`account` INTEGER, `id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` INTEGER, `is_input` INTEGER NOT NULL, `account_id` INTEGER NOT NULL, `amount` INTEGER NOT NULL, `id_currency` INTEGER NOT NULL, `is_confirmed` INTEGER NOT NULL, `from` TEXT, `to` TEXT, FOREIGN KEY(`account_id`) REFERENCES `crypto_net_account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`id_currency`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )", + "fields": [ + { + "fieldPath": "account", + "columnName": "account", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "id", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "date", + "columnName": "date", + "affinity": "INTEGER", + "notNull": false + }, + { + "fieldPath": "isInput", + "columnName": "is_input", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "accountId", + "columnName": "account_id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "amount", + "columnName": "amount", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "idCurrency", + "columnName": "id_currency", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "isConfirmed", + "columnName": "is_confirmed", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "from", + "columnName": "from", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "to", + "columnName": "to", + "affinity": "TEXT", + "notNull": false + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [ + { + "table": "crypto_net_account", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "account_id" + ], + "referencedColumns": [ + "id" + ] + }, + { + "table": "crypto_currency", + "onDelete": "CASCADE", + "onUpdate": "NO ACTION", + "columns": [ + "id_currency" + ], + "referencedColumns": [ + "id" + ] + } + ] + }, + { + "tableName": "crypto_currency", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `crypto_net` TEXT, `precision` INTEGER NOT NULL)", + "fields": [ + { + "fieldPath": "mId", + "columnName": "id", + "affinity": "INTEGER", + "notNull": true + }, + { + "fieldPath": "mName", + "columnName": "name", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mCryptoNet", + "columnName": "crypto_net", + "affinity": "TEXT", + "notNull": false + }, + { + "fieldPath": "mPrecision", + "columnName": "precision", + "affinity": "INTEGER", + "notNull": true + } + ], + "primaryKey": { + "columnNames": [ + "id" + ], + "autoGenerate": true + }, + "indices": [], + "foreignKeys": [] + } + ], + "setupQueries": [ + "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)", + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"e8e3aa452878e49fb9c7cfa99f356e4e\")" + ] + } +} \ No newline at end of file diff --git a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java index 143faf1..47926aa 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java +++ b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java @@ -4,6 +4,10 @@ import com.neovisionaries.ws.client.WebSocket; import com.neovisionaries.ws.client.WebSocketException; import com.neovisionaries.ws.client.WebSocketFactory; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + import cy.agorise.graphenej.Address; import cy.agorise.graphenej.UserAccount; import cy.agorise.graphenej.api.GetAccountByName; @@ -16,10 +20,6 @@ import cy.agorise.graphenej.models.BaseResponse; import cy.agorise.graphenej.models.HistoricalTransfer; import cy.agorise.graphenej.models.WitnessResponse; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - /** * Created by henry on 26/9/2017. @@ -29,7 +29,7 @@ public class GrapheneApiGenerator { //TODO network connections private static int connectionTimeout = 5000; - private static String url = "http://128.0.69.157:8090"; + private static String url = "http://128.0.69.157:8090"; /** * Retrieves the data of an account searching by it's id diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java index 9d75dcc..7d66cce 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -1,12 +1,15 @@ package cy.agorise.crystalwallet.manager; +import cy.agorise.crystalwallet.cryptonetinforequests.CryptoNetInfoRequest; +import cy.agorise.crystalwallet.cryptonetinforequests.CryptoNetInfoRequestsListener; +import cy.agorise.crystalwallet.cryptonetinforequests.ValidateImportBitsharesAccountRequest; import cy.agorise.crystalwallet.models.CryptoNetAccount; /** * Created by henry on 26/9/2017. */ -public class BitsharesAccountManager implements CryptoAccountManager { +public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetInfoRequestsListener { @Override public CryptoNetAccount createAccountFromSeed(CryptoNetAccount account) { return null; @@ -21,4 +24,10 @@ public class BitsharesAccountManager implements CryptoAccountManager { public void loadAccountFromDB(CryptoNetAccount account) { } + + @Override + public void onNewRequest(CryptoNetInfoRequest request) { + if (request instanceof ValidateImportBitsharesAccountRequest){ + } + } }