Интеграция страницы ValidationLog с сервером

This commit is contained in:
DwCay
2022-07-12 19:21:39 +03:00
parent 7ad29e8fe0
commit 8489bc375c
6 changed files with 79 additions and 233 deletions

View File

@@ -12,12 +12,15 @@ class Store {
_userData = {}
_transactionInfo = {}
constructor() {
makeAutoObservable(this);
this.fetchNodeInfo()
reaction(() => this.tokenKey, () => this.fetchNewAccountData())
reaction(() => this.tokenKey, () => this.fetchTransactionInfo())
};
fetchNewAccountData() {
@@ -35,6 +38,14 @@ class Store {
.then(()=>this.fetchNewAccountData())
}
fetchTransactionInfo() {
fetchWrapper.getAuth(`http://3.125.47.101/api/account/transactions/b444b7ff3118cf2a30cbd54cfcdb8fd5d805017a?moduleID=1001&assetID=11`, {
networkIdentifier: this.nodeInfo.networkIdentifier,
lastBlockID: this.nodeInfo.lastBlockID
})
.then((res)=>this.saveInfoTransaction(res))
}
userDataFetchChange(res) {
this._userData = res;
}
@@ -43,6 +54,10 @@ class Store {
return this._userData
}
get transactionInfo() {
return this._transactionInfo
}
savePassPhrase(phrase) {
this._passPhrase = phrase
}
@@ -51,6 +66,10 @@ class Store {
this._accountData = data;
};
saveInfoTransaction(transaction) {
this._transactionInfo = transaction
}
fetchNodeInfo() {
getNodeInfo()
.then((info) => this.fetchNodeInfoSuccess(info))