
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.
A fully asynchronous or optionally synchronous fetch implementation for AssemblyScript
npm install as-fetch
Add the fetch imports to your instantiation file.
Raw Bindings
import { readFileSync } from "fs";
import { instantiate } from "./build/test.js";
import { FetchHandler } from "as-fetch/bindings.raw.esm.js";
const binary = readFileSync("./build/test.wasm");
const compiled = new WebAssembly.Module(binary);
// You can use your own implementation of fetch
const Fetch = new FetchHandler(fetch);
instantiate(compiled, { ...Fetch.imports }).then((exports) => {
Fetch.init(exports, exports.main);
exports.main();
});
ESM Bindings
import { main, responseHandler } from "./build/test.js";
// Fetch API must exist on the host
fetch.setResponseHandler = responseHandler;
main();
Add the transform to your asc command (e.g. in package.json)
--transform as-fetch/transform
Alternatively, add it to your asconfig.json
{
"options": {
"transform": ["as-fetch/transform"]
}
}
Finally, add the fetch imports to your instantiation file.
Raw Bindings
import { readFileSync } from "fs";
import { instantiate } from "./build/test.js";
import { FetchHandler } from "as-fetch/bindings.raw.esm.js";
const binary = readFileSync("./build/test.wasm");
const compiled = new WebAssembly.Module(binary);
// You can use your own implementation of fetch
const Fetch = new FetchHandler(fetch);
instantiate(compiled, { ...Fetch.imports }).then((exports) => {
Fetch.init(exports, exports.main);
exports.main();
});
ESM Bindings are not supported for sync fetch. Use Raw instead
Asynchronous Fetch
import { fetch } from "as-fetch/assembly";
// Make sure to add this line! (For async only)
export { responseHandler } from "as-fetch/assembly";
fetch("http://api.quotable.io/random", {
method: "GET",
mode: "no-cors",
headers: [],
body: null,
}).then((response) => {
let body = response.text();
console.log("Ok: " + response.ok.toString());
console.log("Status: " + response.status.toString());
console.log("Status Text: " + response.statusText);
console.log("Redirected: " + response.redirected.toString());
console.log("Response: " + body);
});
Synchronous Fetch
import { fetchSync } from "as-fetch/sync";
const response = fetchSync("http://api.quotable.io/random", {
method: "GET",
mode: "no-cors",
headers: [],
body: null,
});
let body = response.text();
console.log("Ok: " + response.ok.toString());
console.log("Status: " + response.status.toString());
console.log("Status Text: " + response.statusText);
console.log("Redirected: " + response.redirected.toString());
console.log("Response: " + body);
FAQs
Fetch API brought to AssemblyScript
We found that as-fetch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.