
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@reach-sh/humble-sdk
Advanced tools
A Javascript library for interacting with the HumbleSwap DEx.
Documentation has moved here.
v2
introduces a few changes and adds new functionality, including staking pools. Some functions may have been renamed: review changes in our changelog, and view our documentation for additional info.
The fastest way is to use npm
:
$. npm i -s @reach-sh/humble-sdk
To get started without NPM, you can clone and build the SDK from the repository.
# Clone the repository
$. git clone https://github.com/reach-sh/humble-sdk.git
# Enter the directory with the repo (replace with path to your repository clone)
$. cd path/to/humble-sdk
# and install dependencies (there aren't a lot)
$. npm install
# Build the SDK. Will output to a ./lib directory in the same folder as the
# package.json file. This takes seconds and doesn't output anything to your terminal.
$. npm run build
You will know it is complete when your (terminal's) typing prompt reappears.
Then, as a FINAL STEP, copy or move the new lib/
directory into your project. This will allow you to access it like any other JS module:
import { initHumbleSDK } from "path/to/lib";
import { subscribeToPoolStream, createReachAPI } from "@reach-sh/humble-sdk";
const stdlib = createReachAPI();
const acc = await stdlib.createAccount();
// Fetch existing streams and get notified when a new one is created
subscribeToPoolStream(acc, {
// Pool ID (and id of pool tokens) received from contract.
// Pool data has NOT been fetched yet.
onPoolReceived: (info) => {
const [poolAddr, tokenAId, tokenBId] = info;
// ... do something with data
},
// Pool and Token data has been received from network.
onPoolFetched: (result: FetchPoolTxnResult) => {
const { succeeded, poolAddress, data, message } = result;
if (succeeded) // ... do something with data
}
})
Note: Swapping does not use routing. Read the docs to learn how to fetch pools for DEx operations.
import { calculateTokenSwap, performSwap } from "@reach-sh/humble-sdk";
const pool = /* pool source */
// Calculate expected swap output
const { tokenAId, tokenBId } = pool;
const amountA = 100;
const swap = calculateTokenSwap({
pool,
swap: { amountA, tokenAId, tokenBId }
});
// Perform swap
const swapOpts = { poolAddress: pool.poolAddress, swap, pool };
const { data, message, succeeded } = await performSwap(acc, swapOpts);
// if (succeeded) data == { amountIn: string; amountOut: string }
The humble-sdk
contains some helper scripts for running the SDK on a command line. See more here
FAQs
A Javascript library for interacting with the HumbleSwap DEx
We found that @reach-sh/humble-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.