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

@stove-labs/wxtz-sdk

v0.9.0-beta.0

Published

SDK for the wrapped XTZ project

Downloads

1

Readme

Delphinet Made with TypeScript License: MIT

Wrapped-XTZ SDK

This SDK for TypeScript and JavaScript enables you to interact with Tezos smart contracts of the Wrapped-XTZ project by StakerDAO.

🚧 This software is still under development and not released. 🚧

git clone https://github.com/stove-labs/wrapped-xtz-sdk folder-name
cd folder-name
npm install
npm run build

Quickstart 🪄

Import

TypeScript

import { WXTZSDK, NetworkType } from 'wxtz-sdk';
import { InMemorySigner } from '@taquito/signer';
import { TezosToolkit } from '@taquito/taquito';

const Tezos = new TezosToolkit('tezos rpc url');
Tezos.setProvider({
  signer: new InMemorySigner('signer secret key'),
});

const wXTZConfig = {
  tezos: Tezos,
  network: NetworkType.delphinet,
  indexerUrl: 'https://you.better-call.dev',
};

JavaScript

const { WXTZSDK, NetworkType } = require('wxtz-sdk');
const { InMemorySigner } = require('@taquito/signer');
const { TezosToolkit } = require('@taquito/taquito');

const Tezos = new TezosToolkit('tezos rpc url');
Tezos.setProvider({
  signer: new InMemorySigner('signer secret key'),
});

const wXTZConfig = {
  tezos: Tezos,
  network: NetworkType.delphinet,
  indexerUrl: 'https://you.better-call.dev',
};

Usage 🕹

Typescript

(async function () {
  // initialize SDK
  const wXTZ = await WXTZSDK.at('KT1coreAddress', wXTZConfig);
  // perform optional check
  const isValidContractCode = await wXTZ.checkContractCodeIntegrity();

  const createOvenContractMethod = await wXTZ.createOven('tz1aSkwEot3L2kmUvcoxzjMomb9mvBNuzFK6');
  const transactionOperation = await createOvenContractMethod.send();
  await transactionOperation.confirmation(1);

  // interact with oven
  const wXTZOven = await wXTZ.oven('KT1ovenAddress');
  await wXTZOven.initialize();
  // perform optional check
  const isValid = await wXTZOven.checkContractCodeIntegrity();

  // deposit
  const depositTxOperation = await (await wXTZOven.deposit()).send({
    amount: 100,
    mutez: true,
  });
  await depositTxOperation.confirmation(1);

  // withdraw
  const withdrawTxOperation = await (await wXTZOven.withdraw(100)).send();
  await withdrawTxOperation.confirmation(1);

  // set delegate
  const setDelegateTxOperation = await (await wXTZOven.setDelegate('tz1...')).send();
  await setDelegateTxOperation.confirmation(1);

  // remove delegate
  const removeDelegateTxOperation = await (await wXTZOven.setDelegate(null)).send();
  await removeDelegateTxOperation.confirmation(1);

  // get delegate
  const delegate = await wXTZOven.getDelegate();

  // get core address
  const coreAddress = await wXTZOven.getCoreAddress();

  // get oven details for date/time of origination and last action, block height of origination
  const ovenDetails = await wXTZOven.getDetails();
})();

API Reference

Checkout the complete TypeDoc API reference.

Tests 🧪

For running tests it is necessary to spin up a local Tezos sandbox node, migrating the test state and then executing the test runner. Make sure to have Docker running, node.js v12.x and jq installed.

npm run sandbox:start
npm run test:migrate
npm run test

License 📃

Wrapped-XTZ SDK is available under the MIT License.

Powered by