@dynamic-labs/web-extension 4.0.0-alpha.26 → 4.0.0-alpha.27
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/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +7 -7
- package/src/lib/WebExtension/WebExtension.cjs +2 -0
- package/src/lib/WebExtension/WebExtension.js +2 -0
- package/src/lib/utils/setupPasskeyHandler/setupPasskeyHandler.cjs +2 -8
- package/src/lib/utils/setupPasskeyHandler/setupPasskeyHandler.js +3 -9
- package/src/lib/utils/setupTurnkeyIframeEventProxy/index.d.ts +1 -0
- package/src/lib/utils/setupTurnkeyIframeEventProxy/setupTurnkeyIframeEventProxy.cjs +24 -0
- package/src/lib/utils/setupTurnkeyIframeEventProxy/setupTurnkeyIframeEventProxy.d.ts +2 -0
- package/src/lib/utils/setupTurnkeyIframeEventProxy/setupTurnkeyIframeEventProxy.js +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.27](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.26...v4.0.0-alpha.27) (2024-11-06)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* allows adding connection configuration for solana connectors ([#7354](https://github.com/dynamic-labs/dynamic-auth/issues/7354)) ([01e35ee](https://github.com/dynamic-labs/dynamic-auth/commit/01e35ee5bfe4605df48e4188a753111efe483048))
|
|
8
|
+
* allows passing solana connection config to dynamic client ([#7357](https://github.com/dynamic-labs/dynamic-auth/issues/7357)) ([6da14ce](https://github.com/dynamic-labs/dynamic-auth/commit/6da14ceb481147aea31d192fe268be43a8af80e9))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* check legacy vs eip1599 tx in global connectivity ([#7341](https://github.com/dynamic-labs/dynamic-auth/issues/7341)) ([b223ea7](https://github.com/dynamic-labs/dynamic-auth/commit/b223ea7a5ed5637e11da1040c631c48bc23ba76d))
|
|
14
|
+
* global connectivity multiple transactions in a row ([#7342](https://github.com/dynamic-labs/dynamic-auth/issues/7342)) ([d13c1af](https://github.com/dynamic-labs/dynamic-auth/commit/d13c1afec6b3680961621d8317f55549b3ed428f))
|
|
15
|
+
|
|
2
16
|
## [4.0.0-alpha.26](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.25...v4.0.0-alpha.26) (2024-11-04)
|
|
3
17
|
|
|
4
18
|
## [4.0.0-alpha.25](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.24...v4.0.0-alpha.25) (2024-11-01)
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/web-extension",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.27",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@dynamic-labs/sdk-api-core": "0.0.559",
|
|
30
30
|
"@turnkey/webauthn-stamper": "0.5.0",
|
|
31
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
32
|
-
"@dynamic-labs/client": "4.0.0-alpha.
|
|
33
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/message-transport": "4.0.0-alpha.
|
|
35
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/webauthn": "4.0.0-alpha.
|
|
31
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.27",
|
|
32
|
+
"@dynamic-labs/client": "4.0.0-alpha.27",
|
|
33
|
+
"@dynamic-labs/logger": "4.0.0-alpha.27",
|
|
34
|
+
"@dynamic-labs/message-transport": "4.0.0-alpha.27",
|
|
35
|
+
"@dynamic-labs/utils": "4.0.0-alpha.27",
|
|
36
|
+
"@dynamic-labs/webauthn": "4.0.0-alpha.27"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {}
|
|
39
39
|
}
|
|
@@ -12,6 +12,7 @@ var addHostOriginToUrl = require('../utils/addHostOriginToUrl/addHostOriginToUrl
|
|
|
12
12
|
var setupPlatformHandler = require('../utils/setupPlatformHandler/setupPlatformHandler.cjs');
|
|
13
13
|
var setupSocialHandler = require('../utils/setupSocialHandler/setupSocialHandler.cjs');
|
|
14
14
|
var setupPasskeyHandler = require('../utils/setupPasskeyHandler/setupPasskeyHandler.cjs');
|
|
15
|
+
var setupTurnkeyIframeEventProxy = require('../utils/setupTurnkeyIframeEventProxy/setupTurnkeyIframeEventProxy.cjs');
|
|
15
16
|
|
|
16
17
|
const defaultIFrameUrl = `https://webview.dynamicauth.com/${_package.version}`;
|
|
17
18
|
const WebExtension = ({ iFrameUrl = defaultIFrameUrl, } = {}) => (_, core) => {
|
|
@@ -33,6 +34,7 @@ const WebExtension = ({ iFrameUrl = defaultIFrameUrl, } = {}) => (_, core) => {
|
|
|
33
34
|
setupPlatformHandler.setupPlatformHandler(core.messageTransport);
|
|
34
35
|
setupSocialHandler.setupSocialHandler(core.messageTransport);
|
|
35
36
|
setupPasskeyHandler.setupPasskeyHandler(core);
|
|
37
|
+
setupTurnkeyIframeEventProxy.setupTurnkeyIframeEventProxy(core.messageTransport);
|
|
36
38
|
return {};
|
|
37
39
|
};
|
|
38
40
|
|
|
@@ -8,6 +8,7 @@ import { addHostOriginToUrl } from '../utils/addHostOriginToUrl/addHostOriginToU
|
|
|
8
8
|
import { setupPlatformHandler } from '../utils/setupPlatformHandler/setupPlatformHandler.js';
|
|
9
9
|
import { setupSocialHandler } from '../utils/setupSocialHandler/setupSocialHandler.js';
|
|
10
10
|
import { setupPasskeyHandler } from '../utils/setupPasskeyHandler/setupPasskeyHandler.js';
|
|
11
|
+
import { setupTurnkeyIframeEventProxy } from '../utils/setupTurnkeyIframeEventProxy/setupTurnkeyIframeEventProxy.js';
|
|
11
12
|
|
|
12
13
|
const defaultIFrameUrl = `https://webview.dynamicauth.com/${version}`;
|
|
13
14
|
const WebExtension = ({ iFrameUrl = defaultIFrameUrl, } = {}) => (_, core) => {
|
|
@@ -29,6 +30,7 @@ const WebExtension = ({ iFrameUrl = defaultIFrameUrl, } = {}) => (_, core) => {
|
|
|
29
30
|
setupPlatformHandler(core.messageTransport);
|
|
30
31
|
setupSocialHandler(core.messageTransport);
|
|
31
32
|
setupPasskeyHandler(core);
|
|
33
|
+
setupTurnkeyIframeEventProxy(core.messageTransport);
|
|
32
34
|
return {};
|
|
33
35
|
};
|
|
34
36
|
|
|
@@ -11,17 +11,11 @@ var logger = require('../logger.cjs');
|
|
|
11
11
|
|
|
12
12
|
const setupPasskeyHandler = (core) => {
|
|
13
13
|
const passkeysRequestChannel = messageTransport.createRequestChannel(core.messageTransport);
|
|
14
|
-
passkeysRequestChannel.handle('
|
|
14
|
+
passkeysRequestChannel.handle('createPasskeyOnBrowser', (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ publicKey }) {
|
|
15
15
|
try {
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
16
|
const attestation = yield webauthn.createWebauthnCredential(publicKey);
|
|
18
17
|
return {
|
|
19
|
-
attestation:
|
|
20
|
-
attestationObject: attestation.response.attestationObject,
|
|
21
|
-
clientDataJson: attestation.response.clientDataJSON,
|
|
22
|
-
credentialId: attestation.rawId,
|
|
23
|
-
transports: [],
|
|
24
|
-
},
|
|
18
|
+
attestation: webauthn.convertAttestationResultToTurnkey(attestation),
|
|
25
19
|
};
|
|
26
20
|
}
|
|
27
21
|
catch (err) {
|
|
@@ -2,22 +2,16 @@
|
|
|
2
2
|
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
3
|
import { WebauthnStamper } from '@turnkey/webauthn-stamper';
|
|
4
4
|
import { createRequestChannel } from '@dynamic-labs/message-transport';
|
|
5
|
-
import { createWebauthnCredential } from '@dynamic-labs/webauthn';
|
|
5
|
+
import { createWebauthnCredential, convertAttestationResultToTurnkey } from '@dynamic-labs/webauthn';
|
|
6
6
|
import { logger } from '../logger.js';
|
|
7
7
|
|
|
8
8
|
const setupPasskeyHandler = (core) => {
|
|
9
9
|
const passkeysRequestChannel = createRequestChannel(core.messageTransport);
|
|
10
|
-
passkeysRequestChannel.handle('
|
|
10
|
+
passkeysRequestChannel.handle('createPasskeyOnBrowser', (_a) => __awaiter(void 0, [_a], void 0, function* ({ publicKey }) {
|
|
11
11
|
try {
|
|
12
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
12
|
const attestation = yield createWebauthnCredential(publicKey);
|
|
14
13
|
return {
|
|
15
|
-
attestation:
|
|
16
|
-
attestationObject: attestation.response.attestationObject,
|
|
17
|
-
clientDataJson: attestation.response.clientDataJSON,
|
|
18
|
-
credentialId: attestation.rawId,
|
|
19
|
-
transports: [],
|
|
20
|
-
},
|
|
14
|
+
attestation: convertAttestationResultToTurnkey(attestation),
|
|
21
15
|
};
|
|
22
16
|
}
|
|
23
17
|
catch (err) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { setupTurnkeyIframeEventProxy } from './setupTurnkeyIframeEventProxy';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var _tslib = require('../../../../_virtual/_tslib.cjs');
|
|
7
|
+
var messageTransport = require('@dynamic-labs/message-transport');
|
|
8
|
+
|
|
9
|
+
const setupTurnkeyIframeEventProxy = (messageTransport$1) => {
|
|
10
|
+
const turnkeyIframeEventProxyRequestChannel = messageTransport.createRequestChannel(messageTransport$1);
|
|
11
|
+
turnkeyIframeEventProxyRequestChannel.handle('initializeTurnkeyIframeEventProxy', (_a) => _tslib.__awaiter(void 0, [_a], void 0, function* ({ origins }) {
|
|
12
|
+
window.addEventListener('message', (event) => {
|
|
13
|
+
// Check origin to ensure messages are from the expected source
|
|
14
|
+
if (origins.includes(event.origin)) {
|
|
15
|
+
turnkeyIframeEventProxyRequestChannel.emit('proxyEmitterTurnkeyIframeEvent', {
|
|
16
|
+
data: event.data,
|
|
17
|
+
origin: event.origin,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.setupTurnkeyIframeEventProxy = setupTurnkeyIframeEventProxy;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { __awaiter } from '../../../../_virtual/_tslib.js';
|
|
3
|
+
import { createRequestChannel } from '@dynamic-labs/message-transport';
|
|
4
|
+
|
|
5
|
+
const setupTurnkeyIframeEventProxy = (messageTransport) => {
|
|
6
|
+
const turnkeyIframeEventProxyRequestChannel = createRequestChannel(messageTransport);
|
|
7
|
+
turnkeyIframeEventProxyRequestChannel.handle('initializeTurnkeyIframeEventProxy', (_a) => __awaiter(void 0, [_a], void 0, function* ({ origins }) {
|
|
8
|
+
window.addEventListener('message', (event) => {
|
|
9
|
+
// Check origin to ensure messages are from the expected source
|
|
10
|
+
if (origins.includes(event.origin)) {
|
|
11
|
+
turnkeyIframeEventProxyRequestChannel.emit('proxyEmitterTurnkeyIframeEvent', {
|
|
12
|
+
data: event.data,
|
|
13
|
+
origin: event.origin,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}));
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { setupTurnkeyIframeEventProxy };
|