@dynamic-labs/ethereum 2.1.0-alpha.26 → 2.1.0-alpha.28
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.json +8 -8
- package/src/coinbase/coinbase.cjs +8 -3
- package/src/coinbase/coinbase.js +8 -3
- package/src/coinbase/helpers.cjs +12 -6
- package/src/coinbase/helpers.js +12 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.28](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.27...v2.1.0-alpha.28) (2024-05-29)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* adds solana standard wallet connector ([#5752](https://github.com/dynamic-labs/DynamicAuth/issues/5752)) ([0040940](https://github.com/dynamic-labs/DynamicAuth/commit/0040940fd1adb37ab3106bb0e4dfe79403bc41f2))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* farcaster fetch url fix ([#5767](https://github.com/dynamic-labs/DynamicAuth/issues/5767)) ([1408ba9](https://github.com/dynamic-labs/DynamicAuth/commit/1408ba92680363b9db7820a63d5e3d15dc26ad22))
|
|
13
|
+
|
|
14
|
+
## [2.1.0-alpha.27](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.26...v2.1.0-alpha.27) (2024-05-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* coinbase connection ([#5764](https://github.com/dynamic-labs/DynamicAuth/issues/5764)) ([aeacd1c](https://github.com/dynamic-labs/DynamicAuth/commit/aeacd1c55dc471fbf8c14eb05ab356b0a90aa239))
|
|
20
|
+
|
|
2
21
|
## [2.1.0-alpha.26](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.25...v2.1.0-alpha.26) (2024-05-29)
|
|
3
22
|
|
|
4
23
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/ethereum",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.28",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@walletconnect/ethereum-provider": "2.11.2",
|
|
32
32
|
"eventemitter3": "5.0.1",
|
|
33
33
|
"buffer": "6.0.3",
|
|
34
|
-
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.
|
|
35
|
-
"@dynamic-labs/turnkey": "2.1.0-alpha.
|
|
36
|
-
"@dynamic-labs/types": "2.1.0-alpha.
|
|
37
|
-
"@dynamic-labs/utils": "2.1.0-alpha.
|
|
38
|
-
"@dynamic-labs/viem-utils": "2.1.0-alpha.
|
|
39
|
-
"@dynamic-labs/wallet-book": "2.1.0-alpha.
|
|
40
|
-
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.
|
|
34
|
+
"@dynamic-labs/rpc-provider-ethereum": "2.1.0-alpha.28",
|
|
35
|
+
"@dynamic-labs/turnkey": "2.1.0-alpha.28",
|
|
36
|
+
"@dynamic-labs/types": "2.1.0-alpha.28",
|
|
37
|
+
"@dynamic-labs/utils": "2.1.0-alpha.28",
|
|
38
|
+
"@dynamic-labs/viem-utils": "2.1.0-alpha.28",
|
|
39
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.28",
|
|
40
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.28",
|
|
41
41
|
"stream": "0.0.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -30,9 +30,14 @@ class Coinbase extends EthWalletConnector.EthWalletConnector {
|
|
|
30
30
|
}
|
|
31
31
|
getConnectedAccounts() {
|
|
32
32
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
try {
|
|
34
|
+
return yield this.coinbaseProvider.request({
|
|
35
|
+
method: 'eth_accounts',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
43
|
getAddress() {
|
package/src/coinbase/coinbase.js
CHANGED
|
@@ -26,9 +26,14 @@ class Coinbase extends EthWalletConnector {
|
|
|
26
26
|
}
|
|
27
27
|
getConnectedAccounts() {
|
|
28
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
try {
|
|
30
|
+
return yield this.coinbaseProvider.request({
|
|
31
|
+
method: 'eth_accounts',
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
32
37
|
});
|
|
33
38
|
}
|
|
34
39
|
getAddress() {
|
package/src/coinbase/helpers.cjs
CHANGED
|
@@ -8,14 +8,20 @@ var walletSdk = require('@coinbase/wallet-sdk');
|
|
|
8
8
|
// storing a reference to the coinbase provider because the provider methods work better when
|
|
9
9
|
// they are called on the same instance
|
|
10
10
|
let coinbaseProvider;
|
|
11
|
-
const getCoinbaseProvider = ({ opts: { appLogoUrl, appName, walletPreference } = {}, }) => {
|
|
11
|
+
const getCoinbaseProvider = ({ opts: { appLogoUrl, appName, evmNetworks, walletPreference } = {}, }) => {
|
|
12
|
+
// favoring base sepolia since that is the only chain that works for now
|
|
13
|
+
// when coinbase launches in mainnet, customers can simply disable the base sepolia chain
|
|
14
|
+
// from their dynamic settings, and everything will still work
|
|
15
|
+
const hasBaseSepolia = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.some((network) => network.chainId === 84532);
|
|
16
|
+
const appChainIds = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.map((network) => Number(network.chainId));
|
|
17
|
+
if (hasBaseSepolia) {
|
|
18
|
+
// just brings base sepolia to the front, because that is the chain that the coinbase
|
|
19
|
+
// provider returns when calling getNetwork
|
|
20
|
+
appChainIds === null || appChainIds === void 0 ? void 0 : appChainIds.sort((a, b) => (a === 84532 ? -1 : b === 84532 ? 1 : 0));
|
|
21
|
+
}
|
|
12
22
|
if (!coinbaseProvider) {
|
|
13
23
|
const coinbaseSdk = new walletSdk.CoinbaseWalletSDK({
|
|
14
|
-
appChainIds
|
|
15
|
-
// hard code to work on base sepolia for now
|
|
16
|
-
84532,
|
|
17
|
-
// ...evmNetworks?.map((network) => Number(network.chainId)),
|
|
18
|
-
],
|
|
24
|
+
appChainIds,
|
|
19
25
|
appLogoUrl,
|
|
20
26
|
appName,
|
|
21
27
|
});
|
package/src/coinbase/helpers.js
CHANGED
|
@@ -4,14 +4,20 @@ import { CoinbaseWalletSDK } from '@coinbase/wallet-sdk';
|
|
|
4
4
|
// storing a reference to the coinbase provider because the provider methods work better when
|
|
5
5
|
// they are called on the same instance
|
|
6
6
|
let coinbaseProvider;
|
|
7
|
-
const getCoinbaseProvider = ({ opts: { appLogoUrl, appName, walletPreference } = {}, }) => {
|
|
7
|
+
const getCoinbaseProvider = ({ opts: { appLogoUrl, appName, evmNetworks, walletPreference } = {}, }) => {
|
|
8
|
+
// favoring base sepolia since that is the only chain that works for now
|
|
9
|
+
// when coinbase launches in mainnet, customers can simply disable the base sepolia chain
|
|
10
|
+
// from their dynamic settings, and everything will still work
|
|
11
|
+
const hasBaseSepolia = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.some((network) => network.chainId === 84532);
|
|
12
|
+
const appChainIds = evmNetworks === null || evmNetworks === void 0 ? void 0 : evmNetworks.map((network) => Number(network.chainId));
|
|
13
|
+
if (hasBaseSepolia) {
|
|
14
|
+
// just brings base sepolia to the front, because that is the chain that the coinbase
|
|
15
|
+
// provider returns when calling getNetwork
|
|
16
|
+
appChainIds === null || appChainIds === void 0 ? void 0 : appChainIds.sort((a, b) => (a === 84532 ? -1 : b === 84532 ? 1 : 0));
|
|
17
|
+
}
|
|
8
18
|
if (!coinbaseProvider) {
|
|
9
19
|
const coinbaseSdk = new CoinbaseWalletSDK({
|
|
10
|
-
appChainIds
|
|
11
|
-
// hard code to work on base sepolia for now
|
|
12
|
-
84532,
|
|
13
|
-
// ...evmNetworks?.map((network) => Number(network.chainId)),
|
|
14
|
-
],
|
|
20
|
+
appChainIds,
|
|
15
21
|
appLogoUrl,
|
|
16
22
|
appName,
|
|
17
23
|
});
|