brainblocks
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -58,4 +58,4 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
} | ||
if (!payment.destination.match(/^xrb_[a-z0-9]{60}$/)) { | ||
throw new Error('Invalid raiblocks address: ' + payment.destination); | ||
if (!payment.destination.match(/((?:xrb_[13][a-km-zA-HJ-NP-Z0-9]{59})|(?:nano_[13][a-km-zA-HJ-NP-Z0-9]{59}))/)) { | ||
throw new Error('Invalid nano address: ' + payment.destination); | ||
} | ||
@@ -84,2 +84,7 @@ | ||
onToken: { | ||
type: 'function', | ||
required: false | ||
}, | ||
onPayment: { | ||
@@ -86,0 +91,0 @@ type: 'function', |
@@ -29,3 +29,3 @@ | ||
null, | ||
'\n .brainblocks-button {\n display: inline-block;\n width: 100%;\n height: 50px;\n background-color: #eee;\n border-radius: 5px;\n font-family: Helvetica, Arial, sans-serif;\n line-height: 50px;\n color: #1A3238;\n cursor: pointer;\n font-size: 16px;\n text-align: center;\n letter-spacing: 1px;\n }\n \n .brainblocks-button-content {\n width: 100%;\n height: 50px;\n\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n }\n\n .brainblocks-button .brainblocks-raiblocks-logo {\n height: 15px;\n margin-left: 10px;\n border-left: 1px solid #ccc;\n padding-left: 10px;\n }\n\n .brainblocks-button .brainblocks-raiblocks-logo-small {\n height: 15px;\n margin-left: 5px;\n border-left: 1px solid #ccc;\n padding-left: 5px;\n display: none;\n }\n\n @media screen and (max-width: 299px) {\n .brainblocks-button .pay-text {\n display: none;\n }\n }\n\n @media screen and (max-width: 200px) {\n .brainblocks-button .brainblocks-raiblocks-logo {\n display: none;\n }\n\n .brainblocks-button .brainblocks-raiblocks-logo-small {\n display: inline-block;\n }\n }\n ' | ||
'\n .brainblocks-button {\n display: inline-block;\n width: 100%;\n height: 50px;\n background-color: #eee;\n border-radius: 5px;\n font-family: Helvetica, Arial, sans-serif;\n line-height: 50px;\n color: #1A3238;\n cursor: pointer;\n font-size: 16px;\n text-align: center;\n letter-spacing: 1px;\n }\n \n .brainblocks-button-content {\n width: 100%;\n height: 50px;\n\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n }\n\n .brainblocks-button .brainblocks-logo {\n height: 20px;\n margin-right: 10px;\n border-right: 1px solid #ccc;\n padding-right: 10px;\n vertical-align: middle;\n }\n\n .brainblocks-button .brainblocks-raiblocks-logo {\n height: 10px;\n margin-left: 10px;\n border-left: 1px solid #ccc;\n padding: 5px 0 5px 10px;\n }\n\n .brainblocks-button .brainblocks-raiblocks-logo-small {\n height: 10px;\n margin-left: 5px;\n border-left: 1px solid #ccc;\n padding: 5px 0 5px 5px;\n display: none;\n }\n\n @media screen and (max-width: 299px) {\n .brainblocks-button .pay-text {\n display: none;\n }\n }\n\n @media screen and (max-width: 200px) {\n .brainblocks-button .brainblocks-raiblocks-logo {\n display: none;\n }\n\n .brainblocks-button .brainblocks-raiblocks-logo-small {\n display: inline-block;\n }\n }\n ' | ||
), | ||
@@ -41,2 +41,3 @@ jsxDom( | ||
null, | ||
jsxDom('img', { 'class': 'brainblocks-logo', src: 'https://brainblocks.io/static/img/brainblocks_logo.svg' }), | ||
jsxDom( | ||
@@ -43,0 +44,0 @@ 'span', |
@@ -1,1 +0,1 @@ | ||
export var SUPPORTED_CURRENCIES = ['aud', 'brl', 'cad', 'chf', 'clp', 'cny', 'czk', 'dkk', 'eur', 'gbp', 'hkd', 'huf', 'idr', 'ils', 'inr', 'jpy', 'krw', 'mxn', 'myr', 'nok', 'nzd', 'php', 'pkr', 'pln', 'rub', 'sek', 'sgd', 'thb', 'try', 'twd', 'usd', 'zar']; | ||
export var SUPPORTED_CURRENCIES = ['aud', 'brl', 'cad', 'chf', 'clp', 'cny', 'czk', 'dkk', 'eur', 'gbp', 'hkd', 'huf', 'idr', 'ils', 'inr', 'jpy', 'krw', 'mxn', 'myr', 'nok', 'nzd', 'php', 'pkr', 'pln', 'rub', 'sek', 'sgd', 'thb', 'try', 'twd', 'vnd', 'usd', 'zar']; |
{ | ||
"name": "brainblocks", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Javascript module template.", | ||
@@ -85,3 +85,3 @@ "main": "dist/brainblocks.js", | ||
"eslint-plugin-unicorn": "^2.1.2", | ||
"flow-bin": "0.56.0", | ||
"flow-bin": "^0.75.0", | ||
"flow-runtime": "^0.14.0", | ||
@@ -88,0 +88,0 @@ "flow-typed": "^2.2.0", |
@@ -5,6 +5,6 @@ ![logo](./img/brainblocks-logo.png) | ||
Simple raiblocks checkout | ||
Simple nano checkout | ||
``` | ||
<div id="raiblocks-button"></div> | ||
<div id="nano-button"></div> | ||
@@ -14,3 +14,3 @@ <script src="https://brainblocks.io/brainblocks.js"></script> | ||
<script> | ||
// Render the RaiBlocks button | ||
// Render the Nano button | ||
@@ -33,3 +33,3 @@ brainblocks.Button.render({ | ||
}, '#raiblocks-button'); | ||
}, '#nano-button'); | ||
</script> | ||
@@ -42,6 +42,12 @@ ``` | ||
{ | ||
"token": "ZXlKaGJHY...", | ||
"token": "ZXlKaGJHY...", | ||
"destination": "xrb_164xa...", | ||
"received": 1000 | ||
"currency": "rai", | ||
"amount": "1000", | ||
"amount_rai": 1000, | ||
"received_rai": 1000, | ||
"fulfilled": true, | ||
"send_block": "0B36663...", | ||
"sender": "xrb_1jnat..." | ||
} | ||
``` |
@@ -57,4 +57,4 @@ /* @flow */ | ||
} | ||
if (!payment.destination.match(/^xrb_[a-z0-9]{60}$/)) { | ||
throw new Error(`Invalid raiblocks address: ${ payment.destination }`); | ||
if (!payment.destination.match(/((?:xrb_[13][a-km-zA-HJ-NP-Z0-9]{59})|(?:nano_[13][a-km-zA-HJ-NP-Z0-9]{59}))/)) { | ||
throw new Error(`Invalid nano address: ${ payment.destination }`); | ||
} | ||
@@ -83,2 +83,7 @@ | ||
}, | ||
onToken: { | ||
type: 'function', | ||
required: false | ||
}, | ||
@@ -85,0 +90,0 @@ onPayment: { |
@@ -52,14 +52,22 @@ /* @flow */ | ||
.brainblocks-button .brainblocks-logo { | ||
height: 20px; | ||
margin-right: 10px; | ||
border-right: 1px solid #ccc; | ||
padding-right: 10px; | ||
vertical-align: middle; | ||
} | ||
.brainblocks-button .brainblocks-raiblocks-logo { | ||
height: 15px; | ||
height: 10px; | ||
margin-left: 10px; | ||
border-left: 1px solid #ccc; | ||
padding-left: 10px; | ||
padding: 5px 0 5px 10px; | ||
} | ||
.brainblocks-button .brainblocks-raiblocks-logo-small { | ||
height: 15px; | ||
height: 10px; | ||
margin-left: 5px; | ||
border-left: 1px solid #ccc; | ||
padding-left: 5px; | ||
padding: 5px 0 5px 5px; | ||
display: none; | ||
@@ -89,2 +97,3 @@ } | ||
<span> | ||
<img class="brainblocks-logo" src="https://brainblocks.io/static/img/brainblocks_logo.svg" /> | ||
<span class="pay-text">{ amount && 'Pay ' }</span> | ||
@@ -91,0 +100,0 @@ <span> |
@@ -34,4 +34,5 @@ /* @flow */ | ||
'twd', | ||
'vnd', | ||
'usd', | ||
'zar' | ||
]; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
798930
10131
50
24
4
80