@0xsequence/provider 0.35.1 → 0.35.2
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/CHANGELOG.md +14 -0
- package/dist/0xsequence-provider.cjs.dev.js +2 -2
- package/dist/0xsequence-provider.cjs.prod.js +2 -2
- package/dist/0xsequence-provider.esm.js +2 -2
- package/dist/declarations/src/transports/window-transport/window-message-handler.d.ts +1 -1
- package/package.json +8 -8
- package/src/transports/window-transport/window-message-handler.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @0xsequence/provider
|
|
2
2
|
|
|
3
|
+
## 0.35.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- - provider: WindowMessageHandler accept optional windowHref
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @0xsequence/abi@0.35.2
|
|
10
|
+
- @0xsequence/auth@0.35.2
|
|
11
|
+
- @0xsequence/config@0.35.2
|
|
12
|
+
- @0xsequence/network@0.35.2
|
|
13
|
+
- @0xsequence/transactions@0.35.2
|
|
14
|
+
- @0xsequence/utils@0.35.2
|
|
15
|
+
- @0xsequence/wallet@0.35.2
|
|
16
|
+
|
|
3
17
|
## 0.35.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1583,7 +1583,7 @@ class WindowMessageHandler extends BaseWalletTransport {
|
|
|
1583
1583
|
this._init = exports.InitState.NIL;
|
|
1584
1584
|
}
|
|
1585
1585
|
|
|
1586
|
-
register() {
|
|
1586
|
+
register(windowHref) {
|
|
1587
1587
|
const isPopup = parent.window.opener !== null;
|
|
1588
1588
|
this._isPopup = isPopup;
|
|
1589
1589
|
|
|
@@ -1595,7 +1595,7 @@ class WindowMessageHandler extends BaseWalletTransport {
|
|
|
1595
1595
|
const {
|
|
1596
1596
|
pathname,
|
|
1597
1597
|
search: rawParams
|
|
1598
|
-
} = new URL(window.location.href);
|
|
1598
|
+
} = new URL(windowHref || window.location.href);
|
|
1599
1599
|
let session = this.getWindowTransportSession(rawParams); // provider should always include sid when opening a new window
|
|
1600
1600
|
|
|
1601
1601
|
const isNewWindowSession = !!session.sessionId; // attempt to restore previous session in the case of a redirect or window reload
|
|
@@ -1583,7 +1583,7 @@ class WindowMessageHandler extends BaseWalletTransport {
|
|
|
1583
1583
|
this._init = exports.InitState.NIL;
|
|
1584
1584
|
}
|
|
1585
1585
|
|
|
1586
|
-
register() {
|
|
1586
|
+
register(windowHref) {
|
|
1587
1587
|
const isPopup = parent.window.opener !== null;
|
|
1588
1588
|
this._isPopup = isPopup;
|
|
1589
1589
|
|
|
@@ -1595,7 +1595,7 @@ class WindowMessageHandler extends BaseWalletTransport {
|
|
|
1595
1595
|
const {
|
|
1596
1596
|
pathname,
|
|
1597
1597
|
search: rawParams
|
|
1598
|
-
} = new URL(window.location.href);
|
|
1598
|
+
} = new URL(windowHref || window.location.href);
|
|
1599
1599
|
let session = this.getWindowTransportSession(rawParams); // provider should always include sid when opening a new window
|
|
1600
1600
|
|
|
1601
1601
|
const isNewWindowSession = !!session.sessionId; // attempt to restore previous session in the case of a redirect or window reload
|
|
@@ -1579,7 +1579,7 @@ class WindowMessageHandler extends BaseWalletTransport {
|
|
|
1579
1579
|
this._init = InitState.NIL;
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
-
register() {
|
|
1582
|
+
register(windowHref) {
|
|
1583
1583
|
const isPopup = parent.window.opener !== null;
|
|
1584
1584
|
this._isPopup = isPopup;
|
|
1585
1585
|
|
|
@@ -1591,7 +1591,7 @@ class WindowMessageHandler extends BaseWalletTransport {
|
|
|
1591
1591
|
const {
|
|
1592
1592
|
pathname,
|
|
1593
1593
|
search: rawParams
|
|
1594
|
-
} = new URL(window.location.href);
|
|
1594
|
+
} = new URL(windowHref || window.location.href);
|
|
1595
1595
|
let session = this.getWindowTransportSession(rawParams); // provider should always include sid when opening a new window
|
|
1596
1596
|
|
|
1597
1597
|
const isNewWindowSession = !!session.sessionId; // attempt to restore previous session in the case of a redirect or window reload
|
|
@@ -5,7 +5,7 @@ export declare class WindowMessageHandler extends BaseWalletTransport {
|
|
|
5
5
|
protected parentWindow: Window;
|
|
6
6
|
private _isPopup;
|
|
7
7
|
constructor(walletRequestHandler: WalletRequestHandler);
|
|
8
|
-
register(): void;
|
|
8
|
+
register(windowHref?: any): void;
|
|
9
9
|
unregister(): void;
|
|
10
10
|
private onWindowEvent;
|
|
11
11
|
sendMessage(message: ProviderMessage<any>): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/provider",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.2",
|
|
4
4
|
"description": "provider sub-package for Sequence",
|
|
5
5
|
"repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"typecheck": "tsc --noEmit"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@0xsequence/abi": "^0.35.
|
|
17
|
-
"@0xsequence/auth": "^0.35.
|
|
18
|
-
"@0xsequence/config": "^0.35.
|
|
19
|
-
"@0xsequence/network": "^0.35.
|
|
20
|
-
"@0xsequence/transactions": "^0.35.
|
|
21
|
-
"@0xsequence/utils": "^0.35.
|
|
22
|
-
"@0xsequence/wallet": "^0.35.
|
|
16
|
+
"@0xsequence/abi": "^0.35.2",
|
|
17
|
+
"@0xsequence/auth": "^0.35.2",
|
|
18
|
+
"@0xsequence/config": "^0.35.2",
|
|
19
|
+
"@0xsequence/network": "^0.35.2",
|
|
20
|
+
"@0xsequence/transactions": "^0.35.2",
|
|
21
|
+
"@0xsequence/utils": "^0.35.2",
|
|
22
|
+
"@0xsequence/wallet": "^0.35.2",
|
|
23
23
|
"@ethersproject/abstract-signer": "^5.5.0",
|
|
24
24
|
"@ethersproject/hash": "^5.5.0",
|
|
25
25
|
"@ethersproject/providers": "^5.5.1",
|
|
@@ -22,7 +22,7 @@ export class WindowMessageHandler extends BaseWalletTransport {
|
|
|
22
22
|
this._init = InitState.NIL
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
register() {
|
|
25
|
+
register(windowHref?: any) {
|
|
26
26
|
const isPopup = parent.window.opener !== null
|
|
27
27
|
this._isPopup = isPopup
|
|
28
28
|
if (isPopup !== true) {
|
|
@@ -30,7 +30,7 @@ export class WindowMessageHandler extends BaseWalletTransport {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// record open details (sessionId + default network) from the window url
|
|
33
|
-
const { pathname, search: rawParams } = new URL(window.location.href)
|
|
33
|
+
const { pathname, search: rawParams } = new URL(windowHref || window.location.href)
|
|
34
34
|
|
|
35
35
|
let session: TransportSession | null = this.getWindowTransportSession(rawParams)
|
|
36
36
|
|