@openrelay/sra-fee-element
v0.1.1
Published
A lit-element that lets the user select a fee
Downloads
1
Readme
layout: widget title: "SRA Fees" date: 2018-09-26 09:00:00 -0500 categories: widgets package: sra-fee-element code: html: |
<or-sra sra="#SRA_ENDPOINT#" feeRecipient="#FEE_RECIPIENT_ADDRESS#">
<or-sra-fee></or-sra-fee>
</or-sra>
npm: "@openrelay/sra-fee-element"
The <or-sra-fee>
element provides a slider to enable the user to allocate
fees between the maker and the taker. OpenRelay allows makers to allocate fees
between the maker and the taker, so long as the total fee adds up to the
specified fees. If you are using this widget library with a different Relayer,
make sure you understand their requirements with respect to fee allocation.
API
HTML Attributes
totalFee
[default=provided by relayer] — By default, the fee widget will query the relayer to get the totalFee required. Applications can set this value higher than the relayer specifies, but not lower.makerAssetAddress
— Relayers may adjust the required fee based on the asset being traded. Specify the maker token address for more accurate fee requirements.takerAssetAddress
— Relayers may adjust the required fee based on the asset being traded. Specify the taker token address for more accurate fee requirements.account
[default=web3.eth.accounts[0]] — The maker account associated with these fees. By default, it will be the account associated with the web3 object, but that can be overridden.disabled
[default=false] — Prevents the user from changing the value.
JavaScript Properties
value
— The percentage of the fee to be paid by the taker, as an integer between 0 and 100.makerFee
— ABigNumber
indicating the number of base units of ZRX to be paid by the maker.takerFee
— ABigNumber
indicating the number of base units of ZRX to be paid by the taker.
Events
Outgoing Events
change
— Fired when the user changes the token. Theevent.details
object includes:- feeRecipient: The fee recipient address to be used for the order
- makerFee: A
BigNumber
indicating the number of base units of ZRX to be paid by the maker. - takerFee: A
BigNumber
indicating the number of base units of ZRX to be paid by the taker.