@onekeyfe/cross-inpage-provider-injected 2.2.61 → 2.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/stubs/__tests__/stubs.test.js +48 -0
- package/dist/injected/desktop.bundle-report.html +2 -2
- package/dist/injected/extension-and-native.bundle-report.html +2 -2
- package/dist/injected/injectedDesktop.js +1 -1
- package/dist/injected/injectedDesktop.js.LICENSE.txt +6 -0
- package/dist/injected/injectedExtension.js +1 -1
- package/dist/injected/injectedExtension.js.LICENSE.txt +5 -1
- package/dist/injected/injectedNative.js +1 -1
- package/dist/injected/injectedNative.js.LICENSE.txt +5 -1
- package/dist/stubs/__tests__/stubs.test.d.ts +0 -0
- package/dist/stubs/__tests__/stubs.test.js +48 -0
- package/package.json +11 -8
|
@@ -5,12 +5,16 @@
|
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
/*!
|
|
8
|
+
/*! MIT License. Copyright 2015-2022 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */
|
|
9
9
|
|
|
10
10
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
11
11
|
|
|
12
12
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
13
13
|
|
|
14
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
15
|
+
|
|
16
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
17
|
+
|
|
14
18
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
15
19
|
|
|
16
20
|
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access */
|
|
3
|
+
// Unit tests for webpack stub modules used to replace heavy dependencies
|
|
4
|
+
// in the injected bundle. These stubs must maintain API compatibility
|
|
5
|
+
// with the subset of functionality actually used at runtime.
|
|
6
|
+
describe('validator-stub', () => {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
8
|
+
const validator = require('../validator-stub');
|
|
9
|
+
describe('isURL', () => {
|
|
10
|
+
it('should accept valid HTTP/HTTPS URLs', () => {
|
|
11
|
+
expect(validator.isURL('https://api.trongrid.io')).toBe(true);
|
|
12
|
+
expect(validator.isURL('http://localhost:8090')).toBe(true);
|
|
13
|
+
expect(validator.isURL('https://node.mainnet.alephium.org')).toBe(true);
|
|
14
|
+
});
|
|
15
|
+
it('should reject non-URL strings', () => {
|
|
16
|
+
expect(validator.isURL('not-a-url')).toBe(false);
|
|
17
|
+
expect(validator.isURL('')).toBe(false);
|
|
18
|
+
expect(validator.isURL('ftp://files.example.com')).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
it('should reject non-string input', () => {
|
|
21
|
+
expect(validator.isURL(null)).toBe(false);
|
|
22
|
+
expect(validator.isURL(undefined)).toBe(false);
|
|
23
|
+
expect(validator.isURL(123)).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
it('should respect custom protocols option', () => {
|
|
26
|
+
expect(validator.isURL('ftp://files.example.com', { protocols: ['ftp'] })).toBe(true);
|
|
27
|
+
expect(validator.isURL('https://example.com', { protocols: ['ftp'] })).toBe(false);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
describe('alephium-web3-stub', () => {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
33
|
+
const alph = require('../../../../providers/onekey-alph-provider/src/stubs/alephium-web3');
|
|
34
|
+
it('should export SignerProvider and InteractiveSignerProvider', () => {
|
|
35
|
+
expect(alph.SignerProvider).toBeDefined();
|
|
36
|
+
expect(alph.InteractiveSignerProvider).toBeDefined();
|
|
37
|
+
expect(alph.InteractiveSignerProvider.prototype).toBeInstanceOf(alph.SignerProvider);
|
|
38
|
+
});
|
|
39
|
+
it('should not export NodeProvider/ExplorerProvider (type-only imports, erased by TS)', () => {
|
|
40
|
+
expect(alph.NodeProvider).toBeUndefined();
|
|
41
|
+
expect(alph.ExplorerProvider).toBeUndefined();
|
|
42
|
+
});
|
|
43
|
+
it('should support duck-typing checks', () => {
|
|
44
|
+
const instance = new alph.InteractiveSignerProvider();
|
|
45
|
+
expect('getSelectedAccount' in instance).toBe(true);
|
|
46
|
+
expect('enable' in instance).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/cross-inpage-provider-injected",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.63",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"cross-inpage-provider"
|
|
6
6
|
],
|
|
@@ -46,12 +46,15 @@
|
|
|
46
46
|
"electron": "*"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"@onekeyfe/
|
|
52
|
-
"@onekeyfe/
|
|
53
|
-
"@onekeyfe/
|
|
54
|
-
"@onekeyfe/
|
|
49
|
+
"@noble/curves": "1.8.0",
|
|
50
|
+
"@noble/hashes": "1.7.2",
|
|
51
|
+
"@onekeyfe/cross-inpage-provider-core": "2.2.63",
|
|
52
|
+
"@onekeyfe/cross-inpage-provider-types": "2.2.63",
|
|
53
|
+
"@onekeyfe/desktop-bridge-injected": "2.2.63",
|
|
54
|
+
"@onekeyfe/extension-bridge-injected": "2.2.63",
|
|
55
|
+
"@onekeyfe/inpage-providers-hub": "2.2.63",
|
|
56
|
+
"@onekeyfe/native-bridge-injected": "2.2.63",
|
|
57
|
+
"bignumber.js": "^9.1.2",
|
|
55
58
|
"buffer": "^6.0.3",
|
|
56
59
|
"cipher-base": "^1.0.6",
|
|
57
60
|
"crypto-browserify": "^3.12.0",
|
|
@@ -59,5 +62,5 @@
|
|
|
59
62
|
"pbkdf2": "^3.1.3",
|
|
60
63
|
"sha.js": "^2.4.12"
|
|
61
64
|
},
|
|
62
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "321fff7491b90508f1adb921307e01539a867152"
|
|
63
66
|
}
|