@dynamic-labs/ethereum 3.0.0-alpha.4 → 3.0.0-alpha.41
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 +373 -0
- package/package.json +10 -10
- package/src/EthWalletConnector.cjs +58 -19
- package/src/EthWalletConnector.d.ts +27 -21
- package/src/EthWalletConnector.js +59 -20
- package/src/coinbase/coinbase.cjs +2 -2
- package/src/coinbase/coinbase.d.ts +3 -7125
- package/src/coinbase/coinbase.js +2 -2
- package/src/ethProviderHelper.cjs +3 -4
- package/src/ethProviderHelper.d.ts +6 -2
- package/src/ethProviderHelper.js +3 -4
- package/src/index.cjs +5 -2
- package/src/index.js +4 -1
- package/src/injected/FallbackEvmConnector.cjs +22 -0
- package/src/injected/FallbackEvmConnector.d.ts +9 -0
- package/src/injected/FallbackEvmConnector.js +18 -0
- package/src/injected/InjectedWalletBase.cjs +1 -1
- package/src/injected/InjectedWalletBase.d.ts +2 -2
- package/src/injected/InjectedWalletBase.js +1 -1
- package/src/injected/index.d.ts +1 -0
- package/src/walletConnect/walletConnect.d.ts +2 -7124
- package/src/eip6963Provider.cjs +0 -40
- package/src/eip6963Provider.d.ts +0 -25
- package/src/eip6963Provider.js +0 -35
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NameServiceData, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
3
|
-
import { EvmNetwork, GenericNetwork } from '@dynamic-labs/types';
|
|
1
|
+
import { Account, Hex, PublicClient, Transport, Chain as ViemChain, WalletClient } from 'viem';
|
|
4
2
|
import { IChainRpcProviders } from '@dynamic-labs/rpc-provider-ethereum';
|
|
3
|
+
import { EvmNetwork, GenericNetwork, IUITransaction } from '@dynamic-labs/types';
|
|
5
4
|
import { WalletBookSchema } from '@dynamic-labs/wallet-book';
|
|
5
|
+
import { ISendBalanceWalletConnector, NameServiceData, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
6
6
|
export type SwitchNetworkOps = {
|
|
7
7
|
networkChainId?: number;
|
|
8
8
|
networkName?: string;
|
|
@@ -15,16 +15,19 @@ export type EthWalletConnectorOpts = {
|
|
|
15
15
|
evmNetworks: GenericNetwork[];
|
|
16
16
|
walletBook: WalletBookSchema;
|
|
17
17
|
};
|
|
18
|
-
export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
18
|
+
export declare abstract class EthWalletConnector extends WalletConnectorBase implements ISendBalanceWalletConnector {
|
|
19
19
|
evmNetworks: EvmNetwork[];
|
|
20
20
|
private activeAccount;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
private activeChain;
|
|
22
|
+
abstract getWalletClient(chainId?: string): WalletClient<Transport, ViemChain, Account> | undefined;
|
|
23
|
+
getPublicClient(): Promise<void | PublicClient<Transport, ViemChain> | undefined>;
|
|
23
24
|
constructor(props: EthWalletConnectorOpts);
|
|
24
25
|
getNetwork(): Promise<number | undefined>;
|
|
25
|
-
getNameService(): Promise<NameServiceData | undefined>;
|
|
26
|
+
getNameService(address: string): Promise<NameServiceData | undefined>;
|
|
27
|
+
isTestnet(): Promise<boolean>;
|
|
28
|
+
parseAddress(address: string): string;
|
|
26
29
|
getSigner(): Promise<{
|
|
27
|
-
account: Account
|
|
30
|
+
account: Account;
|
|
28
31
|
batch?: {
|
|
29
32
|
multicall?: boolean | {
|
|
30
33
|
batchSize?: number | undefined;
|
|
@@ -35,7 +38,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
35
38
|
ccipRead?: false | {
|
|
36
39
|
request?: ((parameters: import("viem").CcipRequestParameters) => Promise<`0x${string}`>) | undefined;
|
|
37
40
|
} | undefined;
|
|
38
|
-
chain:
|
|
41
|
+
chain: ViemChain;
|
|
39
42
|
key: string;
|
|
40
43
|
name: string;
|
|
41
44
|
pollingInterval: number;
|
|
@@ -44,15 +47,15 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
44
47
|
type: string;
|
|
45
48
|
uid: string;
|
|
46
49
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
47
|
-
deployContract: <const abi extends import("viem").Abi | readonly unknown[], chainOverride extends
|
|
50
|
+
deployContract: <const abi extends import("viem").Abi | readonly unknown[], chainOverride extends ViemChain | undefined>(args: import("viem").DeployContractParameters<abi, ViemChain, Account, chainOverride>) => Promise<`0x${string}`>;
|
|
48
51
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
49
52
|
getChainId: () => Promise<number>;
|
|
50
53
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
51
|
-
prepareTransactionRequest: <const TRequest extends import("viem").PrepareTransactionRequestRequest<
|
|
54
|
+
prepareTransactionRequest: <const TRequest extends import("viem").PrepareTransactionRequestRequest<ViemChain, TChainOverride>, TChainOverride extends ViemChain | undefined = undefined, TAccountOverride extends `0x${string}` | Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<ViemChain, Account, TChainOverride, TAccountOverride, TRequest>) => Promise<import("viem").UnionRequiredBy<Extract<import("viem").UnionOmit<import("viem").ExtractChainFormatterParameters<import("viem").DeriveChain<ViemChain, TChainOverride>, "transactionRequest", import("viem").TransactionRequest>, "from"> & (import("viem").DeriveChain<ViemChain, TChainOverride> extends infer T_12 ? T_12 extends import("viem").DeriveChain<ViemChain, TChainOverride> ? T_12 extends ViemChain ? {
|
|
52
55
|
chain: T_12;
|
|
53
56
|
} : {
|
|
54
57
|
chain?: undefined;
|
|
55
|
-
} : never : never) & (import("viem").DeriveAccount<Account
|
|
58
|
+
} : never : never) & (import("viem").DeriveAccount<Account, TAccountOverride> extends infer T_13 ? T_13 extends import("viem").DeriveAccount<Account, TAccountOverride> ? T_13 extends Account ? {
|
|
56
59
|
account: T_13;
|
|
57
60
|
from: `0x${string}`;
|
|
58
61
|
} : {
|
|
@@ -1436,11 +1439,11 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
1436
1439
|
sidecars: false | readonly import("viem").BlobSidecar<`0x${string}`>[] | undefined;
|
|
1437
1440
|
}, import("viem").TransactionSerializableEIP4844>)) | import("viem").Opaque<import("viem").TransactionSerializableEIP4844, TRequest> | import("viem").Opaque<import("viem").TransactionRequestEIP4844, TRequest> ? "eip4844" : never) | (TRequest["type"] extends string ? TRequest["type"] : never)>) ? T_21 extends "eip4844" ? import("viem").TransactionRequestEIP4844 : never : never : never)>> & {
|
|
1438
1441
|
chainId?: number | undefined;
|
|
1439
|
-
}, (TRequest["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? TRequest["parameters"][number] : "chainId" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "fees") extends infer T_22 ? T_22 extends (TRequest["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? TRequest["parameters"][number] : "chainId" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "fees") ? T_22 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_22 : never : never> & (unknown extends TRequest["kzg"] ? {} : Pick<TRequest, "kzg">) extends infer T ? { [K in keyof T]: (import("viem").UnionRequiredBy<Extract<import("viem").UnionOmit<import("viem").ExtractChainFormatterParameters<import("viem").DeriveChain<
|
|
1442
|
+
}, (TRequest["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? TRequest["parameters"][number] : "chainId" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "fees") extends infer T_22 ? T_22 extends (TRequest["parameters"] extends readonly import("viem").PrepareTransactionRequestParameterType[] ? TRequest["parameters"][number] : "chainId" | "type" | "gas" | "nonce" | "blobVersionedHashes" | "fees") ? T_22 extends "fees" ? "gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" : T_22 : never : never> & (unknown extends TRequest["kzg"] ? {} : Pick<TRequest, "kzg">) extends infer T ? { [K in keyof T]: (import("viem").UnionRequiredBy<Extract<import("viem").UnionOmit<import("viem").ExtractChainFormatterParameters<import("viem").DeriveChain<ViemChain, TChainOverride>, "transactionRequest", import("viem").TransactionRequest>, "from"> & (import("viem").DeriveChain<ViemChain, TChainOverride> extends infer T_1 ? T_1 extends import("viem").DeriveChain<ViemChain, TChainOverride> ? T_1 extends ViemChain ? {
|
|
1440
1443
|
chain: T_1;
|
|
1441
1444
|
} : {
|
|
1442
1445
|
chain?: undefined;
|
|
1443
|
-
} : never : never) & (import("viem").DeriveAccount<Account
|
|
1446
|
+
} : never : never) & (import("viem").DeriveAccount<Account, TAccountOverride> extends infer T_2 ? T_2 extends import("viem").DeriveAccount<Account, TAccountOverride> ? T_2 extends Account ? {
|
|
1444
1447
|
account: T_2;
|
|
1445
1448
|
from: `0x${string}`;
|
|
1446
1449
|
} : {
|
|
@@ -2831,9 +2834,9 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
2831
2834
|
eth_accounts: Record<string, any>;
|
|
2832
2835
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
2833
2836
|
sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
2834
|
-
sendTransaction: <const TRequest_1 extends import("viem").SendTransactionRequest<
|
|
2835
|
-
signMessage: (args: import("viem").SignMessageParameters<Account
|
|
2836
|
-
signTransaction: <TChainOverride_2 extends
|
|
2837
|
+
sendTransaction: <const TRequest_1 extends import("viem").SendTransactionRequest<ViemChain, TChainOverride_1>, TChainOverride_1 extends ViemChain | undefined = undefined>(args: import("viem").SendTransactionParameters<ViemChain, Account, TChainOverride_1, TRequest_1>) => Promise<`0x${string}`>;
|
|
2838
|
+
signMessage: (args: import("viem").SignMessageParameters<Account>) => Promise<`0x${string}`>;
|
|
2839
|
+
signTransaction: <TChainOverride_2 extends ViemChain | undefined>(args: import("viem").SignTransactionParameters<ViemChain, Account, TChainOverride_2>) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | import("viem").TransactionSerializedLegacy>;
|
|
2837
2840
|
signTypedData: <const TTypedData extends {
|
|
2838
2841
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
2839
2842
|
[x: `string[${string}]`]: undefined;
|
|
@@ -3041,10 +3044,10 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
3041
3044
|
uint256?: undefined;
|
|
3042
3045
|
} | {
|
|
3043
3046
|
[key: string]: unknown;
|
|
3044
|
-
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, Account
|
|
3047
|
+
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, Account>) => Promise<`0x${string}`>;
|
|
3045
3048
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
3046
3049
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
3047
|
-
writeContract: <const abi_1 extends import("viem").Abi | readonly unknown[], functionName extends import("viem").ContractFunctionName<abi_1, "nonpayable" | "payable">, args extends import("viem").ContractFunctionArgs<abi_1, "nonpayable" | "payable", functionName>, TChainOverride_3 extends
|
|
3050
|
+
writeContract: <const abi_1 extends import("viem").Abi | readonly unknown[], functionName extends import("viem").ContractFunctionName<abi_1, "nonpayable" | "payable">, args extends import("viem").ContractFunctionArgs<abi_1, "nonpayable" | "payable", functionName>, TChainOverride_3 extends ViemChain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_1, functionName, args, ViemChain, Account, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
3048
3051
|
extend: <const client extends {
|
|
3049
3052
|
[x: string]: unknown;
|
|
3050
3053
|
account?: undefined;
|
|
@@ -3059,9 +3062,9 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
3059
3062
|
transport?: undefined;
|
|
3060
3063
|
type?: undefined;
|
|
3061
3064
|
uid?: undefined;
|
|
3062
|
-
} & import("viem").ExactPartial<Pick<import("viem").PublicActions<
|
|
3065
|
+
} & import("viem").ExactPartial<Pick<import("viem").PublicActions<Transport, ViemChain, Account>, "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getChainId" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "prepareTransactionRequest" | "readContract" | "sendRawTransaction" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<ViemChain, Account>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<Transport, ViemChain, Account, import("viem").WalletRpcSchema, import("viem").WalletActions<ViemChain, Account>>) => client) => import("viem").Client<Transport, ViemChain, Account, import("viem").WalletRpcSchema, { [K_1 in keyof client]: client[K_1]; } & import("viem").WalletActions<ViemChain, Account>>;
|
|
3063
3066
|
} | undefined>;
|
|
3064
|
-
getBalance(): Promise<string | undefined>;
|
|
3067
|
+
getBalance(address: string): Promise<string | undefined>;
|
|
3065
3068
|
supportsNetworkSwitching(): boolean;
|
|
3066
3069
|
switchNetwork({ networkName, networkChainId, }: SwitchNetworkOps): Promise<void>;
|
|
3067
3070
|
getConnectedAccounts(): Promise<string[]>;
|
|
@@ -3076,5 +3079,8 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
3076
3079
|
protected evmNetworkRpcMap: () => EvmRpcMap;
|
|
3077
3080
|
setActiveAccount(account: Hex | undefined): void;
|
|
3078
3081
|
getActiveAccount(): Account | undefined;
|
|
3082
|
+
setActiveChain(chain: ViemChain | undefined): void;
|
|
3083
|
+
getActiveChain(): ViemChain | undefined;
|
|
3084
|
+
createUiTransaction(from: string): Promise<IUITransaction>;
|
|
3079
3085
|
}
|
|
3080
3086
|
export {};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import { __awaiter } from '../_virtual/_tslib.js';
|
|
3
|
-
import { formatEther } from 'viem';
|
|
3
|
+
import { getAddress, formatEther } from 'viem';
|
|
4
4
|
import { toAccount } from 'viem/accounts';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { parseEvmNetworks, retryableFn, FALLBACK_UNDEFINED, DynamicError } from '@dynamic-labs/utils';
|
|
6
|
+
import { chainsMap, getOrMapViemChain, createViemUiTransaction } from '@dynamic-labs/viem-utils';
|
|
7
|
+
import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
|
|
7
8
|
import { findEvmNetwork } from './utils/findEvmNetwork.js';
|
|
8
9
|
import { getNameservice } from './utils/getNameservice.js';
|
|
9
10
|
|
|
10
11
|
class EthWalletConnector extends WalletConnectorBase {
|
|
11
12
|
getPublicClient() {
|
|
12
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
var _a, _b
|
|
14
|
+
var _a, _b;
|
|
14
15
|
const networkId = (_a = (yield this.getNetwork())) !== null && _a !== void 0 ? _a : 1;
|
|
15
16
|
if (this.evmNetworks.length === 0) {
|
|
16
17
|
return undefined;
|
|
@@ -21,7 +22,10 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
21
22
|
solana: [],
|
|
22
23
|
starknet: undefined,
|
|
23
24
|
};
|
|
24
|
-
|
|
25
|
+
if (!this.chainRpcProviders)
|
|
26
|
+
return undefined;
|
|
27
|
+
const providers = this.chainRpcProviders.getProviders(configurations);
|
|
28
|
+
return (_b = this.chainRpcProviders.getEvmProviderByChainId(providers, networkId)) === null || _b === void 0 ? void 0 : _b.provider;
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
31
|
constructor(props) {
|
|
@@ -44,7 +48,7 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
44
48
|
if (!this.supportsNetworkSwitching || !provider) {
|
|
45
49
|
return Promise.resolve(undefined);
|
|
46
50
|
}
|
|
47
|
-
|
|
51
|
+
const chainId = yield retryableFn(provider.getChainId, {
|
|
48
52
|
fallbackValue: FALLBACK_UNDEFINED,
|
|
49
53
|
/**
|
|
50
54
|
* The timeout is set to 1 second because the getChainId method
|
|
@@ -54,32 +58,43 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
54
58
|
*/
|
|
55
59
|
timeoutMs: 1000,
|
|
56
60
|
});
|
|
61
|
+
this.setActiveChain(chainsMap[chainId]);
|
|
62
|
+
return chainId;
|
|
57
63
|
});
|
|
58
64
|
}
|
|
59
|
-
getNameService() {
|
|
65
|
+
getNameService(address) {
|
|
60
66
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
this.getPublicClient(),
|
|
64
|
-
]);
|
|
65
|
-
if (!address || !rpcProvider) {
|
|
67
|
+
const rpcProvider = yield this.getPublicClient();
|
|
68
|
+
if (!rpcProvider) {
|
|
66
69
|
return;
|
|
67
70
|
}
|
|
68
71
|
return getNameservice({ address, rpcProvider });
|
|
69
72
|
});
|
|
70
73
|
}
|
|
74
|
+
isTestnet() {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c;
|
|
77
|
+
return (_c = (_b = (_a = (yield this.getPublicClient())) === null || _a === void 0 ? void 0 : _a.chain) === null || _b === void 0 ? void 0 : _b.testnet) !== null && _c !== void 0 ? _c : false;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
parseAddress(address) {
|
|
81
|
+
try {
|
|
82
|
+
// Ensures the address follows the EIP55 format.
|
|
83
|
+
// see: https://eips.ethereum.org/EIPS/eip-55
|
|
84
|
+
return getAddress(address);
|
|
85
|
+
}
|
|
86
|
+
catch (err) {
|
|
87
|
+
logger.debug(`Failed to parse EVM address into EIP55 format: error getting checksum, returning default ${address}`, err);
|
|
88
|
+
}
|
|
89
|
+
return address;
|
|
90
|
+
}
|
|
71
91
|
getSigner() {
|
|
72
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
93
|
return this.getWalletClient();
|
|
74
94
|
});
|
|
75
95
|
}
|
|
76
|
-
getBalance() {
|
|
96
|
+
getBalance(address) {
|
|
77
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
-
// This is equivalent to getSigner().getAddress() but does not crash
|
|
79
|
-
// if the signer is not available
|
|
80
|
-
const [address] = yield this.getConnectedAccounts();
|
|
81
|
-
if (!address)
|
|
82
|
-
return;
|
|
83
98
|
const client = yield this.getPublicClient();
|
|
84
99
|
const result = yield (client === null || client === void 0 ? void 0 : client.getBalance({
|
|
85
100
|
address: address,
|
|
@@ -119,7 +134,7 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
119
134
|
return [];
|
|
120
135
|
const addresses = yield retryableFn(provider.getAddresses, {
|
|
121
136
|
fallbackValue: [],
|
|
122
|
-
timeoutMs:
|
|
137
|
+
timeoutMs: 500,
|
|
123
138
|
});
|
|
124
139
|
if (addresses.length) {
|
|
125
140
|
this.setActiveAccount(addresses[0]);
|
|
@@ -139,11 +154,15 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
139
154
|
if (!this.supportsNetworkSwitching()) {
|
|
140
155
|
throw new DynamicError('Network switching is not supported');
|
|
141
156
|
}
|
|
142
|
-
|
|
157
|
+
const viemChain = getOrMapViemChain(network);
|
|
158
|
+
yield provider.switchChain(viemChain);
|
|
143
159
|
if (this.key === 'magiceden') {
|
|
144
160
|
const newChainId = yield provider.getChainId();
|
|
145
161
|
this.emit('chainChange', { chain: newChainId.toString() });
|
|
146
162
|
}
|
|
163
|
+
else {
|
|
164
|
+
this.setActiveChain(viemChain);
|
|
165
|
+
}
|
|
147
166
|
}
|
|
148
167
|
catch (error) {
|
|
149
168
|
// we need to check for unrecognized chain error first because it also contains 'rejected' in message
|
|
@@ -188,6 +207,26 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
188
207
|
getActiveAccount() {
|
|
189
208
|
return this.activeAccount;
|
|
190
209
|
}
|
|
210
|
+
setActiveChain(chain) {
|
|
211
|
+
this.activeChain = chain;
|
|
212
|
+
}
|
|
213
|
+
getActiveChain() {
|
|
214
|
+
return this.activeChain;
|
|
215
|
+
}
|
|
216
|
+
createUiTransaction(from) {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
const walletClient = yield this.getWalletClient();
|
|
219
|
+
const publicClient = yield this.getPublicClient();
|
|
220
|
+
if (!publicClient || !walletClient) {
|
|
221
|
+
throw new DynamicError('No public client available');
|
|
222
|
+
}
|
|
223
|
+
return createViemUiTransaction({
|
|
224
|
+
from,
|
|
225
|
+
publicClient,
|
|
226
|
+
walletClient,
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
}
|
|
191
230
|
}
|
|
192
231
|
|
|
193
232
|
export { EthWalletConnector };
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var _tslib = require('../../_virtual/_tslib.cjs');
|
|
7
7
|
var viem = require('viem');
|
|
8
|
-
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
9
8
|
var viemUtils = require('@dynamic-labs/viem-utils');
|
|
9
|
+
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
10
10
|
var EthWalletConnector = require('../EthWalletConnector.cjs');
|
|
11
11
|
var helpers = require('./helpers.cjs');
|
|
12
12
|
|
|
@@ -19,7 +19,7 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
|
|
|
19
19
|
this.supportedChains = ['EVM', 'ETH'];
|
|
20
20
|
this.connectedChain = 'EVM';
|
|
21
21
|
this.canConnectViaQrCode = false;
|
|
22
|
-
this.canConnectViaCustodialService =
|
|
22
|
+
this.canConnectViaCustodialService = !this.isInstalledOnBrowser();
|
|
23
23
|
this.coinbaseProviderOpts = {
|
|
24
24
|
appLogoUrl: appLogoUrl,
|
|
25
25
|
appName: appName,
|