@coinjinja/coinview-sdk
Advanced tools
Comparing version 1.0.8-dev to 1.0.9-dev
@@ -147,3 +147,3 @@ 'use strict'; | ||
var _methods = ['user.profile', 'user.assets', 'user.address', 'payment.create', 'navigate.back', 'navigate.close', 'ui.notice', 'ui.confirm', 'utils.setClipboard', 'utils.screenshot', 'utils.share', 'utils.scanQR', 'utils._choosePhoto', 'utils._openUrl']; | ||
var _methods = ['user.profile', 'user.assets', 'user.address', 'user.signMessage', 'payment.create', 'navigate.back', 'navigate.close', 'ui.notice', 'ui.confirm', 'utils.setClipboard', 'utils.screenshot', 'utils.share', 'utils.scanQR', 'utils._choosePhoto', 'utils._openUrl']; | ||
@@ -150,0 +150,0 @@ _methods.forEach(register); |
@@ -1,1 +0,1 @@ | ||
var coinview=function(){"use strict";for(var n,a=(function(n){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var e=new Uint8Array(16);n.exports=function(){return r(e),e}}else{var t=new Array(16);n.exports=function(){for(var n,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),t[r]=n>>>((3&r)<<3)&255;return t}}}(n={exports:{}},n.exports),n.exports),o=[],r=0;r<256;++r)o[r]=(r+256).toString(16).substr(1);var u=function(n,r){var e=r||0,t=o;return[t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]]].join("")};var s=function(n,r,e){var t=r&&e||0;"string"==typeof n&&(r="binary"===n?new Array(16):null,n=null);var o=(n=n||{}).random||(n.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,r)for(var i=0;i<16;++i)r[t+i]=o[i];return r||u(o)},c={};function e(o,i){var a=0;return new Promise(function(e,t){function r(n,r){n?t(n):e(r)}!function n(){window.originalPostMessage?function(n,r,e){var t=s();c[t]=e;var o={method:n,uuid:t};r&&(o.payload=r),window.postMessage(JSON.stringify(o))}(o,i,r):3e3<a?t(new Error("Timeout")):(a+=10,setTimeout(n,10))}()})}function t(r){if("string"==typeof r)try{r=JSON.parse(r)}catch(n){return console.error("Invalid data:",r)}if(r.uuid){var n=c[r.uuid];n?(n(r.error,r.payload),delete c[r.uuid]):console.warn("Unregistered callback:",r.uuid)}else console.error("Invalid data:",r)}var i={send:e,receive:t,init:function(n){return window.document.addEventListener("message",function(n){t(n.data)}),n.$version="1.0",n.$url=location.href,e("app.init",n)}},f={},l=null,d=!1;f.init=function(n){return d?new Promise(function(n,r){n(f)}):i.init({appId:n}).then(function(n){return d=!0,l=n,f})},f.app=function(){if(!d)throw new Error('Please call after "coinview.init"');return new Promise(function(r,n){!function n(){l?r(l):setTimeout(n,10)}()})};var p=["user.profile","user.assets","user.address","payment.create","navigate.back","navigate.close","ui.notice","ui.confirm","utils.setClipboard","utils.screenshot","utils.share","utils.scanQR","utils._choosePhoto","utils._openUrl"];return p.forEach(function(r){var n=r.split("."),e=n[0],t=n[1];f[e]||(f[e]={}),f[e][t]=function(n){if(!d)throw new Error('Please call after "coinview.init"');return i.send(r,n)}}),f._methods=p,f}(); | ||
var coinview=function(){"use strict";for(var n,a=(function(n){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var e=new Uint8Array(16);n.exports=function(){return r(e),e}}else{var t=new Array(16);n.exports=function(){for(var n,r=0;r<16;r++)0==(3&r)&&(n=4294967296*Math.random()),t[r]=n>>>((3&r)<<3)&255;return t}}}(n={exports:{}},n.exports),n.exports),o=[],r=0;r<256;++r)o[r]=(r+256).toString(16).substr(1);var s=function(n,r){var e=r||0,t=o;return[t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],"-",t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]],t[n[e++]]].join("")};var u=function(n,r,e){var t=r&&e||0;"string"==typeof n&&(r="binary"===n?new Array(16):null,n=null);var o=(n=n||{}).random||(n.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,r)for(var i=0;i<16;++i)r[t+i]=o[i];return r||s(o)},c={};function e(o,i){var a=0;return new Promise(function(e,t){function r(n,r){n?t(n):e(r)}!function n(){window.originalPostMessage?function(n,r,e){var t=u();c[t]=e;var o={method:n,uuid:t};r&&(o.payload=r),window.postMessage(JSON.stringify(o))}(o,i,r):3e3<a?t(new Error("Timeout")):(a+=10,setTimeout(n,10))}()})}function t(r){if("string"==typeof r)try{r=JSON.parse(r)}catch(n){return console.error("Invalid data:",r)}if(r.uuid){var n=c[r.uuid];n?(n(r.error,r.payload),delete c[r.uuid]):console.warn("Unregistered callback:",r.uuid)}else console.error("Invalid data:",r)}var i={send:e,receive:t,init:function(n){return window.document.addEventListener("message",function(n){t(n.data)}),n.$version="1.0",n.$url=location.href,e("app.init",n)}},f={},l=null,d=!1;f.init=function(n){return d?new Promise(function(n,r){n(f)}):i.init({appId:n}).then(function(n){return d=!0,l=n,f})},f.app=function(){if(!d)throw new Error('Please call after "coinview.init"');return new Promise(function(r,n){!function n(){l?r(l):setTimeout(n,10)}()})};var p=["user.profile","user.assets","user.address","user.signMessage","payment.create","navigate.back","navigate.close","ui.notice","ui.confirm","utils.setClipboard","utils.screenshot","utils.share","utils.scanQR","utils._choosePhoto","utils._openUrl"];return p.forEach(function(r){var n=r.split("."),e=n[0],t=n[1];f[e]||(f[e]={}),f[e][t]=function(n){if(!d)throw new Error('Please call after "coinview.init"');return i.send(r,n)}}),f._methods=p,f}(); |
@@ -11,2 +11,3 @@ export as namespace Coinview | ||
export function address(assetId: string): Promise<UserAddress> | ||
export function signMessage(payload: SignMessagePayload): Promise<string> | ||
} | ||
@@ -95,1 +96,9 @@ | ||
} | ||
interface SignMessagePayload { | ||
method: string | ||
path: string | ||
content: string | ||
timestamp?: number | ||
expire: number | ||
} |
{ | ||
"name": "@coinjinja/coinview-sdk", | ||
"version": "1.0.8-dev", | ||
"version": "1.0.9-dev", | ||
"author": "coinjinja", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -10,3 +10,3 @@ # Coinview SDK | ||
``` | ||
https://unpkg.com/@coinjinja/coinview-sdk@1.0.7-dev/dist/coinview.min.js | ||
https://unpkg.com/@coinjinja/coinview-sdk@1.0.8-dev/dist/coinview.min.js | ||
``` | ||
@@ -35,3 +35,3 @@ | ||
```html | ||
<script src="https://unpkg.com/@coinjinja/coinview-sdk@1.0.7-dev/dist/coinview.min.js"></script> | ||
<script src="https://unpkg.com/@coinjinja/coinview-sdk@1.0.8-dev/dist/coinview.min.js"></script> | ||
``` | ||
@@ -38,0 +38,0 @@ |
@@ -5,2 +5,3 @@ export default [ | ||
'user.address', | ||
'user.signMessage', | ||
'payment.create', | ||
@@ -7,0 +8,0 @@ 'navigate.back', |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24369
432