Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
ordinalsbot
Advanced tools
The OrdinalsBot Node library provides convenient access to the OrdinalsBot API from applications written in JavaScript.
You can find examples here. For more information refer to our API docs.
Install the package with:
npm install ordinalsbot --save
or
yarn add ordinalsbot
The package needs to be configured with your account's API key which you can get by opening a ticket in our Discord for now. Our developer dashboard is coming soon...
import { MarketPlace, Inscription } from "ordinalsbot";
// if no parameter given, default environment is 'live'
let inscription = new Inscription("API_KEY", "dev");
let marketplace = new MarketPlace("API_KEY", "dev");
try {
// create new order
const order = await inscription.createOrder({
files: [
{
size: 10,
type: "plain/text",
name: "my-text-inscription-file.txt",
dataURL: "data:plain/text;base64,dGVzdCBvcmRlcg==",
},
],
lowPostage: true,
receiveAddress: "",
fee: 11,
});
console.log("Order: ", order);
} catch (error) {
console.log("Exception: ", error);
}
try {
// get marketplace listings
const listing = await marketplace.getListing();
console.log("Marketplaces: ", listing);
} catch (e) {
console.log("Exception: ", e);
}
Every method returns a chainable promise which can be used instead of a regular callback:
// create new order
inscription
.createOrder({
files: [
{
size: 10,
type: "plain/text",
name: "my-text-inscription-file.txt",
dataURL: "data:plain/text;base64,dGVzdCBvcmRlcg==",
},
],
lowPostage: true,
receiveAddress: "",
fee: 11,
})
.then((order) => {
console.log("Order: ", order);
})
.catch((error) => {
console.log("Exception: ", error);
});
// get marketplace listings
marketplace
.getListing()
.then((listings) => {
console.log("Order: ", listings);
})
.catch((error) => {
console.log("Exception: ", error);
});
For client-side applications, the methods marketplace.createListing()
, marketplace.createOffer()
, and marketplace.setupPaddingOutputs()
support the walletProvider
parameter. This optional string parameter allows for specifying the wallet name, with current support for the Xverse wallet and plans to include additional wallets soon. When the walletProvider
parameter is specified it triggers the invocation of the specified wallet, prompting the user to sign the transaction. This integration significantly streamlines the process by reducing the need for multiple API calls and simplifies the structuring of data required for wallet invocation and transaction signing.
The following example demonstrates how to create a listing for sale. When you invoke marketplace.createListing()
and specify "xverse"
as the walletProvider
, it initiates an API call to generate a listing transaction. The method processes the response, formatting the data according to the requirements of the Xverse wallet. Subsequently, the Xverse wallet is activated to prompt the user to sign the transaction. Once the user successfully signs, this method additionally triggers the save-listing
API, using the appropriately formatted data. Finally, it returns the confirmed listing information as the response.
import { marketplace, WALLET_PROVIDER } from "ordinalsbot";
const listingRequest = {
sellerOrdinals: [{
id: "0c9ac6fb5d4516aade728882e230b0d78337732ea71915c7fbc0cdabe5d29f3ci0",
price: "1234"
}],
sellerPaymentAddress: "2NAurbuXjBK5dztb416bh98ibDS7MKxV75C",
sellerOrdinalPublicKey: "594a4aaf5da5b144d0fa6b47987d966029d892fbc4aebb23214853e8b053702e",
sellerOrdinalAddress: "tb1p79l2gnn7u8uqxfepd7ddeeajzrmuv9nkl20wpf77t2u473a2h89s483yk3",
walletProvider: WALLET_PROVIDER.xverse
};
//call the marketplace listing method
const response = await marketPlace.createListing(listingRequest);
// this will invoke wallet and prompt the user to sign the transaction
// Once signed the listing data will be saved and the saved listing will be
// returned as the response
FAQs
Node.js library for OrdinalsBot API
The npm package ordinalsbot receives a total of 43 weekly downloads. As such, ordinalsbot popularity was classified as not popular.
We found that ordinalsbot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.