mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 09:45:52 +00:00
Merge pull request #270 from kennycud/master
Adding transaction activity summary support for Q-apps
This commit is contained in:
commit
bcde7bc16e
@ -28,6 +28,9 @@ export const GET_USER_WALLET_INFO = 'GET_USER_WALLET_INFO';
|
||||
// GET_CROSSCHAIN_SERVER_INFO action
|
||||
export const GET_CROSSCHAIN_SERVER_INFO = 'GET_CROSSCHAIN_SERVER_INFO';
|
||||
|
||||
// GET_TX_ACTIVITY_SUMMARY action
|
||||
export const GET_TX_ACTIVITY_SUMMARY = 'GET_TX_ACTIVITY_SUMMARY';
|
||||
|
||||
// GET_WALLET_BALANCE action
|
||||
export const GET_WALLET_BALANCE = 'GET_WALLET_BALANCE';
|
||||
|
||||
|
@ -2655,6 +2655,46 @@ class WebBrowser extends LitElement {
|
||||
break
|
||||
}
|
||||
|
||||
case actions.GET_TX_ACTIVITY_SUMMARY: {
|
||||
const requiredFields = ['coin']
|
||||
const missingFields = []
|
||||
|
||||
requiredFields.forEach((field) => {
|
||||
if (!data[field]) {
|
||||
missingFields.push(field)
|
||||
}
|
||||
})
|
||||
|
||||
if (missingFields.length > 0) {
|
||||
const missingFieldsString = missingFields.join(', ')
|
||||
const errorMsg = `Missing fields: ${missingFieldsString}`
|
||||
let data = {}
|
||||
data['error'] = errorMsg
|
||||
response = JSON.stringify(data)
|
||||
break
|
||||
}
|
||||
|
||||
try {
|
||||
let coin = data.coin;
|
||||
response = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
method: 'POST',
|
||||
url: `/crosschain/txactivity?apiKey=${this.getApiKey()}&foreignBlockchain=${coin}`,
|
||||
headers: {
|
||||
'Accept': '*/*',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
} catch (error) {
|
||||
const data = {}
|
||||
const errorMsg = "Error in tx activity summary"
|
||||
data['error'] = errorMsg
|
||||
response = JSON.stringify(data)
|
||||
} finally {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
case actions.GET_DAY_SUMMARY: {
|
||||
try {
|
||||
const summary = await parentEpml.request('apiCall', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user