npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

trident-sdk-js

v0.1.2

Published

Trident SDK

Downloads

2

Readme

Trident SDK JS

A simple SDK for Trident

Install

yarn add trident-sdk-js

or

npm install trident-sdk-js

Usage

import { Client } from "trident-sdk-js";
import keystore from "./keystore.json";
import { v4 as uuidv4 } from "uuid";

const client = new Client(keystore);

// MTG info
const info = await client.info();
console.log(info);

// collection
const collection = await client.collection(
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
);

// createCollection
const collection = await client.createCollection({
  name: "TEST collection",
  symbol: "TEST",
  description: "A test",
  split: "0.1",
  external_url: "https://xxx.xxx",
  icon_url: "", // optional, use url or base64
  icon_base64: "", // optional
});

// my collections

const collections = await client.collections();

// update collection
const collection = await client.updateCollection(
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  {
    description: "updated description",
  }
);

// NFO metadata
const collectible = await client.collectible(
  "0aa776ce1bea943f279ff5d47b89fd72b145b1e89cb094f8064ffc58af0e162e"
);

// update Metadata
const collectible = await client.updateMetadata({
  metadata: {},
  metahash: "0aa776ce1bea943f279ff5d47b89fd72b145b1e89cb094f8064ffc58af0e162e",
});

// deposit NFT
await client.deposit("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 1);

// withdraw NFT
await client.withdraw("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 1);

// transfer NFT
await client.transfer("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 1, {
  receivers: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],
  threshold: 1,
  memo: "Gift",
});

// get Orders
const orders = await client.orders();

// ask order
const order = await client.askOrder(
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // collection ID
  1, // Identifier
  {
    price: "0.11",
    asset_id: "31d2ea9c-95eb-3355-b65b-ba096853bc18",
    trace_id: uuidv4(),
    expired_at: Math.floor(Date.parse("2022-11-18") / 1000),
  }
);

// auction order
const order = await client.auctionOrder(
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // collection ID
  1, // Identifier
  {
    price: "0.11",
    reserve_price: "0.2",
    asset_id: "31d2ea9c-95eb-3355-b65b-ba096853bc18",
    trace_id: uuidv4(),
    expired_at: Math.floor(Date.parse("2022-11-18") / 1000),
  }
);

// bid order
const order = await client.bidOrder(
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // collection ID
  1, // Identifier
  {
    price: "0.11",
    asset_id: "31d2ea9c-95eb-3355-b65b-ba096853bc18",
    trace_id: uuidv4(),
    expired_at: Math.floor(Date.parse("2022-11-18") / 1000),
  }
);

// fill order
const order = await client.fillOrder(
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // collection ID
  1, // Identifier
  {
    price: "0.11",
    asset_id: "31d2ea9c-95eb-3355-b65b-ba096853bc18",
    order_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    trace_id: uuidv4(),
  }
);

// cancel order
const order = await client.cancelOrder(
  "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", // collection ID
  1, // Identifier
  {
    order_id: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    trace_id: uuidv4(),
  }
);