@polkadot/extension-dapp 0.45.1 → 0.45.3
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/bundle-polkadot-extension-dapp.js +2 -2
- package/bundle.d.ts +2 -2
- package/bundle.js +2 -2
- package/cjs/bundle.js +9 -9
- package/cjs/detectOther.js +1 -1
- package/cjs/detectPackage.js +3 -3
- package/cjs/index.js +1 -1
- package/cjs/packageInfo.js +1 -1
- package/cjs/util.js +1 -1
- package/cjs/wrapBytes.js +1 -1
- package/detectOther.js +1 -1
- package/detectPackage.js +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +7 -6
- package/packageInfo.js +1 -1
- package/util.js +1 -1
- package/wrapBytes.js +1 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const packageInfo = { name: '@polkadot/extension-dapp', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href)) }) && (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href))) ? new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href))).pathname.substring(0, new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href))).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.45.
|
|
20
|
+
const packageInfo = { name: '@polkadot/extension-dapp', path: (({ url: (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href)) }) && (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href))) ? new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href))).pathname.substring(0, new URL((typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (document.currentScript && document.currentScript.src || new URL('bundle-polkadot-extension-dapp.js', document.baseURI).href))).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.45.3' };
|
|
21
21
|
|
|
22
22
|
const unwrapBytes = util.u8aUnwrapBytes;
|
|
23
23
|
const wrapBytes = util.u8aWrapBytes;
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
const list = await accounts.get();
|
|
111
111
|
return mapAccounts(source, filterAccounts(list, genesisHash, accountType), ss58Format);
|
|
112
112
|
}
|
|
113
|
-
catch
|
|
113
|
+
catch {
|
|
114
114
|
return [];
|
|
115
115
|
}
|
|
116
116
|
}));
|
package/bundle.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InjectedAccountWithMeta, InjectedExtension, InjectedProviderWithMeta, ProviderList, Unsubcall, Web3AccountsOptions } from '@polkadot/extension-inject/types';
|
|
2
|
-
export { packageInfo } from './packageInfo';
|
|
3
|
-
export { unwrapBytes, wrapBytes } from './wrapBytes';
|
|
2
|
+
export { packageInfo } from './packageInfo.js';
|
|
3
|
+
export { unwrapBytes, wrapBytes } from './wrapBytes.js';
|
|
4
4
|
declare let isWeb3Injected: boolean;
|
|
5
5
|
declare let web3EnablePromise: Promise<InjectedExtension[]> | null;
|
|
6
6
|
export { isWeb3Injected, web3EnablePromise };
|
package/bundle.js
CHANGED
|
@@ -116,7 +116,7 @@ export async function web3Accounts({ accountType, extensions, genesisHash, ss58F
|
|
|
116
116
|
const list = await accounts.get();
|
|
117
117
|
return mapAccounts(source, filterAccounts(list, genesisHash, accountType), ss58Format);
|
|
118
118
|
}
|
|
119
|
-
catch
|
|
119
|
+
catch {
|
|
120
120
|
// cannot handle this one
|
|
121
121
|
return [];
|
|
122
122
|
}
|
|
@@ -229,4 +229,4 @@ export async function web3UseRpcProvider(source, key) {
|
|
|
229
229
|
}
|
|
230
230
|
const meta = await provider.startProvider(key);
|
|
231
231
|
return { meta, provider };
|
|
232
|
-
}
|
|
232
|
+
}
|
package/cjs/bundle.js
CHANGED
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.web3UseRpcProvider = exports.web3ListRpcProviders = exports.web3FromAddress = exports.web3FromSource = exports.web3AccountsSubscribe = exports.web3Accounts = exports.web3Enable = exports.web3EnablePromise = exports.isWeb3Injected = exports.wrapBytes = exports.unwrapBytes = exports.packageInfo = void 0;
|
|
4
4
|
const util_1 = require("@polkadot/util");
|
|
5
5
|
const util_crypto_1 = require("@polkadot/util-crypto");
|
|
6
|
-
const
|
|
7
|
-
var
|
|
8
|
-
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return
|
|
9
|
-
var
|
|
10
|
-
Object.defineProperty(exports, "unwrapBytes", { enumerable: true, get: function () { return
|
|
11
|
-
Object.defineProperty(exports, "wrapBytes", { enumerable: true, get: function () { return
|
|
6
|
+
const util_js_1 = require("./util.js");
|
|
7
|
+
var packageInfo_js_1 = require("./packageInfo.js");
|
|
8
|
+
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
|
|
9
|
+
var wrapBytes_js_1 = require("./wrapBytes.js");
|
|
10
|
+
Object.defineProperty(exports, "unwrapBytes", { enumerable: true, get: function () { return wrapBytes_js_1.unwrapBytes; } });
|
|
11
|
+
Object.defineProperty(exports, "wrapBytes", { enumerable: true, get: function () { return wrapBytes_js_1.wrapBytes; } });
|
|
12
12
|
const win = window;
|
|
13
13
|
win.injectedWeb3 = win.injectedWeb3 || {};
|
|
14
14
|
let isWeb3Injected = web3IsInjected();
|
|
@@ -82,7 +82,7 @@ function web3Enable(originName, compatInits = []) {
|
|
|
82
82
|
const initCompat = compatInits.length
|
|
83
83
|
? Promise.all(compatInits.map((c) => c().catch(() => false)))
|
|
84
84
|
: Promise.resolve([true]);
|
|
85
|
-
exports.web3EnablePromise = web3EnablePromise = (0,
|
|
85
|
+
exports.web3EnablePromise = web3EnablePromise = (0, util_js_1.documentReadyPromise)(() => initCompat.then(() => getWindowExtensions(originName)
|
|
86
86
|
.then((values) => values.map((e) => {
|
|
87
87
|
// if we don't have an accounts subscriber, add a single-shot version
|
|
88
88
|
if (!e.accounts.subscribe) {
|
|
@@ -124,7 +124,7 @@ async function web3Accounts({ accountType, extensions, genesisHash, ss58Format }
|
|
|
124
124
|
const list = await accounts.get();
|
|
125
125
|
return mapAccounts(source, filterAccounts(list, genesisHash, accountType), ss58Format);
|
|
126
126
|
}
|
|
127
|
-
catch
|
|
127
|
+
catch {
|
|
128
128
|
// cannot handle this one
|
|
129
129
|
return [];
|
|
130
130
|
}
|
|
@@ -243,4 +243,4 @@ async function web3UseRpcProvider(source, key) {
|
|
|
243
243
|
const meta = await provider.startProvider(key);
|
|
244
244
|
return { meta, provider };
|
|
245
245
|
}
|
|
246
|
-
exports.web3UseRpcProvider = web3UseRpcProvider;
|
|
246
|
+
exports.web3UseRpcProvider = web3UseRpcProvider;
|
package/cjs/detectOther.js
CHANGED
package/cjs/detectPackage.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const util_1 = require("@polkadot/util");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
(0, util_1.detectPackage)(
|
|
5
|
+
const detectOther_js_1 = tslib_1.__importDefault(require("./detectOther.js"));
|
|
6
|
+
const packageInfo_js_1 = require("./packageInfo.js");
|
|
7
|
+
(0, util_1.detectPackage)(packageInfo_js_1.packageInfo, null, detectOther_js_1.default);
|
package/cjs/index.js
CHANGED
package/cjs/packageInfo.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.packageInfo = void 0;
|
|
4
|
-
exports.packageInfo = { name: '@polkadot/extension-dapp', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '0.45.
|
|
4
|
+
exports.packageInfo = { name: '@polkadot/extension-dapp', path: typeof __dirname === 'string' ? __dirname : 'auto', type: 'cjs', version: '0.45.3' };
|
package/cjs/util.js
CHANGED
package/cjs/wrapBytes.js
CHANGED
package/detectOther.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { packageInfo as injectInfo } from '@polkadot/extension-inject/packageInfo';
|
|
2
|
-
export default [injectInfo];
|
|
2
|
+
export default [injectInfo];
|
package/detectPackage.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './bundle';
|
|
1
|
+
export * from './bundle.js';
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './bundle.js';
|
|
1
|
+
export * from './bundle.js';
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Jaco Greeff <jacogr@gmail.com>",
|
|
3
3
|
"bugs": "https://github.com/polkadot-js/extension/issues",
|
|
4
|
-
"contributors": [],
|
|
5
4
|
"description": "Provides an interfaces around the injected globals for ease of access by dapp developers.",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=14"
|
|
7
|
+
},
|
|
6
8
|
"homepage": "https://github.com/polkadot-js/extension/tree/master/packages/extension-dapp#readme",
|
|
7
9
|
"license": "Apache-2.0",
|
|
8
|
-
"maintainers": [],
|
|
9
10
|
"name": "@polkadot/extension-dapp",
|
|
10
11
|
"repository": {
|
|
11
12
|
"directory": "packages/extension-dapp",
|
|
@@ -17,7 +18,7 @@
|
|
|
17
18
|
"./cjs/detectPackage.js"
|
|
18
19
|
],
|
|
19
20
|
"type": "module",
|
|
20
|
-
"version": "0.45.
|
|
21
|
+
"version": "0.45.3",
|
|
21
22
|
"main": "./cjs/index.js",
|
|
22
23
|
"module": "./index.js",
|
|
23
24
|
"types": "./index.d.ts",
|
|
@@ -70,9 +71,9 @@
|
|
|
70
71
|
}
|
|
71
72
|
},
|
|
72
73
|
"dependencies": {
|
|
73
|
-
"@polkadot/extension-inject": "^0.45.
|
|
74
|
-
"@polkadot/util": "^11.
|
|
75
|
-
"@polkadot/util-crypto": "^11.
|
|
74
|
+
"@polkadot/extension-inject": "^0.45.3",
|
|
75
|
+
"@polkadot/util": "^11.1.1",
|
|
76
|
+
"@polkadot/util-crypto": "^11.1.1",
|
|
76
77
|
"tslib": "^2.5.0"
|
|
77
78
|
},
|
|
78
79
|
"peerDependencies": {
|
package/packageInfo.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const packageInfo = { name: '@polkadot/extension-dapp', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.45.
|
|
1
|
+
export const packageInfo = { name: '@polkadot/extension-dapp', path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto', type: 'esm', version: '0.45.3' };
|
package/util.js
CHANGED
package/wrapBytes.js
CHANGED