Giter Club home page Giter Club logo

aion-gql-webcomponents's Introduction

Built With Stencil

Webcomponents using AION GraphQL

Demo

To use:

Add following in the tag (Will be fixed in future)

 <script>
    var global = global || window;
  </script>

Import aion-gql-webcomponents.js

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/aion-gql-webcomponents.js"></script>

OR

<script src="https://unpkg.com/[email protected]/dist/aion-gql-webcomponents.js"></script>

Webcomponents

  1. aion-blocks: Shows recent AION mainnet blocks
  2. aion-pay: Supports payment in AION coin

Use aion-blocks component

<aion-blocks limit={limit} duration="{polling time in sec}" gql-url={graphql_endpoint}></aion-blocks>

Example:

<aion-blocks limit="8" duration="10" gql-url="https://<host>/graphql"></aion-blocks>

Use aion-pay component

A webcomponent to support payment using AION coin. A sender account can be accessed by providing private key or AION keystore file.

If "to" property is mentioned, the payment can only be done to the mentioned address. To enable send to any address, don't provide "to" address in the tag.

Usage:

  1. Default button. Pay to a given address
<aion-pay to="to_address" gql-url="https://<aion-gql-host>/graphql"></aion-pay>
  1. To pay to any address, don't provide "to" property.
<aion-pay gql-url="https://<aion-gql-host>/graphql"></aion-pay>
  1. With a custom text but with aion icon on the button. Pay to a given address.
<aion-pay to="to_address" gql-url="https://<aion-gql-host>/graphql" button-text=[custom_text]></aion-pay>
  1. With a custom content in the pay button. It will override both default icon and text.
<aion-pay to="to_address" gql-url="https://<aion-gql-host>/graphql">[custom content]</aion-pay>

Examples:

<aion-pay to="0xa01112158d69a368dfebb9db63a903738cxxxxxxxxx" gql-url="http://localhost:8080/graphql"></aion-pay>
<aion-pay gql-url="http://localhost:8080/graphql"></aion-pay>
<aion-pay to="0xa01112158d69a368dfebb9db63a903738cxxxxxxxxx" gql-url="http://localhost:8080/graphql">Pay By AION</aion-pay>

Styles:

Aion Pay component also exposes few style variables which can be used to customize the style of the component. Example: button color, button font family etc.

--pay-button-color: <button_background_color>;
--pay-button-font-weight: <button font weight>;
--pay-button-font-family: <font family for the button text>;
--pay-button-font-style: <button font stye>;

Example:

<style type="text/css">
aion-pay {
  --pay-button-color: #BB86FC;
  --pay-button-font-weight: bolder;
  --pay-button-font-family: "Comic Sans MS", "Comic Sans", cursive;
  --pay-button-font-style: normal;
}
</style>

Development

git clone https://github.com/satran004/aion-gql-webcomponents.git
npm install

To run local dev server

npm start

To Build

npm run build

aion-gql-webcomponents's People

Contributors

satran004 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.