0.0.29 • Published 5 months ago

radix-meme-gateway v0.0.29

Weekly downloads
-
License
ISC
Repository
github
Last release
5 months ago

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.

0.0.20

8 months ago

0.0.21

8 months ago

0.0.22

8 months ago

0.0.23

8 months ago

0.0.24

7 months ago

0.0.25

7 months ago

0.0.15

8 months ago

0.0.16

8 months ago

0.0.17

8 months ago

0.0.18

8 months ago

0.0.19

8 months ago

0.0.13

9 months ago

0.0.14

8 months ago

0.0.26

7 months ago

0.0.27

6 months ago

0.0.28

6 months ago

0.0.29

5 months ago

0.0.12

9 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago

0.0.0

9 months ago