diff --git a/docs/index.html b/docs/index.html
index b6fed4e..52e451d 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -57,9 +57,7 @@
Approvals
Events
- Accounts
-
+
{{ coinbase ? nameOrAddress(coinbase, 16) : 'Connect' }}
@@ -98,11 +96,6 @@
-
@@ -153,92 +146,8 @@
-
-
-
- Punk {{ modalPunk.punkId }}
-
-
-
-
- {{ modalPunk.punkId }}
-
-
-
-
-
-
-
- {{ slugToTitle(attribute.value) }}
-
-
-
-
-
-
-
- {{ nameOrAddress(indexToAddress[modalPunk.v1.ownerIndex], 42) }}
-
-
-
-
-
-
-
- Yes
-
-
-
- No
-
-
-
-
-
-
-
-
- {{ nameOrAddress(indexToAddress[modalPunk.v2.ownerIndex], 42) }}
-
-
-
-
-
-
-
- Yes
-
-
-
- No
-
-
-
-
-
-
-
-
-
- Address {{ modalAddress.address }}
-
-
-
-
-
- {{ modalAddress.address }}
-
-
-
-
- {{ modalAddress.name }}
-
-
-
-
-
-
+
{{ commify0(modalTx.tx.blockNumber) }}
@@ -275,7 +183,6 @@
-
@@ -293,9 +200,6 @@
-
@@ -352,10 +256,10 @@
-
-
+
+ -->
@@ -639,27 +543,6 @@ Welcome
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -797,16 +680,16 @@ Welcome
address: null,
name: null,
},
- modalTx: {
- txHashIndex: null,
- txHash: null,
- tx: null,
- txReceipt: null,
- timestamp: null,
- exchangeRate: null,
- txFee: null,
- txFeeInReportingCurrency: null,
- },
+ // modalTx: {
+ // txHashIndex: null,
+ // txHash: null,
+ // tx: null,
+ // txReceipt: null,
+ // timestamp: null,
+ // exchangeRate: null,
+ // txFee: null,
+ // txFeeInReportingCurrency: null,
+ // },
approvalsSortOptions: [
{ value: 'symbolasc', text: '▲ Symbol' },
{ value: 'symboldsc', text: '▼ Symbol' },
@@ -861,17 +744,6 @@ Welcome
{ key: 'name', label: 'Name', sortable: false, thStyle: 'width: 20%;', thClass: 'text-left', tdClass: 'text-left' },
{ key: 'fields', label: 'Fields', sortable: false, thStyle: 'width: 50%;', thClass: 'text-left', tdClass: 'text-left' },
],
- // As supported by https://min-api.cryptocompare.com/data/v2/histoday?fsym=ETH&tsym={ccy}&limit=2000
- reportingCurrencyOptions: [
- { value: 'AUD', text: 'AUD' },
- { value: 'CAD', text: 'CAD' },
- { value: 'CHF', text: 'CHF' },
- { value: 'EUR', text: 'EUR' },
- { value: 'GBP', text: 'GBP' },
- { value: 'JPY', text: 'JPY' },
- { value: 'NZD', text: 'NZD' },
- { value: 'USD', text: 'USD' },
- ],
reportingDateTimeOptions: [
{ value: 0, text: 'Local Time' },
{ value: 1, text: 'UTC Time' },
@@ -1032,28 +904,12 @@ Welcome
// --- METHODS ---
methods: {
- slugToTitle(slug) {
- var words = slug.toString().split("-");
- return words.map(function(word) {
- if (word == "3d" || word == "vr") {
- return word.toUpperCase();
- } else {
- return word.charAt(0).toUpperCase() + word.substring(1).toLowerCase();
- }
- }).join(' ');
- },
-
approvalsRowSelected(item) {
- console.log("approvalsRowSelected: " + JSON.stringify(item));
+ console.log(moment().format("HH:mm:ss") + " approvalsRowSelected: " + JSON.stringify(item));
if (item && item.length > 0) {
this.modalApproval.item = item[0];
this.$bvModal.show('modal-approval');
this.$refs.approvalsTable.clearSelected();
- // this.settings.selectedFunctionSelector = this.settings.selectedFunctionSelector != null ? null : item[0].functionSelector;
- // this.selectedPool = this.selectedPool != null ? null : item[0].address;
- // for (const setName of ['validTokenIdsInPool', 'validTokenIdsOwned']) {
- // Vue.set(this.selectedTokens, setName, {});
- // }
}
},
@@ -1100,47 +956,12 @@ Welcome
}
},
- showModalPunk(punkId) {
- // console.log(moment().format("HH:mm:ss") + " showModalPunk - punkId: " + punkId);
- this.modalPunk.punkId = punkId;
- const w1Index = this.addressToIndex[WRAPPEDCRYPTOPUNKSV1ADDRESS];
- const w2Index = this.addressToIndex[WRAPPEDCRYPTOPUNKSV2ADDRESS];
- const v1OwnerIndex = this.tokens[1] && this.tokens[1][punkId] || null;
- const v2OwnerIndex = this.tokens[2] && this.tokens[2][punkId] || null;
- const w1OwnerIndex = this.tokens[3] && this.tokens[3][punkId] || null;
- const w2OwnerIndex = this.tokens[4] && this.tokens[4][punkId] || null;
- if (v1OwnerIndex == w1Index) {
- this.modalPunk.v1.ownerIndex = w1OwnerIndex || 0;
- this.modalPunk.v1.wrapped = true;
- } else {
- this.modalPunk.v1.ownerIndex = v1OwnerIndex;
- this.modalPunk.v1.wrapped = false;
- }
- if (v2OwnerIndex == w2Index) {
- this.modalPunk.v2.ownerIndex = w2OwnerIndex;
- this.modalPunk.v2.wrapped = true;
- } else {
- this.modalPunk.v2.ownerIndex = v2OwnerIndex;
- this.modalPunk.v2.wrapped = false;
- }
- this.modalPunk.attributes = this.punkAttributes[punkId];
- this.$bvModal.show('modal-punk');
- },
-
- showModalAddress(addressIndex) {
- this.modalAddress.addressIndex = addressIndex;
- this.modalAddress.address = this.indexToAddress[addressIndex];
- this.modalAddress.name = this.indexToAddressName[addressIndex] || null;
- console.log(moment().format("HH:mm:ss") + " showModalAddress: " + addressIndex + " => " + JSON.stringify(this.modalAddress));
- this.$bvModal.show('modal-address');
- },
-
- async showModalTx(txHashIndex) {
- const provider = new ethers.providers.Web3Provider(window.ethereum);
- this.modalTx = await getTxInfo({ txHashIndex, txHash: this.indexToTxHash[txHashIndex] }, provider, this.exchangeRates);
- this.$bvModal.show('modal-tx');
- // console.log(moment().format("HH:mm:ss") + " showModalTx: " + txHashIndex + " => " + JSON.stringify(this.modalTx, null, 2));
- },
+ // async showModalTx(txHashIndex) {
+ // const provider = new ethers.providers.Web3Provider(window.ethereum);
+ // this.modalTx = await getTxInfo({ txHashIndex, txHash: this.indexToTxHash[txHashIndex] }, provider, this.exchangeRates);
+ // this.$bvModal.show('modal-tx');
+ // // console.log(moment().format("HH:mm:ss") + " showModalTx: " + txHashIndex + " => " + JSON.stringify(this.modalTx, null, 2));
+ // },
async checkIt(devMode) {
const db = new Dexie(this.db.name);
@@ -1161,19 +982,12 @@ Welcome
if (!devMode) {
await this.syncNames(db, provider);
}
-
if (!devMode) {
await this.syncBlockTimestamps(db);
}
- // if (!devMode) {
- // await this.syncExchangeRates(db);
- // }
// if (devMode) {
await this.processData(db, provider);
// }
- // if (!devMode) {
- // await this.loadCurrentData();
- // }
this.sync.section = null;
this.sync.halt = false;
},
@@ -1232,7 +1046,6 @@ Welcome
const ownersMap = {};
const contractsMap = {};
const spendersMap = {};
- // console.log("syncNames: " + JSON.stringify(event));
for (const event of this.events) {
if (!(event.owner in ownersMap)) {
ownersMap[event.owner] = true;
@@ -1278,7 +1091,6 @@ Welcome
const name = tokenInfos[2][i];
if ((mask & MASK_ISEOA) == MASK_ISERC721) {
accounts[account].type = "eoa";
- // accounts[account] = { type: "eoa", symbol: null, name: null };
} else if ((mask & MASK_ISERC20) == MASK_ISERC20) {
accounts[account].type = "erc20";
accounts[account].symbol = symbol;
@@ -1289,12 +1101,10 @@ Welcome
} catch (e1) {
accounts[account].decimals = 0;
}
- // accounts[account] = { type: "erc20", symbol, name };
} else if ((mask & MASK_ISERC721) == MASK_ISERC721) {
accounts[account].type = "erc721";
accounts[account].symbol = symbol;
accounts[account].name = name;
- // accounts[account] = { type: "erc721", symbol, name };
} else {
const erc165Abi = [ "function supportsInterface(bytes4 interfaceID) external view returns (bool)" ];
const erc165Contract = new ethers.Contract(account, erc165Abi, provider);
@@ -1303,96 +1113,87 @@ Welcome
console.log(account + " " + result);
if (result) {
accounts[account].type = "erc1155";
- // accounts[account].symbol = TODO
- // accounts[account].name = TODO
- // accounts[account] = { type: "erc1155", symbol, name };
} else {
accounts[account].type = "unknown2";
- // accounts[account] = { type: "unknown2", symbol, name };
}
} catch (e1) {
accounts[account].type = "unknown1";
- // accounts[account] = { type: "unknown1", symbol, name };
}
// console.log(" " + account + " " + symbol + " " + name + " " + mask);
}
}
} catch (e) {
console.log("syncNames erc721Helper - ERROR: " + account + ", message: " + e.message);
- // results.mask = 0;
- // results.symbol = null;
- // results.name = null;
accounts[account].type = "unknown0";
}
}
}
localStorage.approvalAccounts = JSON.stringify(accounts);
Vue.set(this, 'accounts', accounts);
- // console.log("accounts: " + JSON.stringify(accounts, null, 2));
},
- // TODO: Refresh sync
- async syncENSNames(newAddressIndexes, db, provider) {
- const ensReverseRecordsContract = new ethers.Contract(ENSREVERSERECORDSADDRESS, ENSREVERSERECORDSABI, provider);
- let indexToAddress = [];
- let addressToIndex = {};
- const indexToAddressDataItems = await db.cache.where("objectName").equals(this.chainId + "_indexToAddress").toArray();
- if (indexToAddressDataItems.length == 1) {
- indexToAddress = indexToAddressDataItems[0].object;
- for (const [index, address] of indexToAddress.entries()) {
- addressToIndex[address] = index;
- }
- }
- const addresses = newAddressIndexes.map(e => indexToAddress[e]);
- this.sync.completed = 0;
- this.sync.total = addresses.length;
- this.sync.section = 'ENS Names';
- const MAXBATCHSIZE = 1000;
- let batchSize = MAXBATCHSIZE;
- let completed = 0;
- let done = false;
- let start = completed;
- do {
- let end = parseInt(start) + batchSize - 1;
- if (end > addresses.length) {
- end = addresses.length;
- }
- try {
- const batch = addresses.slice(start, end + 1);
- const allnames = await ensReverseRecordsContract.getNames(batch);
- for (let j = 0; j < batch.length; j++) {
- const account = batch[j];
- const name = allnames[j];
- // TODO: const normalized = normalize(account);
- if (name.length > 0) {
- // console.log(account + " => " + name);
- Vue.set(this.indexToAddressName, addressToIndex[account], name);
- }
- }
- start = parseInt(end) + 1;
- } catch (e) {
- if (batchSize > 1) {
- batchSize = parseInt(batchSize / 2);
- } else {
- console.log("Skipping #" + start + " " + addresses[start]);
- start = parseInt(start) + 1;
- batchSize = MAXBATCHSIZE;
- }
- }
- this.sync.completed = start;
- done = start > addresses.length;
- } while (!done);
-
- for (const [address, name] of Object.entries(CUSTOMNAMES)) {
- Vue.set(this.indexToAddressName, addressToIndex[address], name);
- }
- // console.log("this.indexToAddressName: " + JSON.stringify(this.indexToAddressName, null, 2));
- await db.cache.put({ objectName: CHAINID_MAINNET + "_indexToAddressName", object: this.indexToAddressName }).then (function() {
- }).catch(function(error) {
- console.log("error: " + error);
- });
- console.log(moment().format("HH:mm:ss") + " syncENSNames END");
- },
+ // // TODO: Refresh sync
+ // async syncENSNames(newAddressIndexes, db, provider) {
+ // const ensReverseRecordsContract = new ethers.Contract(ENSREVERSERECORDSADDRESS, ENSREVERSERECORDSABI, provider);
+ // let indexToAddress = [];
+ // let addressToIndex = {};
+ // const indexToAddressDataItems = await db.cache.where("objectName").equals(this.chainId + "_indexToAddress").toArray();
+ // if (indexToAddressDataItems.length == 1) {
+ // indexToAddress = indexToAddressDataItems[0].object;
+ // for (const [index, address] of indexToAddress.entries()) {
+ // addressToIndex[address] = index;
+ // }
+ // }
+ // const addresses = newAddressIndexes.map(e => indexToAddress[e]);
+ // this.sync.completed = 0;
+ // this.sync.total = addresses.length;
+ // this.sync.section = 'ENS Names';
+ // const MAXBATCHSIZE = 1000;
+ // let batchSize = MAXBATCHSIZE;
+ // let completed = 0;
+ // let done = false;
+ // let start = completed;
+ // do {
+ // let end = parseInt(start) + batchSize - 1;
+ // if (end > addresses.length) {
+ // end = addresses.length;
+ // }
+ // try {
+ // const batch = addresses.slice(start, end + 1);
+ // const allnames = await ensReverseRecordsContract.getNames(batch);
+ // for (let j = 0; j < batch.length; j++) {
+ // const account = batch[j];
+ // const name = allnames[j];
+ // // TODO: const normalized = normalize(account);
+ // if (name.length > 0) {
+ // // console.log(account + " => " + name);
+ // Vue.set(this.indexToAddressName, addressToIndex[account], name);
+ // }
+ // }
+ // start = parseInt(end) + 1;
+ // } catch (e) {
+ // if (batchSize > 1) {
+ // batchSize = parseInt(batchSize / 2);
+ // } else {
+ // console.log("Skipping #" + start + " " + addresses[start]);
+ // start = parseInt(start) + 1;
+ // batchSize = MAXBATCHSIZE;
+ // }
+ // }
+ // this.sync.completed = start;
+ // done = start > addresses.length;
+ // } while (!done);
+ //
+ // for (const [address, name] of Object.entries(CUSTOMNAMES)) {
+ // Vue.set(this.indexToAddressName, addressToIndex[address], name);
+ // }
+ // // console.log("this.indexToAddressName: " + JSON.stringify(this.indexToAddressName, null, 2));
+ // await db.cache.put({ objectName: CHAINID_MAINNET + "_indexToAddressName", object: this.indexToAddressName }).then (function() {
+ // }).catch(function(error) {
+ // console.log("error: " + error);
+ // });
+ // console.log(moment().format("HH:mm:ss") + " syncENSNames END");
+ // },
async syncBlockTimestamps(db) {
console.log(moment().format("HH:mm:ss") + " syncBlockTimestamps");
@@ -1487,158 +1288,15 @@ Welcome
console.log("accounts: " + JSON.stringify(accounts, null, 2));
localStorage.approvalAccounts = JSON.stringify(accounts);
// Vue.set(this, 'accounts', accounts);
- },
-
- // TODO: Incremental sync with an overlap
- async syncExchangeRates(db) {
- console.log(moment().format("HH:mm:ss") + " syncExchangeRates - reportingCurrency: " + this.settings.reportingCurrency);
- const MAXDAYS = 2000;
- const MINDATE = moment("2017-06-09");
- let toTs = moment();
- const exchangeRates = {};
- while (toTs.year() >= 2017) {
- let days = toTs.diff(MINDATE, 'days');
- if (days > MAXDAYS) {
- days = MAXDAYS;
- }
- let url = "https://min-api.cryptocompare.com/data/v2/histoday?fsym=ETH&tsym=" + this.settings.reportingCurrency + "&toTs=" + toTs.unix() + "&limit=" + days;
- if (this.settings.cryptoCompareAPIKey) {
- url = url + "&api_key=" + this.settings.cryptoCompareAPIKey;
- }
- console.log(moment().format("HH:mm:ss") + " syncExchangeRates - url: " + url);
- const data = await fetch(url)
- .then(response => response.json())
- .catch(function(e) {
- console.log("error: " + e);
- });
- for (day of data.Data.Data) {
- exchangeRates[moment.unix(day.time).format("YYYYMMDD")] = day.close;
- }
- toTs = moment(toTs).subtract(MAXDAYS, 'days');
- }
- // console.log(moment().format("HH:mm:ss") + " syncExchangeRates - exchangeRates: " + JSON.stringify(exchangeRates));
- await db.cache.put({ objectName: this.chainId + "_exchangeRates", object: exchangeRates }).then (function() {
- }).catch(function(error) {
- console.log("error: " + error);
- });
- this.exchangeRates = exchangeRates;
- },
-
- async loadCurrentData() {
- const db = new Dexie(this.db.name);
- db.version(this.db.version).stores(this.db.schemaDefinition);
-
- const syncStateList = await db.syncStates.toArray();
- const syncStates = {};
- for (const syncState of syncStateList) {
- syncStates[syncState.contract] = syncState;
- }
- // console.log("syncStates: " + JSON.stringify(syncStates, null, 2));
- Vue.set(this, 'syncStates', syncStates);
-
- if (this.settings.tabIndex == 1) {
- const latest = await db.events.limit(this.settings.eventsTable.pageSize).toArray();
- // for (const o of latest) {
- // console.log("o: " + JSON.stringify(o));
- // }
- const events = latest;
-
- // events.push({ test: 123, one: 234 });
- // events.push({ test: 234, one: 345 });
- Vue.set(this, 'events', events);
- }
-
- for (const name of ['indexToAddress', 'indexToAddressName', 'indexToNameLabel', 'indexToString', 'indexToHash', 'indexToTxHash', 'blockTimestamps', 'exchangeRates', 'txs']) {
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData: " + name);
- const dataItems = await db.cache.where("objectName").equals(this.chainId + "_" + name).toArray();
- if (dataItems.length == 1) {
- Vue.set(this, name, dataItems[0].object);
- }
- }
- const addressToIndex = {};
- for (const [index, address] of this.indexToAddress.entries()) {
- addressToIndex[address] = index;
- }
- Vue.set(this, 'addressToIndex', addressToIndex);
- const txHashToIndex = {};
- for (const [index, address] of this.indexToTxHash.entries()) {
- txHashToIndex[address] = index;
- }
- Vue.set(this, 'txHashToIndex', txHashToIndex);
- const stringToIndex = {};
- for (const [index, address] of this.indexToString.entries()) {
- stringToIndex[address] = index;
- }
- Vue.set(this, 'stringToIndex', stringToIndex);
-
- const nameToIndex = {};
- const labelToIndex = {};
- for (const [index, item] of this.indexToNameLabel.entries()) {
- nameToIndex[item[0]] = index;
- labelToIndex[item[1]] = index;
- }
- Vue.set(this, 'nameToIndex', nameToIndex);
- Vue.set(this, 'labelToIndex', labelToIndex);
-
-
- const hashToIndex = {};
- for (const [index, address] of this.indexToHash.entries()) {
- hashToIndex[address] = index;
- }
- Vue.set(this, 'hashToIndex', hashToIndex);
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - indexToString[0..9]: " + JSON.stringify(this.indexToString.slice(0, 10), null, 2));
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - stringToIndex['ethereumdex']: " + JSON.stringify(this.stringToIndex['ethereumdex'], null, 2));
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - indexToHash[0..9]: " + JSON.stringify(this.indexToHash.slice(0, 10), null, 2));
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - txs[0..9]: " + JSON.stringify(this.txs.slice(0, 10), null, 2));
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - indexToTxHash[0..9]: " + JSON.stringify(this.indexToTxHash.slice(0, 10), null, 2));
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - indexToNameLabel[0..9]: " + JSON.stringify(this.indexToNameLabel.slice(0, 10), null, 2));
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - nameToIndex: " + JSON.stringify(this.nameToIndex, null, 2));
- // console.log(moment().format("HH:mm:ss") + " loadCurrentData - indexToNameLabel: " + JSON.stringify(this.indexToNameLabel, null, 2));
- db.close();
+ // TODO: UI not updating
},
saveSettings() {
localStorage.approvalToolSettings = JSON.stringify(this.settings);
},
- filterChanged(dataType, option) {
- if (!this.settings.filters[dataType]) {
- Vue.set(this.settings.filters, dataType, {});
- }
- if (this.settings.filters[dataType][option]) {
- Vue.delete(this.settings.filters[dataType], option);
- if (Object.keys(this.settings.filters[dataType]) == 0) {
- Vue.delete(this.settings.filters, dataType);
- }
- } else {
- Vue.set(this.settings.filters[dataType], option, true);
- }
- this.saveSettings();
- },
- resetFilters() {
- Vue.set(this.settings, 'filters', {});
- Vue.set(this.settings, 'filterByIds', null);
- Vue.set(this.settings, 'filterByOwners', null);
- this.saveSettings();
- },
-
async processNewBlock(blockNumber) {
console.log(moment().format("HH:mm:ss") + " processNewBlock #" + this.commify0(blockNumber) + ", latest #" + this.commify0(this.blockNumber) + " @ " + moment.unix(this.timestamp).format("YYYY-MM-DD HH:mm:ss") + " " + moment.unix(this.timestamp).fromNow());
},
-
- // async doSomething() {
- // console.log(moment().format("HH:mm:ss") + " doSomething");
- //
- // const provider = new ethers.providers.Web3Provider(window.ethereum);
- // const signer = provider.getSigner();
- // const ethRegistrarControllerContract = new ethers.Contract(ETHREGISTRARCONTROLLERADDRESS, ETHREGISTRARCONTROLLERABI, provider);
- // const ethRegistrarControllerContractWithSigner = ethRegistrarControllerContract.connect(provider.getSigner());
- //
- // const name = "bokky";
- // const duration = 12345;
- // const rentPrice = await ethRegistrarControllerContract.rentPrice(name, duration);
- // console.log("rentPrice: " + rentPrice);
- // },
-
async halt() {
this.sync.halt = true;
console.log(moment().format("HH:mm:ss") + " halt()");
@@ -1729,77 +1387,31 @@ Welcome
}
return result;
},
- exportTxHashes() {
- console.log("exportTxHashes");
- var dataStr = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(this.txHashes));
- var link = document.createElement("a");
- link.setAttribute("href", dataStr);
- link.setAttribute("download", "txhashes.json");
- document.body.appendChild(link); // Required for FF
- link.click();
- },
- exportAccounts() {
- console.log("exportAccounts");
- const rows = [
- ["No", "Address", "Name", "ENSName", "Group", "Sync", "Include"],
- ];
- let i = 1;
- for (const result of this.filteredSortedAccounts) {
- rows.push([
- i,
- result.address,
- result.name,
- result.ensName,
- result.group,
- result.sync ? "y" : "n",
- result.include ? "y" : "n",
- ]);
- i++;
- }
- let tsvContent = "data:text/tsv;charset=utf-8," + rows.map(e => e.join("\t")).join("\n");
- var encodedUri = encodeURI(tsvContent);
- var link = document.createElement("a");
- link.setAttribute("href", encodedUri);
- link.setAttribute("download", "mynfts_account_export-" + moment().format("YYYY-MM-DD-HH-mm-ss") + ".tsv");
- document.body.appendChild(link); // Required for FF
- link.click(); // This will download the data with the specified file name
- },
- // async backupFilesChange(fileName, fileList) {
- // const reader = new FileReader();
- // this.restoreAddresses = [];
- // const t = this;
- // reader.onload = function (event) {
- // const data = event.target.result;
- // const lines = data.split("\n");
- // for (const line of lines) {
- // const fields = line.split("\t");
- // // console.log(JSON.stringify(fields));
- // if (fields[0] != "No") {
- // const [number, address, name, ensName, group, sync, include] = fields;
- // t.restoreAddresses.push({ address, name, ensName, group, sync, include });
- // }
- // }
- // };
- // await reader.readAsText(fileList[0]);
- // },
- // restoreFromBackup() {
- // if (this.restoreAddresses) {
- // for (const addressData of this.restoreAddresses) {
- // if (!(addressData.address in this.settings.accounts)) {
- // console.log("Adding: " + JSON.stringify(addressData));
- // Vue.set(this.settings.accounts, addressData.address, {
- // name: addressData.name,
- // ensName: null,
- // group: addressData.group,
- // sync: true,
- // include: true,
- // });
- // } else {
- // console.log("Discarding duplicate: " + JSON.stringify(addressData));
- // }
- // }
- // this.saveSettings();
+ // exportAccounts() {
+ // console.log("exportAccounts");
+ // const rows = [
+ // ["No", "Address", "Name", "ENSName", "Group", "Sync", "Include"],
+ // ];
+ // let i = 1;
+ // for (const result of this.filteredSortedAccounts) {
+ // rows.push([
+ // i,
+ // result.address,
+ // result.name,
+ // result.ensName,
+ // result.group,
+ // result.sync ? "y" : "n",
+ // result.include ? "y" : "n",
+ // ]);
+ // i++;
// }
+ // let tsvContent = "data:text/tsv;charset=utf-8," + rows.map(e => e.join("\t")).join("\n");
+ // var encodedUri = encodeURI(tsvContent);
+ // var link = document.createElement("a");
+ // link.setAttribute("href", encodedUri);
+ // link.setAttribute("download", "mynfts_account_export-" + moment().format("YYYY-MM-DD-HH-mm-ss") + ".tsv");
+ // document.body.appendChild(link); // Required for FF
+ // link.click(); // This will download the data with the specified file name
// },
copyToClipboard(str) {
navigator.clipboard.writeText(str);
@@ -1870,15 +1482,12 @@ Welcome
const tempSettings = JSON.parse(localStorage.approvalToolSettings);
if ('version' in tempSettings && tempSettings.version == this.settings.version) {
this.settings = tempSettings;
- // if (this.settings.punksTable.currentPage > 1) {
- // this.settings.punksTable.currentPage = 1;
- // }
- // if (this.settings.activityTable.currentPage > 1) {
- // this.settings.activityTable.currentPage = 1;
- // }
- // if (this.settings.ownersTable.currentPage > 1) {
- // this.settings.ownersTable.currentPage = 1;
- // }
+ if (this.settings.approvalsTable.currentPage > 1) {
+ this.settings.approvalsTable.currentPage = 1;
+ }
+ if (this.settings.eventsTable.currentPage > 1) {
+ this.settings.eventsTable.currentPage = 1;
+ }
}
}
if ('approvalEvents' in localStorage) {
@@ -1888,24 +1497,11 @@ Welcome
if ('approvalAccounts' in localStorage) {
const tempAccounts = JSON.parse(localStorage.approvalAccounts);
this.accounts = tempAccounts;
- // console.log("accounts: " + JSON.stringify(this.accounts, null, 2));
}
if ('approvalBlockTimestamps' in localStorage) {
const tempBlockTimestamps = JSON.parse(localStorage.approvalBlockTimestamps);
this.blockTimestamps = tempBlockTimestamps;
- // console.log("blockTimestamps: " + JSON.stringify(this.blockTimestamps, null, 2));
}
- (async() => {
- const db = new Dexie(this.db.name);
- db.version(this.db.version).stores(this.db.schemaDefinition);
- // await this.loadCurrentData(db);
- db.close();
- })();
- // (async() => {
- // // TODO: TESTING
- // await delay(4500);
- // await this.showModalTx(288878);
- // })();
},
})