radix-meme-gateway v0.0.29
Radix Meme Gateway
This package provides a utility to fetch data relevant to the radix.meme app directly from the radix ledger by using public gateway APIs. The APIs are called using axios (not with the GatewayAPI SDK).
Usage
Instal
npm install radix-meme-gateway
Initialize Service
import {
createRadixMemeGateway,
Network,
} from "radix-meme-gateway";
// initialize service
const radixMemeGateway = createRadixMemeGateway(
Network.MAINNET,
"component_rdx1cq32tyxth5edlk5j3et0rzwxtr79pdr85c59jnjg5fxp3t4azajuld"
);
// Show config of an instance
console.log(radixMemeGateway.getConfig());
API endpoints
// Fetch all tokens
const tokens = await radixMemeGateway.getAllTokens();
// Fetch token from resource address
const token = await radixMemeGateway.getTokenFromResource(
"resource_rdx1th04p2c55884yytgj0e8nq79ze9wjnvu4rpg9d7nh3t698cxdt0cr9"
);
// EXAMPLE: Get current price and creator of the token
console.log({
price: token.lastPrice,
creatorAddress: token.creatorAddress,
});
REPL test environment
To test the gateway in a JS REPL, you can simply run:
npm run repl
You should see an interactive javascript REPL environment, where you can test the functions in realtime.
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
8 months ago
7 months ago
6 months ago
6 months ago
5 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago