0.1.1 • Published 5 years ago

@openrelay/sra-fee-element v0.1.1

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

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.accounts0] 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 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.
Events
Outgoing Events
  • change Fired when the user changes the token. The event.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.