
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@moneylion/engine-api
Advanced tools
This is a Javascript interface to the Engine API service.
Install the library
npm add @moneylion/engine-api
Request an authentication token and API endpoint from Engine.
Normally you won't have to create a client instance, but you can do so if you want to make a request that this library doesn't support.
import { Client } from "@moneylion/engine-api";
new Client(endpoint, authentication_token);
This provides get
, post
, and patch
methods that accept a REST endpoint and a request body.
The request body will be serialized to JSON before being sent.
If you want to pass a body as a string or use a different HTTP method, use the request
method.
client.request("/endpoint", "DELETE", "body as a string");
To create a lead, you can do the following:
import { Lead } from "@moneylion/engine-api";
new Lead(endpoint, authentication_token).create(lead);
This will return a promise that resolves with the UUID of the lead that was just created. It will not create a rate table yet. In order to create a rate table you can do the following:
import { Lead } from "@moneylion/engine-api";
new Lead(endpoint, authentication_token).getRateTable(lead);
This will return a promise that resolves with an AsyncRateTable.
You can use the AsyncRateTable.resolve()
method to turn it into a real RateTable.
You can also use getRateTableBlocking
which will resolve with a RateTable, but you will potentially spend longer waiting for network requests.
You can do the lead creation and rate table fetch in one step using the createAndGetRateTable
and createAndGetRateTableBlocking
methods.
To update a lead, you can do the following:
import { Lead } from "@moneylion/engine-api";
new Lead(endpoint, authentication_token).update(leadUuid, updatedLead);
This returns a promise but will not resolve with a rate table and will instead resolve the lead UUID back to you when it finishes.
Rate tables are returned when you create a lead. If you would like to retrieve a rate table manually you can request it by its UUID.
import { AsyncRateTable } from "@moneylion/engine-api";
new AsyncRateTable({ uuid: rateTableUuid, host: endpoint, api_token: authentication_token }).resolve();
// You can also pass a pre-created client instead of endpoint and token
new AsyncRateTable({ uuid: rateTableUuid, client: client }).resolve();
// You can also pass a RateTable object instead of a uuid.
new AsyncRateTable({ rateTable: rateTable, client: client }).resolve();
This is a relatively normal NPM and Typescript project.
npm install
to install dependenciesnpm run build
to build the projectnpm test
to run the testsRun the following steps to publish the library to NPM.
package.json
. Commit this change.npm run build
- This will run Typescript to compile the Javascript.npm publish --access=public
. This will publish the library.FAQs
Interface to engine.tech API
The npm package @moneylion/engine-api receives a total of 233 weekly downloads. As such, @moneylion/engine-api popularity was classified as not popular.
We found that @moneylion/engine-api demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.