@shardlabs/kusama-tips-widget

1.0.23 • Public • Published

Kusama Tips Widget

Install

Using CDN: Add the following script to the end of your <head> section.

<script src="https://unpkg.com/@shardlabs/kusama-tips-widget@latest/dist/bundle.min.js"></script>

Usage

Binding the widget:

kusamaTipsWidget.bind(target, options)

Minimal example:

<script>
  kusamaTipsWidget.bind(document.body, {
    beneficiary: "5EhR5PRsX...",
  });
</script>

Use custom button element:

<script>
  kusamaTipsWidget.bind(document.body, {
    beneficiary: "5EhR5PRsX...",
    element: document.getElementById("my-button"),
  });
</script>

You can disable proposals by passing allowProposing: false to the options object:

<script>
  kusamaTipsWidget.bind(document.body, {
    beneficiary: "5EhR5PRsX...",
    buttonText: "Donate KSM",
    allowProposing: false,
  });
</script>

Options

Property Description Required Default
beneficiary The account to be credited with the assets. Use your substrate address here. Yes -
element A custom DOM element on which a click handler will be registered. No -
buttonText A custom text for the button if the default value does not fit your use case. No Kusama Tips
allowProposing A flag to control tip proposing. This flag can be set to false in cases where tip proposing is not desired or should not be allowed. Tip proposing is allowed by default. No true

Package Sidebar

Install

npm i @shardlabs/kusama-tips-widget

Weekly Downloads

9

Version

1.0.23

License

Apache-2.0

Unpacked Size

1.12 MB

Total Files

4

Last publish

Collaborators

  • boto_shardlabs
  • fabijanc
  • edi_shard_labs
  • jakic007