Skip to content
BA Hackathon 2019 - TonicPow Embed Script
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Added funding configuration Jun 9, 2019
dist
images
src
.gitignore
LICENSE
PROTOCOL.md
README.md
example.html Minor fixes for examples Jun 19, 2019
favicon.ico
package-lock.json
package.json Added lint command Jul 1, 2019
webpack.config.js use webpack, separate concerns, bitsocket orchestrator pushes data to… May 8, 2019

README.md

TonicPow

View a Tonic in action. Checkout the Tonic protocol.

last commit version license standard-readme compliant slack app health

Table of Contents

Installation

  1. Add the script to your site.
<script src="https://tonicpow.com/tonic.js"></script>
  1. Replace data-address with your BSV address and place the tag wherever it will be displayed.
<div class="tonic" data-address="YOUR_ADDRESS"></div>

(Optional) Use your $handcash handle in place of your wallet address

<div class="tonic" data-handcash="$your-handle"></div>

(Optional) Use your RelayX 1handle in place of your wallet address

<div class="tonic" data-relayx="1your-handle"></div>

Building

$ npm install
$ npm run build

Documentation

Checkout our nifty Tonic generator.

This Tonic embed works in relation to the Tonic protocol.

Required attributes are one of the following: data-address or data-handcash or data-relayx

Attribute Example Supported Description
data-address 1BrwAE... Yes Your bitcoin sv wallet address.
data-handcash $tonicpow Yes Your $handcash handle. Used in place of data-address.
data-relayx 1tonicpow Yes Your RelayX 1handle. Used in place of data-address.
data-unit-id embed-1 Yes To show multiple units on one page, set each to a unique identifier of your choice.
data-rate 546 Yes Set the rate of sats per block. The default is 546.
data-currency bsv Not yet Set the currency rate (bsv or usd)
data-width 300 Yes Set a custom width. The default is 300px. Minimum is 160x
data-height 250 Yes Set a custom height. The default and minimum is 250px; There is an additional 22px footer.
data-image https://... Yes Default image url if no ad is present
data-url https://... Yes Default click url if no ad is present
data-link-color #FFF Yes Change the link color via CSS value (#007bff)
data-funding true Not yet Toggle funding campaigns, default is true (on)

Handcash Support

This Tonic embed script converts $handcash handles to wallet addresses on-the-fly when loading. You can supply a $handcash handle via data-handcash.

RelayX 1handle Support

This Tonic embed script converts RelayX 1handles to wallet addresses on-the-fly when loading. You can supply a 1handle handle via data-relayx.

Supported Browsers

TonicPow supports all commonly used browsers. Below is a list of popular browsers and their minimum supported version. If we're missing a browser, suggest one via an issue.

Browser Platform Min Version
Android Mobile 67.0
Bottle Desktop 0.1
Brave Desktop 55.0
Chrome Desktop 55.0
Chrome Mobile 74.0
Edge Desktop 17.0
Firefox Desktop 52.0
Firefox Mobile 67.0
IE Desktop ---
Opera Desktop 42.0
Opera Mobile ---
Safari Desktop 10.1
Safari Mobile 10.3

Bitcoin Sticker Protocol Support

Using the bitcoin sticker protocol, it ensures that any embed that is missing a data-address will use sticker address.

In the future this will be used for tipping, likes, sharing, etc.

Affiliates

If you share any url and append ?affiliate=$your-handle or ?affiliate=1your-handle the embed will process your handle and store it associated to all ads on the page.

If you don't have a $handcash handle or a 1handle you can provide your bsv wallet address ?affiliate=1BrwAE2qg6qBaB2n....

The affiliate/publisher relationship is stored in user's local session for future visits.

Examples

Demo Tonics

View the interactive live demo ads and more examples here

Affiliate

Replace $your-handle with your $handcash handle or your 1handle or bsv wallet address and share! Receive a payment if an Ad is purchased using your affiliate link. Any website that uses TonicPow supports the $handcash affiliate functionality.

https://tonicpow.com/?affiliate=$your-handle

https://some-website.com/?affiliate=$your-handle 

https://some-website.com/?affiliate=1your-handle

https://some-website.com/?affiliate=1BrwAE2qg6qBaB2n...

Code Standards

  • Always use the language's best practices!

Usage

Maintainers

Attila - Satchmo - MrZ

Support the development of this project and the TonicPow team 🙏

Contributing

Feel free to dive in! Open an issue or submit PRs.

License

License

You can’t perform that action at this time.