@dynamic-labs/ethereum 2.0.0-alpha.5 → 2.0.0-alpha.6
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 +20 -0
- package/package.json +8 -8
- package/src/EthWalletConnector.cjs +1 -20
- package/src/EthWalletConnector.d.ts +7 -7
- package/src/EthWalletConnector.js +3 -22
- package/src/coinbase/coinbase.cjs +1 -0
- package/src/coinbase/coinbase.d.ts +14 -14
- package/src/coinbase/coinbase.js +1 -0
- package/src/index.cjs +1 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/walletConnect/walletConnect.cjs +5 -0
- package/src/walletConnect/walletConnect.d.ts +7 -7
- package/src/walletConnect/walletConnect.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.0.0-alpha.6](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-02-26)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* setShowAuthFlow opens dynamic profile in non-multi-wallet states
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* allow passing prop to hide embedded wallet action confirmation UIs ([#4775](https://github.com/dynamic-labs/DynamicAuth/issues/4775)) ([d7c6a46](https://github.com/dynamic-labs/DynamicAuth/commit/d7c6a4699e41f6a62d31880c3bd0346ebfa0e3ba))
|
|
12
|
+
* make sms mobile keyboard numeric ([#4755](https://github.com/dynamic-labs/DynamicAuth/issues/4755)) ([f36844a](https://github.com/dynamic-labs/DynamicAuth/commit/f36844aeaae240c520181b3242492db8ffc64a50))
|
|
13
|
+
* setShowAuthFlow opens dynamic profile in non-multi-wallet states ([42dbbc0](https://github.com/dynamic-labs/DynamicAuth/commit/42dbbc00a5cebe937dca5a80397cdd3c577f6a45))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* demo one-time codes for solana wallets fix ([#4760](https://github.com/dynamic-labs/DynamicAuth/issues/4760)) ([a5ab2a8](https://github.com/dynamic-labs/DynamicAuth/commit/a5ab2a8bc348a35a898e03db0900bfab88184c17))
|
|
19
|
+
* only store passcode in backend when auto-generated by dynamic ([#4764](https://github.com/dynamic-labs/DynamicAuth/issues/4764)) ([528bedc](https://github.com/dynamic-labs/DynamicAuth/commit/528bedce5cbd3022ddafe4242954a04f5b70ae74))
|
|
20
|
+
* use enableForcedNetworkValidation on connect-only ([#4750](https://github.com/dynamic-labs/DynamicAuth/issues/4750)) ([6299f7c](https://github.com/dynamic-labs/DynamicAuth/commit/6299f7c3ce705ddb19714f6b7a3a488851ed8dde))
|
|
21
|
+
|
|
2
22
|
## [2.0.0-alpha.5](https://github.com/dynamic-labs/DynamicAuth/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2024-02-22)
|
|
3
23
|
|
|
4
24
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -26,16 +26,16 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@coinbase/wallet-sdk": "3.9.
|
|
29
|
+
"@coinbase/wallet-sdk": "3.9.2",
|
|
30
30
|
"@walletconnect/universal-provider": "2.10.6",
|
|
31
31
|
"eventemitter3": "5.0.1",
|
|
32
32
|
"buffer": "6.0.3",
|
|
33
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.0.0-alpha.
|
|
34
|
-
"@dynamic-labs/turnkey": "2.0.0-alpha.
|
|
35
|
-
"@dynamic-labs/types": "2.0.0-alpha.
|
|
36
|
-
"@dynamic-labs/utils": "2.0.0-alpha.
|
|
37
|
-
"@dynamic-labs/wallet-book": "2.0.0-alpha.
|
|
38
|
-
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.
|
|
33
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.0.0-alpha.6",
|
|
34
|
+
"@dynamic-labs/turnkey": "2.0.0-alpha.6",
|
|
35
|
+
"@dynamic-labs/types": "2.0.0-alpha.6",
|
|
36
|
+
"@dynamic-labs/utils": "2.0.0-alpha.6",
|
|
37
|
+
"@dynamic-labs/wallet-book": "2.0.0-alpha.6",
|
|
38
|
+
"@dynamic-labs/wallet-connector-core": "2.0.0-alpha.6",
|
|
39
39
|
"stream": "0.0.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -6,7 +6,6 @@ var _tslib = require('../_virtual/_tslib.cjs');
|
|
|
6
6
|
var viem = require('viem');
|
|
7
7
|
var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
|
|
8
8
|
var utils = require('@dynamic-labs/utils');
|
|
9
|
-
var rpcProviderEthereum = require('@dynamic-labs/rpc-provider-ethereum');
|
|
10
9
|
var findEvmNetwork = require('./utils/findEvmNetwork.cjs');
|
|
11
10
|
|
|
12
11
|
class EthWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
@@ -38,25 +37,7 @@ class EthWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
38
37
|
}, {});
|
|
39
38
|
this.evmNetworks = utils.parseEvmNetworks(props.evmNetworks);
|
|
40
39
|
this.chainRpcProviders = props.chainRpcProviders;
|
|
41
|
-
(_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.
|
|
42
|
-
const rpcProviders = {};
|
|
43
|
-
if (config === null || config === void 0 ? void 0 : config.evm) {
|
|
44
|
-
rpcProviders.evm = utils.parseEvmNetworks(config.evm).map((network) => {
|
|
45
|
-
var _a;
|
|
46
|
-
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
47
|
-
const provider = viem.createPublicClient({
|
|
48
|
-
chain: utils.getOrMapViemChain(network),
|
|
49
|
-
transport: viem.http(rpcUrl),
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
chainId: network.chainId,
|
|
53
|
-
chainName: network.name,
|
|
54
|
-
provider,
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
return rpcProviders.evm;
|
|
59
|
-
});
|
|
40
|
+
(_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerEvmProviders();
|
|
60
41
|
}
|
|
61
42
|
getNetwork() {
|
|
62
43
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -40,20 +40,20 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
40
40
|
type: string;
|
|
41
41
|
uid: string;
|
|
42
42
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
43
|
-
deployContract: <const
|
|
43
|
+
deployContract: <const abi extends import("viem").Abi | readonly unknown[], chainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<abi, import("viem").Chain | undefined, import("viem").Account | undefined, chainOverride>) => Promise<`0x${string}`>;
|
|
44
44
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
45
45
|
getChainId: () => Promise<number>;
|
|
46
46
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
47
|
-
prepareTransactionRequest: <
|
|
47
|
+
prepareTransactionRequest: <TParameterType extends import("viem").PrepareTransactionRequestParameterType, TChainOverride extends import("viem").Chain | undefined = undefined, TAccountOverride extends `0x${string}` | import("viem").Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride, TAccountOverride, TParameterType>) => Promise<import("viem").PrepareTransactionRequestReturnType<import("viem").Chain, import("viem").Account | undefined, TChainOverride, TAccountOverride, TParameterType>>;
|
|
48
48
|
requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
|
|
49
49
|
requestPermissions: (args: {
|
|
50
50
|
[x: string]: Record<string, any>;
|
|
51
51
|
eth_accounts: Record<string, any>;
|
|
52
52
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
53
|
-
sendRawTransaction: (args: import("
|
|
54
|
-
sendTransaction: <
|
|
53
|
+
sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
54
|
+
sendTransaction: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_1>) => Promise<`0x${string}`>;
|
|
55
55
|
signMessage: (args: import("viem").SignMessageParameters<import("viem").Account | undefined>) => Promise<`0x${string}`>;
|
|
56
|
-
signTransaction: <
|
|
56
|
+
signTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
57
57
|
signTypedData: <const TTypedData extends {
|
|
58
58
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
59
59
|
[x: `string[${string}]`]: undefined;
|
|
@@ -264,7 +264,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
264
264
|
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, import("viem").Account | undefined>) => Promise<`0x${string}`>;
|
|
265
265
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
266
266
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
267
|
-
writeContract: <const
|
|
267
|
+
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, "pure" | "view", functionName>, TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_1, functionName, args, import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
268
268
|
extend: <const client extends {
|
|
269
269
|
[x: string]: unknown;
|
|
270
270
|
account?: undefined;
|
|
@@ -278,7 +278,7 @@ export declare abstract class EthWalletConnector extends WalletConnectorBase {
|
|
|
278
278
|
transport?: undefined;
|
|
279
279
|
type?: undefined;
|
|
280
280
|
uid?: undefined;
|
|
281
|
-
} & Partial<Pick<import("viem").PublicActions, "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, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
|
|
281
|
+
} & Partial<Pick<import("viem").PublicActions<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined>, "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<import("viem").Chain | undefined, import("viem").Account | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
|
|
282
282
|
} | undefined>;
|
|
283
283
|
getBalance(): Promise<string | undefined>;
|
|
284
284
|
supportsNetworkSwitching(): boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from '../_virtual/_tslib.js';
|
|
2
|
-
import {
|
|
2
|
+
import { formatEther } from 'viem';
|
|
3
3
|
import { WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
|
|
4
|
-
import { parseEvmNetworks,
|
|
5
|
-
import { ProviderChain } from '@dynamic-labs/rpc-provider-ethereum';
|
|
4
|
+
import { parseEvmNetworks, retryableFn, FALLBACK_UNDEFINED, DynamicError, getOrMapViemChain } from '@dynamic-labs/utils';
|
|
6
5
|
import { findEvmNetwork } from './utils/findEvmNetwork.js';
|
|
7
6
|
|
|
8
7
|
class EthWalletConnector extends WalletConnectorBase {
|
|
@@ -34,25 +33,7 @@ class EthWalletConnector extends WalletConnectorBase {
|
|
|
34
33
|
}, {});
|
|
35
34
|
this.evmNetworks = parseEvmNetworks(props.evmNetworks);
|
|
36
35
|
this.chainRpcProviders = props.chainRpcProviders;
|
|
37
|
-
(_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.
|
|
38
|
-
const rpcProviders = {};
|
|
39
|
-
if (config === null || config === void 0 ? void 0 : config.evm) {
|
|
40
|
-
rpcProviders.evm = parseEvmNetworks(config.evm).map((network) => {
|
|
41
|
-
var _a;
|
|
42
|
-
const rpcUrl = ((_a = network.privateCustomerRpcUrls) === null || _a === void 0 ? void 0 : _a[0]) || network.rpcUrls[0];
|
|
43
|
-
const provider = createPublicClient({
|
|
44
|
-
chain: getOrMapViemChain(network),
|
|
45
|
-
transport: http(rpcUrl),
|
|
46
|
-
});
|
|
47
|
-
return {
|
|
48
|
-
chainId: network.chainId,
|
|
49
|
-
chainName: network.name,
|
|
50
|
-
provider,
|
|
51
|
-
};
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return rpcProviders.evm;
|
|
55
|
-
});
|
|
36
|
+
(_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerEvmProviders();
|
|
56
37
|
}
|
|
57
38
|
getNetwork() {
|
|
58
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -12,6 +12,7 @@ var ethProviderHelper = require('../ethProviderHelper.cjs');
|
|
|
12
12
|
var EthWalletConnector = require('../EthWalletConnector.cjs');
|
|
13
13
|
require('../walletConnect/walletConnect.cjs');
|
|
14
14
|
var client = require('./client/client.cjs');
|
|
15
|
+
require('@dynamic-labs/rpc-provider-ethereum');
|
|
15
16
|
|
|
16
17
|
class Coinbase extends EthWalletConnector.EthWalletConnector {
|
|
17
18
|
constructor(_a) {
|
|
@@ -32,20 +32,20 @@ export declare class Coinbase extends EthWalletConnector {
|
|
|
32
32
|
type: string;
|
|
33
33
|
uid: string;
|
|
34
34
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
35
|
-
deployContract: <const
|
|
35
|
+
deployContract: <const abi extends import("viem").Abi | readonly unknown[], chainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<abi, import("viem").Chain | undefined, import("viem").Account | undefined, chainOverride>) => Promise<`0x${string}`>;
|
|
36
36
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
37
37
|
getChainId: () => Promise<number>;
|
|
38
38
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
39
|
-
prepareTransactionRequest: <
|
|
39
|
+
prepareTransactionRequest: <TParameterType extends import("viem").PrepareTransactionRequestParameterType, TChainOverride extends import("viem").Chain | undefined = undefined, TAccountOverride extends `0x${string}` | import("viem").Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride, TAccountOverride, TParameterType>) => Promise<import("viem").PrepareTransactionRequestReturnType<import("viem").Chain, import("viem").Account | undefined, TChainOverride, TAccountOverride, TParameterType>>;
|
|
40
40
|
requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
|
|
41
41
|
requestPermissions: (args: {
|
|
42
42
|
[x: string]: Record<string, any>;
|
|
43
43
|
eth_accounts: Record<string, any>;
|
|
44
44
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
45
|
-
sendRawTransaction: (args: import("
|
|
46
|
-
sendTransaction: <
|
|
45
|
+
sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
46
|
+
sendTransaction: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_1>) => Promise<`0x${string}`>;
|
|
47
47
|
signMessage: (args: import("viem").SignMessageParameters<import("viem").Account | undefined>) => Promise<`0x${string}`>;
|
|
48
|
-
signTransaction: <
|
|
48
|
+
signTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SignTransactionParameters<import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
49
49
|
signTypedData: <const TTypedData extends {
|
|
50
50
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
51
51
|
[x: `string[${string}]`]: undefined;
|
|
@@ -256,7 +256,7 @@ export declare class Coinbase extends EthWalletConnector {
|
|
|
256
256
|
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, import("viem").Account | undefined>) => Promise<`0x${string}`>;
|
|
257
257
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
258
258
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
259
|
-
writeContract: <const
|
|
259
|
+
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, "pure" | "view", functionName>, TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_1, functionName, args, import("viem").Chain | undefined, import("viem").Account | undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
260
260
|
extend: <const client extends {
|
|
261
261
|
[x: string]: unknown;
|
|
262
262
|
account?: undefined;
|
|
@@ -270,7 +270,7 @@ export declare class Coinbase extends EthWalletConnector {
|
|
|
270
270
|
transport?: undefined;
|
|
271
271
|
type?: undefined;
|
|
272
272
|
uid?: undefined;
|
|
273
|
-
} & Partial<Pick<import("viem").PublicActions, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
|
|
273
|
+
} & Partial<Pick<import("viem").PublicActions<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined>, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, import("viem").Account | undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<import("viem").Chain | undefined, import("viem").Account | undefined>>;
|
|
274
274
|
} | {
|
|
275
275
|
account: undefined;
|
|
276
276
|
batch?: {
|
|
@@ -289,20 +289,20 @@ export declare class Coinbase extends EthWalletConnector {
|
|
|
289
289
|
type: string;
|
|
290
290
|
uid: string;
|
|
291
291
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
292
|
-
deployContract: <const
|
|
292
|
+
deployContract: <const abi_2 extends import("viem").Abi | readonly unknown[], chainOverride_1 extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<abi_2, undefined, undefined, chainOverride_1>) => Promise<`0x${string}`>;
|
|
293
293
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
294
294
|
getChainId: () => Promise<number>;
|
|
295
295
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
296
|
-
prepareTransactionRequest: <
|
|
296
|
+
prepareTransactionRequest: <TParameterType_1 extends import("viem").PrepareTransactionRequestParameterType, TChainOverride_4 extends import("viem").Chain | undefined = undefined, TAccountOverride_1 extends `0x${string}` | import("viem").Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<undefined, undefined, TChainOverride_4, TAccountOverride_1, TParameterType_1>) => Promise<import("viem").PrepareTransactionRequestReturnType<import("viem").Chain, undefined, TChainOverride_4, TAccountOverride_1, TParameterType_1>>;
|
|
297
297
|
requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
|
|
298
298
|
requestPermissions: (args: {
|
|
299
299
|
[x: string]: Record<string, any>;
|
|
300
300
|
eth_accounts: Record<string, any>;
|
|
301
301
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
302
|
-
sendRawTransaction: (args: import("
|
|
303
|
-
sendTransaction: <
|
|
302
|
+
sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
303
|
+
sendTransaction: <TChainOverride_5 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<undefined, undefined, TChainOverride_5>) => Promise<`0x${string}`>;
|
|
304
304
|
signMessage: (args: import("viem").SignMessageParameters<undefined>) => Promise<`0x${string}`>;
|
|
305
|
-
signTransaction: <
|
|
305
|
+
signTransaction: <TChainOverride_6 extends import("viem").Chain | undefined>(args: import("viem").SignTransactionParameters<undefined, undefined, TChainOverride_6>) => Promise<`0x${string}`>;
|
|
306
306
|
signTypedData: <const TTypedData_1 extends {
|
|
307
307
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
308
308
|
[x: `string[${string}]`]: undefined;
|
|
@@ -513,7 +513,7 @@ export declare class Coinbase extends EthWalletConnector {
|
|
|
513
513
|
}, TPrimaryType_1 extends string>(args: import("viem").SignTypedDataParameters<TTypedData_1, TPrimaryType_1, undefined>) => Promise<`0x${string}`>;
|
|
514
514
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
515
515
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
516
|
-
writeContract: <const
|
|
516
|
+
writeContract: <const abi_3 extends import("viem").Abi | readonly unknown[], functionName_1 extends import("viem").ContractFunctionName<abi_3, "nonpayable" | "payable">, args_1 extends import("viem").ContractFunctionArgs<abi_3, "pure" | "view", functionName_1>, TChainOverride_7 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_3, functionName_1, args_1, undefined, undefined, TChainOverride_7>) => Promise<`0x${string}`>;
|
|
517
517
|
extend: <const client_1 extends {
|
|
518
518
|
[x: string]: unknown;
|
|
519
519
|
account?: undefined;
|
|
@@ -527,7 +527,7 @@ export declare class Coinbase extends EthWalletConnector {
|
|
|
527
527
|
transport?: undefined;
|
|
528
528
|
type?: undefined;
|
|
529
529
|
uid?: undefined;
|
|
530
|
-
} & Partial<Pick<import("viem").PublicActions, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<undefined, undefined>>) => client_1) => import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, { [K_1 in keyof client_1]: client_1[K_1]; } & import("viem").WalletActions<undefined, undefined>>;
|
|
530
|
+
} & Partial<Pick<import("viem").PublicActions<import("viem").CustomTransport, undefined, undefined>, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<undefined, undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<undefined, undefined>>) => client_1) => import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, { [K_1 in keyof client_1]: client_1[K_1]; } & import("viem").WalletActions<undefined, undefined>>;
|
|
531
531
|
} | undefined;
|
|
532
532
|
isInstalledOnBrowser(): boolean;
|
|
533
533
|
fetchPublicAddress(opts?: FetchPublicAddressOpts): Promise<string | undefined>;
|
package/src/coinbase/coinbase.js
CHANGED
|
@@ -8,6 +8,7 @@ import { EthProviderHelper } from '../ethProviderHelper.js';
|
|
|
8
8
|
import { EthWalletConnector } from '../EthWalletConnector.js';
|
|
9
9
|
import '../walletConnect/walletConnect.js';
|
|
10
10
|
import { getCoinbaseProvider, fetchPublicAddress, signMessage, killCoinbaseSession } from './client/client.js';
|
|
11
|
+
import '@dynamic-labs/rpc-provider-ethereum';
|
|
11
12
|
|
|
12
13
|
class Coinbase extends EthWalletConnector {
|
|
13
14
|
constructor(_a) {
|
package/src/index.cjs
CHANGED
|
@@ -10,6 +10,7 @@ var fetchInjectedWalletConnectors = require('./injected/fetchInjectedWalletConne
|
|
|
10
10
|
require('./walletConnect/walletConnect.cjs');
|
|
11
11
|
var fetchWalletConnectWallets = require('./walletConnect/fetchWalletConnectWallets.cjs');
|
|
12
12
|
var coinbase = require('./coinbase/coinbase.cjs');
|
|
13
|
+
require('@dynamic-labs/rpc-provider-ethereum');
|
|
13
14
|
var EthWalletConnector = require('./EthWalletConnector.cjs');
|
|
14
15
|
var ethProviderHelper = require('./ethProviderHelper.cjs');
|
|
15
16
|
var constants = require('./constants.cjs');
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export { fetchInjectedWalletConnector, injectedWalletOverrides } from './injecte
|
|
|
7
7
|
import './walletConnect/walletConnect.js';
|
|
8
8
|
import { fetchWalletConnectWallets, getWalletConnectConnector } from './walletConnect/fetchWalletConnectWallets.js';
|
|
9
9
|
import { Coinbase } from './coinbase/coinbase.js';
|
|
10
|
+
import '@dynamic-labs/rpc-provider-ethereum';
|
|
10
11
|
export { EthWalletConnector } from './EthWalletConnector.js';
|
|
11
12
|
export { EthProviderHelper } from './ethProviderHelper.js';
|
|
12
13
|
export { INFURA_ID } from './constants.js';
|
|
@@ -267,6 +267,11 @@ class WalletConnect extends EthWalletConnector.EthWalletConnector {
|
|
|
267
267
|
error.code = 'connection_rejected';
|
|
268
268
|
if (WalletConnect.provider) {
|
|
269
269
|
WalletConnect.provider.uri = undefined;
|
|
270
|
+
// this is needed for mobile to work when using universal links.
|
|
271
|
+
// if the user cancels the connection, we need to re-initialize the provider
|
|
272
|
+
// so that the async work is done ahead of time, before the user tries to connect again,
|
|
273
|
+
// otherwise they will trigger the iOS bug where they are redirected to the app store
|
|
274
|
+
this.init();
|
|
270
275
|
}
|
|
271
276
|
reject(error);
|
|
272
277
|
});
|
|
@@ -62,20 +62,20 @@ export declare class WalletConnect extends EthWalletConnector {
|
|
|
62
62
|
type: string;
|
|
63
63
|
uid: string;
|
|
64
64
|
addChain: (args: import("viem").AddChainParameters) => Promise<void>;
|
|
65
|
-
deployContract: <const
|
|
65
|
+
deployContract: <const abi extends import("viem").Abi | readonly unknown[], chainOverride extends import("viem").Chain | undefined>(args: import("viem").DeployContractParameters<abi, undefined, undefined, chainOverride>) => Promise<`0x${string}`>;
|
|
66
66
|
getAddresses: () => Promise<import("viem").GetAddressesReturnType>;
|
|
67
67
|
getChainId: () => Promise<number>;
|
|
68
68
|
getPermissions: () => Promise<import("viem").GetPermissionsReturnType>;
|
|
69
|
-
prepareTransactionRequest: <
|
|
69
|
+
prepareTransactionRequest: <TParameterType extends import("viem").PrepareTransactionRequestParameterType, TChainOverride extends import("viem").Chain | undefined = undefined, TAccountOverride extends `0x${string}` | import("viem").Account | undefined = undefined>(args: import("viem").PrepareTransactionRequestParameters<undefined, undefined, TChainOverride, TAccountOverride, TParameterType>) => Promise<import("viem").PrepareTransactionRequestReturnType<import("viem").Chain, undefined, TChainOverride, TAccountOverride, TParameterType>>;
|
|
70
70
|
requestAddresses: () => Promise<import("viem").RequestAddressesReturnType>;
|
|
71
71
|
requestPermissions: (args: {
|
|
72
72
|
[x: string]: Record<string, any>;
|
|
73
73
|
eth_accounts: Record<string, any>;
|
|
74
74
|
}) => Promise<import("viem").RequestPermissionsReturnType>;
|
|
75
|
-
sendRawTransaction: (args: import("
|
|
76
|
-
sendTransaction: <
|
|
75
|
+
sendRawTransaction: (args: import("viem").SendRawTransactionParameters) => Promise<`0x${string}`>;
|
|
76
|
+
sendTransaction: <TChainOverride_1 extends import("viem").Chain | undefined = undefined>(args: import("viem").SendTransactionParameters<undefined, undefined, TChainOverride_1>) => Promise<`0x${string}`>;
|
|
77
77
|
signMessage: (args: import("viem").SignMessageParameters<undefined>) => Promise<`0x${string}`>;
|
|
78
|
-
signTransaction: <
|
|
78
|
+
signTransaction: <TChainOverride_2 extends import("viem").Chain | undefined>(args: import("viem").SignTransactionParameters<undefined, undefined, TChainOverride_2>) => Promise<`0x${string}`>;
|
|
79
79
|
signTypedData: <const TTypedData extends {
|
|
80
80
|
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
81
81
|
[x: `string[${string}]`]: undefined;
|
|
@@ -286,7 +286,7 @@ export declare class WalletConnect extends EthWalletConnector {
|
|
|
286
286
|
}, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, undefined>) => Promise<`0x${string}`>;
|
|
287
287
|
switchChain: (args: import("viem").SwitchChainParameters) => Promise<void>;
|
|
288
288
|
watchAsset: (args: import("viem").WatchAssetParams) => Promise<boolean>;
|
|
289
|
-
writeContract: <const
|
|
289
|
+
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, "pure" | "view", functionName>, TChainOverride_3 extends import("viem").Chain | undefined = undefined>(args: import("viem").WriteContractParameters<abi_1, functionName, args, undefined, undefined, TChainOverride_3>) => Promise<`0x${string}`>;
|
|
290
290
|
extend: <const client extends {
|
|
291
291
|
[x: string]: unknown;
|
|
292
292
|
account?: undefined;
|
|
@@ -300,7 +300,7 @@ export declare class WalletConnect extends EthWalletConnector {
|
|
|
300
300
|
transport?: undefined;
|
|
301
301
|
type?: undefined;
|
|
302
302
|
uid?: undefined;
|
|
303
|
-
} & Partial<Pick<import("viem").PublicActions, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<undefined, undefined>>) => client) => import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<undefined, undefined>>;
|
|
303
|
+
} & Partial<Pick<import("viem").PublicActions<import("viem").CustomTransport, undefined, undefined>, "getChainId" | "prepareTransactionRequest" | "sendRawTransaction" | "call" | "createContractEventFilter" | "createEventFilter" | "estimateContractGas" | "estimateGas" | "getBlock" | "getBlockNumber" | "getContractEvents" | "getEnsText" | "getFilterChanges" | "getGasPrice" | "getLogs" | "getTransaction" | "getTransactionCount" | "getTransactionReceipt" | "readContract" | "simulateContract" | "uninstallFilter" | "watchBlockNumber" | "watchContractEvent"> & Pick<import("viem").WalletActions<undefined, undefined>, "sendTransaction" | "writeContract">>>(fn: (client: import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, import("viem").WalletActions<undefined, undefined>>) => client) => import("viem").Client<import("viem").CustomTransport, undefined, undefined, import("viem").WalletRpcSchema, { [K in keyof client]: client[K]; } & import("viem").WalletActions<undefined, undefined>>;
|
|
304
304
|
} | undefined;
|
|
305
305
|
fetchPublicAddress(opts?: FetchPublicAddressOpts): Promise<string | undefined>;
|
|
306
306
|
/**
|
|
@@ -258,6 +258,11 @@ class WalletConnect extends EthWalletConnector {
|
|
|
258
258
|
error.code = 'connection_rejected';
|
|
259
259
|
if (WalletConnect.provider) {
|
|
260
260
|
WalletConnect.provider.uri = undefined;
|
|
261
|
+
// this is needed for mobile to work when using universal links.
|
|
262
|
+
// if the user cancels the connection, we need to re-initialize the provider
|
|
263
|
+
// so that the async work is done ahead of time, before the user tries to connect again,
|
|
264
|
+
// otherwise they will trigger the iOS bug where they are redirected to the app store
|
|
265
|
+
this.init();
|
|
261
266
|
}
|
|
262
267
|
reject(error);
|
|
263
268
|
});
|