diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 00000000..5bd2938f
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,17 @@
+
+
+
+## Change Description
+
+
+
+## API Changes
+- [ ] API Changes
+
+
+
+
+## Documentation Additions
+- [ ] Documentation Additions
+
+
diff --git a/README.md b/README.md
index 50990f5f..f6182ea1 100644
--- a/README.md
+++ b/README.md
@@ -111,3 +111,5 @@ Open a browser at `localhost:3000` to see a running instance of the example.
## Important
See LICENSE for copyright and license terms. Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties or merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one. We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate.
+
+Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with this software.
diff --git a/__tests__/withUAL.js b/__tests__/withUAL.js
new file mode 100644
index 00000000..053ac8c5
--- /dev/null
+++ b/__tests__/withUAL.js
@@ -0,0 +1,46 @@
+import React from 'react'
+import { mount } from 'enzyme'
+
+import { withUAL } from '../src/components/provider/withUAL'
+
+const mockContext = 'testContext'
+jest.mock('../src/components/provider/UALContext', () => ({
+ UALContext: {
+ Consumer: ({ children }) => children(mockContext),
+ }
+}))
+
+describe('withUAL', () => {
+ let wrappedComponent
+ let component
+ let name
+
+ beforeEach(() => {
+ component = (props) => {
+ return
Hello, {props.name}
;
+ }
+ name = 'testName'
+ const WrappedComponent = withUAL(component)
+ wrappedComponent = mount()
+ })
+
+ it('sets the props', () => {
+ expect(wrappedComponent.prop('name')).toBe(name)
+ })
+
+ it('renders the wrapped component', () => {
+ expect(wrappedComponent.find(component)).toHaveLength(1)
+ })
+
+ fit('passes the context as the prop ual to the wrapped component', () => {
+ expect(wrappedComponent.find(component).prop('ual')).toBe(mockContext)
+ })
+
+ it('passes the props to the wrapped component', () => {
+ expect(wrappedComponent.find(component).prop('name')).toBe(name)
+ })
+
+ it('renders the props in the wrapped component', () => {
+ expect(wrappedComponent.text()).toEqual(`Hello, ${name}`)
+ })
+})
diff --git a/examples/README.md b/examples/README.md
index 8e64c9ff..0ff1a289 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -57,3 +57,5 @@ Navigate to http://localhost:3000 to see the example application
## Important
See LICENSE for copyright and license terms. Block.one makes its contribution on a voluntary basis as a member of the EOSIO community and is not responsible for ensuring the overall performance of the software or any related applications. We make no representation, warranty, guarantee or undertaking in respect of the software or any related documentation, whether expressed or implied, including but not limited to the warranties or merchantability, fitness for a particular purpose and noninfringement. In no event shall we be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or documentation or the use or other dealings in the software or documentation. Any test results or performance figures are indicative and will not reflect performance under all conditions. Any reference to any third party or third-party product, service or other resource is not an endorsement or recommendation by Block.one. We are not responsible, and disclaim any and all responsibility and liability, for your use of or reliance on any of these resources. Third-party resources may be updated, changed or terminated at any time, so the information here may be out of date or inaccurate.
+
+Wallets and related components are complex software that require the highest levels of security. If incorrectly built or used, they may compromise users’ private keys and digital assets. Wallet applications and related components should undergo thorough security evaluations before being used. Only experienced developers should work with this software.
diff --git a/examples/package.json b/examples/package.json
index d2c26c57..1a4c4584 100644
--- a/examples/package.json
+++ b/examples/package.json
@@ -47,9 +47,9 @@
"prop-types": "^15.6.2",
"react": "^16.6.3",
"react-dom": "^16.6.3",
+ "ual-ledger": "^0.1.1",
"ual-lynx": "^0.1.0",
- "ual-reactjs-renderer": "^0.1.0",
- "ual-scatter": "^0.1.0",
- "ual-ledger": "0.1.0"
+ "ual-reactjs-renderer": "^0.1.2",
+ "ual-scatter": "^0.1.1"
}
}
diff --git a/examples/src/ButtonWebViewReact.tsx b/examples/src/ButtonWebViewReact.tsx
index 92baa516..28ee3345 100644
--- a/examples/src/ButtonWebViewReact.tsx
+++ b/examples/src/ButtonWebViewReact.tsx
@@ -66,7 +66,7 @@ class TransactionApp extends React.Component
super(props)
this.state = {
...defaultState,
- rpc: new JsonRpc(`${EXAMPLE_ENV.RPC_PROTOCOL}://${EXAMPLE_ENV.RPC_HOST}`)
+ rpc: new JsonRpc(`${EXAMPLE_ENV.RPC_PROTOCOL}://${EXAMPLE_ENV.RPC_HOST}:${EXAMPLE_ENV.RPC_PORT}`)
}
this.updateAccountBalance = this.updateAccountBalance.bind(this)
this.updateAccountName = this.updateAccountName.bind(this)
diff --git a/examples/yarn.lock b/examples/yarn.lock
index 2bb863cc..618b4c08 100644
--- a/examples/yarn.lock
+++ b/examples/yarn.lock
@@ -1235,11 +1235,6 @@
"@ledgerhq/errors" "^4.48.0"
events "^3.0.0"
-"@types/jest@^23.3.1":
- version "23.3.14"
- resolved "https://registry.yarnpkg.com/@types/jest/-/jest-23.3.14.tgz#37daaf78069e7948520474c87b80092ea912520a"
- integrity sha512-Q5hTcfdudEL2yOmluA1zaSyPbzWPmJ3XfSWeP3RyoYvS9hnje1ZyagrZOuQ6+1nQC1Gw+7gap3pLNL3xL6UBug==
-
"@types/react@15.0.4":
version "15.0.4"
resolved "https://registry.yarnpkg.com/@types/react/-/react-15.0.4.tgz#97aedbba00448a137331aa8450232124aeb8d426"
@@ -3532,7 +3527,7 @@ eos-lynx@1.1.3:
bluebird "^3.5.2"
socket.io-client "^2.1.1"
-eosjs-ecc@4.0.4, eosjs-ecc@^4.0.1:
+eosjs-ecc@4.0.4:
version "4.0.4"
resolved "https://registry.yarnpkg.com/eosjs-ecc/-/eosjs-ecc-4.0.4.tgz#431450f30a6f73088ff5d7ba1ebdfe967a5ca4ab"
integrity sha512-9wAYefts4TidHOu+eN9nAisZdWpUzlUimZrB63oP7+/s4xRNJEn2Vvep2ICRODpxpidbshM1L7WaSYW9oiV5gA==
@@ -3571,16 +3566,6 @@ eosjs@20.0.0, eosjs@^20.0.0:
eosjs-ecc "4.0.4"
text-encoding "0.7.0"
-eosjs@20.0.0-beta2:
- version "20.0.0-beta2"
- resolved "https://registry.yarnpkg.com/eosjs/-/eosjs-20.0.0-beta2.tgz#026255a13fefeb4d46a98b0c55de7b972de661c0"
- integrity sha512-CtlM3Cy8Fh3sKik5h8of66Tj1zALlU48xQJB25HJ1DLUm58f9z2jPCZ0hfkOcCXMsRIxZu01NpPufN08qZjFnQ==
- dependencies:
- "@types/jest" "^23.3.1"
- babel-polyfill "^6.26.0"
- eosjs-ecc "^4.0.1"
- text-encoding "^0.6.4"
-
errno@^0.1.3, errno@~0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.7.tgz#4684d71779ad39af177e3f007996f7c67c852618"
@@ -6850,10 +6835,10 @@ sax@^1.2.4:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
-scatterjs-core@2.5.0:
- version "2.5.0"
- resolved "https://registry.yarnpkg.com/scatterjs-core/-/scatterjs-core-2.5.0.tgz#e23d1d40bebeb861c4375a7427392b3cb795dca1"
- integrity sha512-Senfn+cihffudC7/katFr5fs4QayOgHKjlgmBJM9cBnESA+JO2wWgJ72LY9LwyJNHnepe3smf0Xjgo4XUAn00Q==
+scatterjs-core@2.7.17:
+ version "2.7.17"
+ resolved "https://registry.yarnpkg.com/scatterjs-core/-/scatterjs-core-2.7.17.tgz#f889e9d3bf1ba2003fc0411ad838fbfe42ed11fb"
+ integrity sha512-LKvg7nr2ViZgNyw7dzk5CbwDVz006PBFpJqKU1dx7fmMs9LmBov7gB60DFwLR9p3kirPWO2hon1TE/xe51pkFw==
dependencies:
create-hash "^1.2.0"
es6-promise "^4.2.4"
@@ -6861,7 +6846,7 @@ scatterjs-core@2.5.0:
isomorphic-ws "^4.0.1"
ws "^6.1.0"
-scatterjs-plugin-eosjs2@^1.2.0:
+scatterjs-plugin-eosjs2@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/scatterjs-plugin-eosjs2/-/scatterjs-plugin-eosjs2-1.5.0.tgz#4e8e08859c82af7b9c0b275ea57c9739a373cc18"
integrity sha512-RIYGW+c4dH//jwcAflcnI2N+erzy2AHQwfqMr8CTMCRg2S8Drm/PWf/iDn1JHsjbyTv1+kIP335zWz7xP92iAQ==
@@ -7456,11 +7441,6 @@ text-encoding@0.7.0:
resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.7.0.tgz#f895e836e45990624086601798ea98e8f36ee643"
integrity sha512-oJQ3f1hrOnbRLOcwKz0Liq2IcrvDeZRHXhd9RgLrsT+DjWY/nty1Hi7v3dtkaEYbPYe0mUoOfzRrMwfXXwgPUA==
-text-encoding@^0.6.4:
- version "0.6.4"
- resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19"
- integrity sha1-45mpgiV6J22uQou5KEXLcb3CbRk=
-
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
@@ -7605,10 +7585,10 @@ u2f-api@0.2.7:
resolved "https://registry.yarnpkg.com/u2f-api/-/u2f-api-0.2.7.tgz#17bf196b242f6bf72353d9858e6a7566cc192720"
integrity sha512-fqLNg8vpvLOD5J/z4B6wpPg4Lvowz1nJ9xdHcCzdUPKcFE/qNCceV2gNZxSJd5vhAZemHr/K/hbzVA0zxB5mkg==
-ual-ledger@0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/ual-ledger/-/ual-ledger-0.1.0.tgz#666a678e68e95b62dc1eef641e6f1cd6e4c9dac2"
- integrity sha512-fL2bSrejoLEGA0z/FeFneRHpSCQuXfl29xmTmR/daeThWC1TfNeW1FENts5CT6msk8md9JKQl9KtxhYShaN6Og==
+ual-ledger@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/ual-ledger/-/ual-ledger-0.1.1.tgz#b9800ca81174e34489b3f3826ccc2fe1a834a2af"
+ integrity sha512-o3bCGVtfi67VeTiMrkvSRfk8gWcV1cnMYVbKPykf38kAO74ou+LlOB9Q0hScSQWlH2nM0cheLSv71gHnBnydLA==
dependencies:
eosjs "20.0.0"
eosjs-ledger-signature-provider "0.1.1"
@@ -7624,10 +7604,10 @@ ual-lynx@^0.1.0:
eosjs "^20.0.0"
universal-authenticator-library "^0.1.0"
-ual-reactjs-renderer@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/ual-reactjs-renderer/-/ual-reactjs-renderer-0.1.0.tgz#0c61e59d2af8e1695b5f16ec97fad505981f57f4"
- integrity sha512-QwUuRFBvJZRpJ5nyZ43607OviKBaSh0OD4FERMB2il0UHM6B+EfTHreAVVl2T5gPn+EbFO0WoPkl9TKVWyPJlg==
+ual-reactjs-renderer@^0.1.2:
+ version "0.1.2"
+ resolved "https://registry.yarnpkg.com/ual-reactjs-renderer/-/ual-reactjs-renderer-0.1.2.tgz#4648208be772fbef9841128824a344e5a46dfdc4"
+ integrity sha512-xeHncHz07IQCraz1cvTDuxs9MMsUeXkFTBCQA4dHhyrBO/LRd+R0OnS2hOpycLI9pG4vkKZeVFZzKutlG/z/Xg==
dependencies:
i18next "^14.0.1"
i18next-browser-languagedetector "^2.2.4"
@@ -7639,15 +7619,15 @@ ual-reactjs-renderer@^0.1.0:
styled-components "^4.1.3"
universal-authenticator-library "^0.1.0"
-ual-scatter@^0.1.0:
- version "0.1.0"
- resolved "https://registry.yarnpkg.com/ual-scatter/-/ual-scatter-0.1.0.tgz#9a197aa27aad1d861a061a927620bda1077a4797"
- integrity sha512-yXJ6shHN3NQmdcmCI0sZcrEOV4lyykQExfQaual1NpFqDKJnWI6EfKZrgsbtGaOTpQV9F4jK5Nsev8BY3/l3Zw==
+ual-scatter@^0.1.1:
+ version "0.1.1"
+ resolved "https://registry.yarnpkg.com/ual-scatter/-/ual-scatter-0.1.1.tgz#f789ad786ee9fc2ba747029a182ed63587028b28"
+ integrity sha512-gcQrQdleQSYlPrZcxzU8DVJQReqLO2v1zoOpMspCMCdb0MZF2zIT2Gzp7udrbO1U+5s/no8YVzKnMtjCPEepzw==
dependencies:
- eosjs "20.0.0-beta2"
+ eosjs "20.0.0"
eosjs-ecc "4.0.4"
- scatterjs-core "2.5.0"
- scatterjs-plugin-eosjs2 "^1.2.0"
+ scatterjs-core "2.7.17"
+ scatterjs-plugin-eosjs2 "^1.5.0"
universal-authenticator-library "0.1.0"
uglify-js@3.4.x:
diff --git a/package.json b/package.json
index 307f129c..c9de1d93 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "ual-reactjs-renderer",
- "version": "0.1.1",
+ "version": "0.1.2",
"main": "dist/index.js",
"author": {
"name": "block.one",
diff --git a/src/components/modal/UALBox.js b/src/components/modal/UALBox.js
index b1a157c5..f443df25 100644
--- a/src/components/modal/UALBox.js
+++ b/src/components/modal/UALBox.js
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types'
import i18n from '../../i18n'
import { UALContainer } from './UALContainer'
-import { withUAL } from '../provider/UALContext'
+import { withUAL } from '../provider/withUAL'
import { UALBoxParts } from './UALBoxParts'
import { box } from '../../styles/box'
diff --git a/src/components/provider/UALContext.js b/src/components/provider/UALContext.js
index cf8bfd27..10dfe302 100644
--- a/src/components/provider/UALContext.js
+++ b/src/components/provider/UALContext.js
@@ -1,18 +1,3 @@
import React from 'react'
export const UALContext = React.createContext()
-/**
- * @type {function}
- * @name withUAL
- * @desc Function for making a component a consumer of the UAL context
- */
-export const withUAL = WrappedComponent => props => {
- const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'
- const WithUAL = props => (
-
- {context => }
-
- )
- WithUAL.displayName = `withUAL(${displayName})`
- return
-}
diff --git a/src/components/provider/withUAL.js b/src/components/provider/withUAL.js
new file mode 100644
index 00000000..bece854b
--- /dev/null
+++ b/src/components/provider/withUAL.js
@@ -0,0 +1,19 @@
+import React from 'react'
+
+import { UALContext } from './UALContext'
+
+/**
+ * @type {function}
+ * @name withUAL
+ * @desc Function for making a component a consumer of the UAL context
+ */
+export const withUAL = WrappedComponent => props => {
+ const displayName = WrappedComponent.displayName || WrappedComponent.name || 'Component'
+ const WithUAL = props => (
+
+ { context => }
+
+ )
+ WithUAL.displayName = `withUAL(${displayName})`
+ return
+}
diff --git a/src/index.js b/src/index.js
index a07112ba..eac47d49 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,3 +1,4 @@
export { UALBox } from './components/modal/UALBox'
-export { withUAL, UALContext } from './components/provider/UALContext'
+export { UALContext } from './components/provider/UALContext'
+export { withUAL } from './components/provider/withUAL'
export { UALProvider } from './components/provider/UALProvider'