@bloks/api
Advanced tools
Comparing version 3.5.40 to 3.5.42
{ | ||
"name": "@bloks/api", | ||
"version": "3.5.40", | ||
"version": "3.5.42", | ||
"description": "", | ||
@@ -23,3 +23,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "5bc4932e0536f8d662296cf0ec09b6efe82bbcc7" | ||
"gitHead": "778344d07735bdfdf3181b64899a087f136beb6a" | ||
} |
@@ -988,3 +988,3 @@ import axios from 'axios' | ||
async getRexMpr () { | ||
if (['jungle', 'bos', 'mainnet'].includes(constants.DFUSE_CHAIN)) { | ||
if (['jungle', 'bos', 'mainnet', 'telos'].includes(constants.DFUSE_CHAIN)) { | ||
const { data } = await axios.post('https://www.api.bloks.io/graphql/v1alpha1/graphql', { | ||
@@ -1010,3 +1010,3 @@ query: `query { | ||
async getRexPriceChart () { | ||
if (['jungle', 'bos', 'mainnet'].includes(constants.DFUSE_CHAIN)) { | ||
if (['jungle', 'bos', 'mainnet', 'telos'].includes(constants.DFUSE_CHAIN)) { | ||
const current_time = moment().utc().format('YYYY-MM-DD HH:mm:ss') | ||
@@ -1036,3 +1036,3 @@ const seven_days_ago = moment().subtract(7, 'days').utc().format('YYYY-MM-DD HH:mm:ss') | ||
} else { | ||
return [] | ||
return { actions: [] } | ||
} | ||
@@ -1042,47 +1042,55 @@ } | ||
async rexDfuse (accountName, limit = 25, cursor = undefined, direction = 'desc') { | ||
const q = `account:eosio auth:${accountName} (action:deposit OR action:withdraw OR action:buyrex OR action:unstaketorex OR action:sellrex OR action:cnclrexorder OR action:rentcpu OR action:rentnet OR action:fundcpuloan OR action:fundnetloan OR action:defcpuloan OR action:defnetloan OR action:consolidate OR action:mvtosavings OR action:mvfrsavings)` | ||
if(constants.HISTORY_TYPES.includes('dfuse')) { | ||
const q = `account:eosio auth:${accountName} (action:deposit OR action:withdraw OR action:buyrex OR action:unstaketorex OR action:sellrex OR action:cnclrexorder OR action:rentcpu OR action:rentnet OR action:fundcpuloan OR action:fundnetloan OR action:defcpuloan OR action:defnetloan OR action:consolidate OR action:mvtosavings OR action:mvfrsavings)` | ||
const result = await this.feathers.restApp.service('dfuse').find({ | ||
query: { | ||
type: 'search_transactions', | ||
q: q, | ||
options: Object.assign({}, { | ||
sort: direction, | ||
cursor: cursor, | ||
limit: limit, | ||
withReversible: true | ||
}) | ||
const result = await this.feathers.restApp.service('dfuse').find({ | ||
query: { | ||
type: 'search_transactions', | ||
q: q, | ||
options: Object.assign({}, { | ||
sort: direction, | ||
cursor: cursor, | ||
limit: limit, | ||
withReversible: true | ||
}) | ||
} | ||
}) | ||
// Validation | ||
if (!result) { | ||
throw new Error('Could not retrieve actions') | ||
} | ||
}) | ||
// Validation | ||
if (!result) { | ||
throw new Error('Could not retrieve actions') | ||
return dfuseTransformGetActions({ accountName, direction, ...result }) | ||
} else { | ||
return { actions: [] } | ||
} | ||
return dfuseTransformGetActions({ accountName, direction, ...result }) | ||
} | ||
async rexDfuseRoi (accountName, limit = 100, cursor = undefined, direction = 'desc') { | ||
const q = `account:eosio auth:${accountName} (action:buyrex OR action:sellrex OR action:unstaketorex)` | ||
if(constants.HISTORY_TYPES.includes('dfuse')) { | ||
const q = `account:eosio auth:${accountName} (action:buyrex OR action:sellrex OR action:unstaketorex)` | ||
const result = await this.feathers.restApp.service('dfuse').find({ | ||
query: { | ||
type: 'search_transactions', | ||
q: q, | ||
options: Object.assign({}, { | ||
sort: direction, | ||
cursor: cursor, | ||
limit: limit, | ||
withReversible: true | ||
}) | ||
const result = await this.feathers.restApp.service('dfuse').find({ | ||
query: { | ||
type: 'search_transactions', | ||
q: q, | ||
options: Object.assign({}, { | ||
sort: direction, | ||
cursor: cursor, | ||
limit: limit, | ||
withReversible: true | ||
}) | ||
} | ||
}) | ||
// Validation | ||
if (!result) { | ||
throw new Error('Could not retrieve actions') | ||
} | ||
}) | ||
// Validation | ||
if (!result) { | ||
throw new Error('Could not retrieve actions') | ||
return dfuseTransformGetActions({ accountName, direction, ...result }) | ||
} else { | ||
return [] | ||
} | ||
return dfuseTransformGetActions({ accountName, direction, ...result }) | ||
} | ||
@@ -1089,0 +1097,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94980
1570