@dynamic-labs/embedded-wallet-evm 4.0.0-alpha.21 → 4.0.0-alpha.23
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 +19 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +11 -12
- package/src/lib/TurnkeyEVMWalletConnector/TurnkeyEVMWalletConnector.cjs +0 -23
- package/src/lib/TurnkeyEVMWalletConnector/TurnkeyEVMWalletConnector.d.ts +0 -6
- package/src/lib/TurnkeyEVMWalletConnector/TurnkeyEVMWalletConnector.js +2 -25
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
## [4.0.0-alpha.23](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.22...v4.0.0-alpha.23) (2024-10-31)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* allow deletion of embedded wallets ([#7170](https://github.com/dynamic-labs/dynamic-auth/issues/7170)) ([40c5478](https://github.com/dynamic-labs/dynamic-auth/commit/40c54789594ba265a63b24f936da4e72b5b1c5b9))
|
|
8
|
+
|
|
9
|
+
## [4.0.0-alpha.22](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.21...v4.0.0-alpha.22) (2024-10-30)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **QNTM-522:** add wallet details card ([#7239](https://github.com/dynamic-labs/dynamic-auth/issues/7239)) ([0181c87](https://github.com/dynamic-labs/dynamic-auth/commit/0181c8727af575620525b8ea47b196945c347846))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* update check for wallet provider event listeners support ([#7303](https://github.com/dynamic-labs/dynamic-auth/issues/7303)) ([c5f3766](https://github.com/dynamic-labs/dynamic-auth/commit/c5f376691c87a0999991e477f9acd07eed4774aa))
|
|
20
|
+
|
|
2
21
|
## [4.0.0-alpha.21](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.20...v4.0.0-alpha.21) (2024-10-30)
|
|
3
22
|
|
|
4
23
|
## [4.0.0-alpha.20](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.19...v4.0.0-alpha.20) (2024-10-30)
|
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/embedded-wallet-evm",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.23",
|
|
4
4
|
"description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,19 +19,18 @@
|
|
|
19
19
|
"homepage": "https://www.dynamic.xyz/",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.559",
|
|
22
|
-
"@turnkey/api-key-stamper": "0.4.
|
|
23
|
-
"@turnkey/http": "2.12.2",
|
|
22
|
+
"@turnkey/api-key-stamper": "0.4.3",
|
|
24
23
|
"@turnkey/iframe-stamper": "2.0.0",
|
|
25
|
-
"@turnkey/viem": "0.
|
|
24
|
+
"@turnkey/viem": "0.6.2",
|
|
26
25
|
"@turnkey/webauthn-stamper": "0.5.0",
|
|
27
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/embedded-wallet": "4.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/ethereum-core": "4.0.0-alpha.
|
|
30
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
31
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
32
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
33
|
-
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/webauthn": "4.0.0-alpha.
|
|
26
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.23",
|
|
27
|
+
"@dynamic-labs/embedded-wallet": "4.0.0-alpha.23",
|
|
28
|
+
"@dynamic-labs/ethereum-core": "4.0.0-alpha.23",
|
|
29
|
+
"@dynamic-labs/types": "4.0.0-alpha.23",
|
|
30
|
+
"@dynamic-labs/utils": "4.0.0-alpha.23",
|
|
31
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.23",
|
|
32
|
+
"@dynamic-labs/wallet-connector-core": "4.0.0-alpha.23",
|
|
33
|
+
"@dynamic-labs/webauthn": "4.0.0-alpha.23"
|
|
35
34
|
},
|
|
36
35
|
"peerDependencies": {
|
|
37
36
|
"viem": "^2.7.6"
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../../_virtual/_tslib.cjs');
|
|
7
7
|
var apiKeyStamper = require('@turnkey/api-key-stamper');
|
|
8
|
-
var http = require('@turnkey/http');
|
|
9
8
|
var iframeStamper = require('@turnkey/iframe-stamper');
|
|
10
9
|
var viem$1 = require('@turnkey/viem');
|
|
11
10
|
var webauthnStamper = require('@turnkey/webauthn-stamper');
|
|
@@ -32,11 +31,6 @@ class TurnkeyEVMWalletConnector extends embeddedWallet.TurnkeyWalletConnectorBas
|
|
|
32
31
|
this.connectedChain = 'EVM';
|
|
33
32
|
this.supportedChains = ['ETH', 'EVM'];
|
|
34
33
|
this.verifiedCredentialChain = 'eip155';
|
|
35
|
-
this.stampCreateWalletAccountRequest = (_b) => _tslib.__awaiter(this, [_b], void 0, function* ({ request, }) {
|
|
36
|
-
yield this.createOrRestoreSession();
|
|
37
|
-
const turnkeyClient = this.getTurnkeyClient();
|
|
38
|
-
return turnkeyClient.stampCreateWalletAccounts(request);
|
|
39
|
-
});
|
|
40
34
|
this.evmNetworks = utils.parseEvmNetworks(props.evmNetworks);
|
|
41
35
|
this.walletUiUtils = props.walletUiUtils;
|
|
42
36
|
this._turnkeyAccount = undefined;
|
|
@@ -160,23 +154,6 @@ class TurnkeyEVMWalletConnector extends embeddedWallet.TurnkeyWalletConnectorBas
|
|
|
160
154
|
return this.getWalletClient();
|
|
161
155
|
});
|
|
162
156
|
}
|
|
163
|
-
getTurnkeyClient() {
|
|
164
|
-
var _a;
|
|
165
|
-
let rpId = utils.getTLD();
|
|
166
|
-
if (!rpId) {
|
|
167
|
-
rpId = utils.PlatformService.getHostname();
|
|
168
|
-
}
|
|
169
|
-
const passkeyStamper = embeddedWallet.PasskeyService.createWebauthnStamper({
|
|
170
|
-
rpId,
|
|
171
|
-
});
|
|
172
|
-
const apiKeyStamper = embeddedWallet.TurnkeyWalletConnectorBase === null || embeddedWallet.TurnkeyWalletConnectorBase === void 0 ? void 0 : embeddedWallet.TurnkeyWalletConnectorBase.apiKeyStamper;
|
|
173
|
-
const stamper = apiKeyStamper !== null && apiKeyStamper !== void 0 ? apiKeyStamper : passkeyStamper;
|
|
174
|
-
this.__turnkeyClient =
|
|
175
|
-
(_a = this.getAuthenticatorHandler().client) !== null && _a !== void 0 ? _a : new http.TurnkeyClient({
|
|
176
|
-
baseUrl: embeddedWallet.TURNKEY_API_BASE_URL,
|
|
177
|
-
}, stamper);
|
|
178
|
-
return this.__turnkeyClient;
|
|
179
|
-
}
|
|
180
157
|
// decides in runtime which stamper to use and creates the corresponding account
|
|
181
158
|
getAccount() {
|
|
182
159
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { TurnkeyClient, TurnkeyApiTypes } from '@turnkey/http';
|
|
2
1
|
import { Account, LocalAccount, PublicClient, Transport, Chain as ViemChain, WalletClient } from 'viem';
|
|
3
2
|
import { JwtVerifiedCredential } from '@dynamic-labs/sdk-api-core';
|
|
4
3
|
import { EvmNetwork, GenericNetwork, IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
|
|
@@ -30,7 +29,6 @@ export declare class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBas
|
|
|
30
29
|
private _turnkeyAccount;
|
|
31
30
|
static lastUsedChainIdStorageKey: string;
|
|
32
31
|
private _selectedChainId;
|
|
33
|
-
private __turnkeyClient;
|
|
34
32
|
constructor(nameAndKey: TurnkeyWalletConnectorNameAndKey, props: TurnkeyEVMConnectorProps);
|
|
35
33
|
private getLastUsedChainId;
|
|
36
34
|
getNetwork(): Promise<number | undefined>;
|
|
@@ -45,10 +43,6 @@ export declare class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBas
|
|
|
45
43
|
signMessage(messageToSign: string): Promise<string | undefined>;
|
|
46
44
|
getPublicClient(): Promise<void | PublicClient<Transport, ViemChain> | undefined>;
|
|
47
45
|
getSigner(): Promise<WalletClient<Transport, ViemChain, Account> | undefined>;
|
|
48
|
-
stampCreateWalletAccountRequest: ({ request, }: {
|
|
49
|
-
request: TurnkeyApiTypes['v1CreateWalletAccountsRequest'];
|
|
50
|
-
}) => Promise<import("@turnkey/http").TSignedRequest>;
|
|
51
|
-
getTurnkeyClient(): TurnkeyClient;
|
|
52
46
|
getAccount(): Promise<LocalAccount>;
|
|
53
47
|
getWalletClient(): WalletClient<Transport, ViemChain, Account> | undefined;
|
|
54
48
|
private get currentChainId();
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../../../_virtual/_tslib.js';
|
|
3
3
|
import { ApiKeyStamper } from '@turnkey/api-key-stamper';
|
|
4
|
-
import { TurnkeyClient } from '@turnkey/http';
|
|
5
4
|
import { IframeStamper } from '@turnkey/iframe-stamper';
|
|
6
5
|
import { createAccount } from '@turnkey/viem';
|
|
7
6
|
import { WebauthnStamper } from '@turnkey/webauthn-stamper';
|
|
8
7
|
import { http, createPublicClient, formatEther } from 'viem';
|
|
9
8
|
import { toAccount } from 'viem/accounts';
|
|
10
|
-
import { parseEvmNetworks,
|
|
9
|
+
import { parseEvmNetworks, DynamicError } from '@dynamic-labs/utils';
|
|
11
10
|
import { EthereumWallet, createWalletClientWithUiConfirmation, getOrMapViemChain, createViemUiTransaction } from '@dynamic-labs/ethereum-core';
|
|
12
11
|
import { getRpcUrlForChain, isSameAddress } from '@dynamic-labs/wallet-connector-core';
|
|
13
|
-
import { TurnkeyWalletConnectorBase, findTurnkeyVerifiedCredentialsWithSmartWalletRef,
|
|
12
|
+
import { TurnkeyWalletConnectorBase, findTurnkeyVerifiedCredentialsWithSmartWalletRef, logger, TURNKEY_SDK_SESSION_KEY_RETRYABLE_ERRORS } from '@dynamic-labs/embedded-wallet';
|
|
14
13
|
|
|
15
14
|
class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBase {
|
|
16
15
|
constructor(nameAndKey, props) {
|
|
@@ -28,11 +27,6 @@ class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBase {
|
|
|
28
27
|
this.connectedChain = 'EVM';
|
|
29
28
|
this.supportedChains = ['ETH', 'EVM'];
|
|
30
29
|
this.verifiedCredentialChain = 'eip155';
|
|
31
|
-
this.stampCreateWalletAccountRequest = (_b) => __awaiter(this, [_b], void 0, function* ({ request, }) {
|
|
32
|
-
yield this.createOrRestoreSession();
|
|
33
|
-
const turnkeyClient = this.getTurnkeyClient();
|
|
34
|
-
return turnkeyClient.stampCreateWalletAccounts(request);
|
|
35
|
-
});
|
|
36
30
|
this.evmNetworks = parseEvmNetworks(props.evmNetworks);
|
|
37
31
|
this.walletUiUtils = props.walletUiUtils;
|
|
38
32
|
this._turnkeyAccount = undefined;
|
|
@@ -156,23 +150,6 @@ class TurnkeyEVMWalletConnector extends TurnkeyWalletConnectorBase {
|
|
|
156
150
|
return this.getWalletClient();
|
|
157
151
|
});
|
|
158
152
|
}
|
|
159
|
-
getTurnkeyClient() {
|
|
160
|
-
var _a;
|
|
161
|
-
let rpId = getTLD();
|
|
162
|
-
if (!rpId) {
|
|
163
|
-
rpId = PlatformService.getHostname();
|
|
164
|
-
}
|
|
165
|
-
const passkeyStamper = PasskeyService.createWebauthnStamper({
|
|
166
|
-
rpId,
|
|
167
|
-
});
|
|
168
|
-
const apiKeyStamper = TurnkeyWalletConnectorBase === null || TurnkeyWalletConnectorBase === void 0 ? void 0 : TurnkeyWalletConnectorBase.apiKeyStamper;
|
|
169
|
-
const stamper = apiKeyStamper !== null && apiKeyStamper !== void 0 ? apiKeyStamper : passkeyStamper;
|
|
170
|
-
this.__turnkeyClient =
|
|
171
|
-
(_a = this.getAuthenticatorHandler().client) !== null && _a !== void 0 ? _a : new TurnkeyClient({
|
|
172
|
-
baseUrl: TURNKEY_API_BASE_URL,
|
|
173
|
-
}, stamper);
|
|
174
|
-
return this.__turnkeyClient;
|
|
175
|
-
}
|
|
176
153
|
// decides in runtime which stamper to use and creates the corresponding account
|
|
177
154
|
getAccount() {
|
|
178
155
|
return __awaiter(this, void 0, void 0, function* () {
|