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

@openrelay/sra-element

v0.1.1

Published

A lit-element tag for managing web3 and Standard Relayer API interactions

Downloads

14

Readme


layout: widget title: "SRA Element" date: 2018-09-26 08:40:00 -0500 categories: widgets package: sra-element code: html: |

<or-sra sra="#SRA_ENDPOINT#" feeRecipient="#FEE_RECIPIENT_ADDRESS#">
  Your content goes here
</or-sra>

npm: "@openrelay/sra-element"

The <or-sra> element extends the <or-web3> element with properties specific to 0x trading. The <or-sra> element includes all of the functionality of the <or-web3> tag, so you do not need both at the same time. Certain widgets will require an <or-sra> as an ancestor, but widgets that require an <or-web3> ancestor can have that need met by an <or-sra> ancestor.

The <or-sra> tag provides its children with information about the 0x Relayer and the 0x Exchange contract. Any time those properties change, they will be automatically propagated to their children.

API

HTML Attributes
  • sra [default=https://api.openrelay.xyz] — The Standard Relayer API endpoint.
  • feeRecipient [default=0xfaec02c3474b1a1c553eddf3df27946643cc7122] — The feeRecipient address to associcate with orders.
  • sender [default=0x0000000000000000000000000000000000000000] — The sender who must submit orders to be filled.
Events

See the <or-web3> element for additional events.

Incoming Events
  • sra-child — An event emitted when a child element is registered. The event must include an attribute e.detail.element indicating the newly added element. The <or-sra> element will respond with a sra-ready event, and will notify the registered element on future sra changes.
Outgoing Events

None of the following events are emitted directly from the <or-sra> tag. Instead, the <or-sra> tag triggers them directly on one or more registered child elements.

  • sra-ready — Fired when SRA details are confirmed and available. The event includes the following details:
    • sra: The standard relayer API endpoint to use
    • feeRecipient: The fee recipient address to use for new orders
    • exchangeAddress: The exchange address to use for new orders
    • feeTokenAddress: The ZRX token address for this network
    • erc20ProxyAddress: The ERC20 token transfer proxy for this exchange
    • wethAddress: The wrapped ether contract address for this networks
    • epoch: The epoch for the connected user.