Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
srp-data-api
Advanced tools
package for data extraction from SRP company for getting utility data
npm
package for SRP company for data extraction
getServiceAccounts
- It gives the response in the form of list of service-accounts
related to given user-account
getMonthlyUtilityData
- It gives the response in the form of list of monthly-utility-data
for given service-account
npm i srp-data-api --save
import { SRPUtilityDataService } from 'srp-data-api';
const srpUtilityDataService = new SRPUtilityDataService();
const payload: GetDataPayload = {
password: string;
username: string;
};
const res = await srpUtilityDataService.getServiceAccounts(payload)
After data extraction, we will get response as -
res: UtilityUserAccountResponse = {
id: string
name: string
serviceAccounts[]: [{id:string, address:Address}]
};
const res = await srpUtilityDataService.getMonthlyUtilityData(payload)
After data extraction, we will get response as -
res: MonthlyUtilityData[] = {
_id: string
amountInCents: number
energyConsumptionInWatts: number
month: string
serviceAccountId: string
year: number
};
getServiceAccounts: (
payload: GetDataPayload,
) => Promise<UtilityUserAccountResponse>;
getMonthlyUtilityData: (
payload: GetDataPayload,
) => Promise<MonthlyUtilityData[]>;
setProxy:(proxy: string[]) => Promise<void>
GetDataPayload = {
password: string;
username: string;
};
WHERE,
password: password of the user-account
username: username of the user-account
proxy:string[]
WHERE,
proxy: VGS proxy we set
UtilityUserAccountResponse = {
id: string
name: string
serviceAccounts[]: [{id:string, address:Address}]
};
WHERE,
id: user-account id
name: Name of the user
serviceAccounts[]: List of service-accounts which are linked to given user-account id
MonthlyUtilityData[] = {
_id: string
amountInCents: number
energyConsumptionInWatts: number
month: string
serviceAccountId: string
year: number
};
WHERE,
_id: id of monthly utility data model
amountInCents: Cost of electricity used in respective month and year in cents
energyConsumptionInWatts: Amount of electricity consumed in respective month and year in watts
month: Month of year for which utility data is extracted
serviceAccountId: service-account id for which utility data is extracted
year: Year of calender for which utility data is extracted
npm run build
- For building the app.npm run test
- Run automated test cases via mocha
and chai
.npm run start
- For starting the app.npm run serve
- For building and starting the app with auto-reload on changes.npm run lint
- To perform lintingTypescript support
Environment specific configuation support. The application use config npm module.
Linting support
npm run lint
import { SRPUtilityDataService } from 'srp-data-api';
const srpUtilityDataService = new SRPUtilityDataService();
const payload: GetDataPayload = {
password: incorrect-username;
username: incorrect-password;
};
const res = await srpUtilityDataService.getServiceAccounts(payload)
The Promise gets rejected with AuthenticationError
with message - The user name or password is incorrect.
If we pass correct credentials for getting utility-data, but data extraction failed and service cannot extract data, then...
import { SRPUtilityDataService } from 'srp-data-api';
const srpUtilityDataService = new SRPUtilityDataService();
const payload: GetDataPayload = {
password: correct-username;
username: correct-password;
};
const res = await srpUtilityDataService.getMonthlyUtilityData(payload)
DataExtractionError
with message - Failed to extract data
FAQs
package for data extraction from SRP company for getting utility data
The npm package srp-data-api receives a total of 30 weekly downloads. As such, srp-data-api popularity was classified as not popular.
We found that srp-data-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.