@openrelay/sra-element
v0.1.1
Published
A lit-element tag for managing web3 and Standard Relayer API interactions
Downloads
3
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 attributee.detail.element
indicating the newly added element. The<or-sra>
element will respond with asra-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 usefeeRecipient
: The fee recipient address to use for new ordersexchangeAddress
: The exchange address to use for new ordersfeeTokenAddress
: The ZRX token address for this networkerc20ProxyAddress
: The ERC20 token transfer proxy for this exchangewethAddress
: The wrapped ether contract address for this networksepoch
: The epoch for the connected user.