0.1.3 • Published 3 years ago

vue-relayone v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

vue-relayone

An unofficial Vue.js component for the RelayX Button.

Inspire from libitx's vue-money-button.

A Vue.js component that lets you integrate RelayX's payment system into your app or web page.

Installation

npm install vue-relayone --save-dev
# or
yarn add vue-relayone

Usage

<template>
  <div>
    <RelayX
      to="YOUR BITCOIN ADDRESS"
      amount="0.5"
      currency="USD"
      label="Send some loot"
      @payment="handlePayment"
    />
  </div>
</template>

<script>
import RelayX from 'vue-relayone'

export default {
  components: {
    RelayX
  },

  methods: {
    handlePayment(payment) {
      // handle payment
    }
  }
}
</script>

Properties

The following properties can be set on the component:

PropTypeDefault
toStringnull
amountString or Numbernull
editableBooleanfalse
currencyString'USD'
labelStringnull
successMessageStringnull
opReturnStringnull
outputsArray[]
clientIdentifierStringnull
buttonIdString or Numbernull
buttonDataString or Numbernull
typeString - buy or tip'buy'
devModeBooleanfalse
disabledBooleanfalse

An array of outputs can be set instead of the to, amount and currency properties. Each output output object has the following parameters:

NameTypeRequired
addressString
userIdString or Number
scriptString
amountString:heavy_check_mark:
currencyString:heavy_check_mark:

Events

The component emits the following events:

Event
loadTriggered on load
paymentTriggered on a successful payment
errorTriggered on a payment error
cryptoOperationsCallback returning the cryptoOperations object

License

vue-relayone is open source and released under the MIT License.

Copyright (c) 2020 ChainBow, inspire from libitx's vue money button.