0.1.1 • Published 5 years ago

@openrelay/sra-element v0.1.1

Weekly downloads
1
License
LGPL-3.0
Repository
-
Last release
5 years ago

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
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.