@dynamic-labs/starknet 2.1.0-alpha.31 → 2.1.0-alpha.32
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
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## [2.1.0-alpha.32](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.31...v2.1.0-alpha.32) (2024-06-04)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* favor base mainnet when using coinbase sdk ([#5834](https://github.com/dynamic-labs/DynamicAuth/issues/5834)) ([fee5294](https://github.com/dynamic-labs/DynamicAuth/commit/fee529461e6b033938d3ec044c139f5efcb24f6d))
|
|
8
|
+
* open OKX deep link for Bitcoin ([#5818](https://github.com/dynamic-labs/DynamicAuth/issues/5818)) ([c33e93c](https://github.com/dynamic-labs/DynamicAuth/commit/c33e93c81b384d8cd91b3bd0414dd9ea669405c4))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* change Bitget Wallet to Bitget ([#5824](https://github.com/dynamic-labs/DynamicAuth/issues/5824)) ([23b8813](https://github.com/dynamic-labs/DynamicAuth/commit/23b8813e233be07392f5a3e283226b238b9fd99b))
|
|
14
|
+
* coinbase isInstalled ([#5821](https://github.com/dynamic-labs/DynamicAuth/issues/5821)) ([d0e5a37](https://github.com/dynamic-labs/DynamicAuth/commit/d0e5a37c6dd0cb6b85a5704767c93d495aa22854))
|
|
15
|
+
* filter window.solana in solProviderHelper if no extensionLocators are set ([#5819](https://github.com/dynamic-labs/DynamicAuth/issues/5819)) ([ca098ad](https://github.com/dynamic-labs/DynamicAuth/commit/ca098adb787365f9969c1a1f853d3c65ddd40d54))
|
|
16
|
+
* only send ordinal address if only one address retrieved from btc wallet ([#5817](https://github.com/dynamic-labs/DynamicAuth/issues/5817)) ([d54cef4](https://github.com/dynamic-labs/DynamicAuth/commit/d54cef424368b804fde0a4e607fefce22877a304))
|
|
17
|
+
|
|
2
18
|
## [2.1.0-alpha.31](https://github.com/dynamic-labs/DynamicAuth/compare/v2.1.0-alpha.30...v2.1.0-alpha.31) (2024-05-31)
|
|
3
19
|
|
|
4
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/starknet",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.32",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"text-encoding": "0.7.0",
|
|
32
32
|
"starknetkit": "1.1.3",
|
|
33
33
|
"@dynamic-labs/sdk-api-core": "0.0.453",
|
|
34
|
-
"@dynamic-labs/rpc-provider-starknet": "2.1.0-alpha.
|
|
35
|
-
"@dynamic-labs/utils": "2.1.0-alpha.
|
|
36
|
-
"@dynamic-labs/wallet-book": "2.1.0-alpha.
|
|
37
|
-
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.
|
|
34
|
+
"@dynamic-labs/rpc-provider-starknet": "2.1.0-alpha.32",
|
|
35
|
+
"@dynamic-labs/utils": "2.1.0-alpha.32",
|
|
36
|
+
"@dynamic-labs/wallet-book": "2.1.0-alpha.32",
|
|
37
|
+
"@dynamic-labs/wallet-connector-core": "2.1.0-alpha.32"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {}
|
|
40
40
|
}
|
|
@@ -28,6 +28,9 @@ class StarknetWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
28
28
|
this.chainRpcProviders = opts.chainRpcProviders;
|
|
29
29
|
(_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerStarknetProviders();
|
|
30
30
|
}
|
|
31
|
+
get walletBookWallet() {
|
|
32
|
+
return this.walletBook.wallets[this.key];
|
|
33
|
+
}
|
|
31
34
|
// abstracting this method to a function due to some wallets (bitget)
|
|
32
35
|
// having non-standard use of the isConnected flag. This allows for us to use other flags to determine connectivity
|
|
33
36
|
isProviderConnected() {
|
|
@@ -85,6 +88,16 @@ class StarknetWalletConnector extends walletConnectorCore.WalletConnectorBase {
|
|
|
85
88
|
getAddress() {
|
|
86
89
|
return _tslib.__awaiter(this, void 0, void 0, function* () {
|
|
87
90
|
const wallet = this.getWallet();
|
|
91
|
+
if (!this.isInstalledOnBrowser() &&
|
|
92
|
+
utils.isMobile() &&
|
|
93
|
+
this.walletBookWallet.mobile &&
|
|
94
|
+
this.walletBookWallet.mobile.inAppBrowser) {
|
|
95
|
+
const inAppBrowserCompiledTemplate = utils.template(this.walletBookWallet.mobile.inAppBrowser);
|
|
96
|
+
const deepLink = inAppBrowserCompiledTemplate({
|
|
97
|
+
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
98
|
+
});
|
|
99
|
+
window.location.assign(deepLink);
|
|
100
|
+
}
|
|
88
101
|
if (wallet && !this.isProviderConnected()) {
|
|
89
102
|
yield (wallet === null || wallet === void 0 ? void 0 : wallet.isPreauthorized());
|
|
90
103
|
yield this.connect();
|
|
@@ -28,6 +28,60 @@ declare abstract class StarknetWalletConnector extends WalletConnectorBase {
|
|
|
28
28
|
starknetNetworks: NetworkConfiguration[];
|
|
29
29
|
walletBook: WalletBookSchema;
|
|
30
30
|
});
|
|
31
|
+
get walletBookWallet(): {
|
|
32
|
+
name: string;
|
|
33
|
+
brand?: {
|
|
34
|
+
alt?: string | undefined;
|
|
35
|
+
primaryColor?: string | undefined;
|
|
36
|
+
spriteId?: string | undefined;
|
|
37
|
+
} | undefined;
|
|
38
|
+
chainGroup?: string | undefined;
|
|
39
|
+
chains?: string[] | undefined;
|
|
40
|
+
desktop?: {
|
|
41
|
+
chromeId?: string | undefined;
|
|
42
|
+
edgeId?: string | undefined;
|
|
43
|
+
firefoxId?: string | undefined;
|
|
44
|
+
native?: string | undefined;
|
|
45
|
+
operaId?: string | undefined;
|
|
46
|
+
safariId?: string | undefined;
|
|
47
|
+
universal?: string | undefined;
|
|
48
|
+
} | undefined;
|
|
49
|
+
eip6963Config?: {
|
|
50
|
+
rdns: string;
|
|
51
|
+
} | undefined;
|
|
52
|
+
filterFromWalletConnect?: boolean | undefined;
|
|
53
|
+
group?: string | undefined;
|
|
54
|
+
hardwareWallets?: string[] | undefined;
|
|
55
|
+
injectedConfig?: {
|
|
56
|
+
chain: string;
|
|
57
|
+
extensionLocators: {
|
|
58
|
+
value: boolean;
|
|
59
|
+
flag: string;
|
|
60
|
+
}[];
|
|
61
|
+
providerInterface?: string | undefined;
|
|
62
|
+
walletStandard?: {
|
|
63
|
+
features: string[];
|
|
64
|
+
name: string;
|
|
65
|
+
} | undefined;
|
|
66
|
+
windowLocations?: string[] | undefined;
|
|
67
|
+
}[] | undefined;
|
|
68
|
+
mobile?: {
|
|
69
|
+
android?: string | null | undefined;
|
|
70
|
+
androidId?: string | undefined;
|
|
71
|
+
inAppBrowser?: string | null | undefined;
|
|
72
|
+
ios?: string | null | undefined;
|
|
73
|
+
iosId?: string | undefined;
|
|
74
|
+
native?: string | undefined;
|
|
75
|
+
universal?: string | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
shortName?: string | undefined;
|
|
78
|
+
showOnlyIfInstalled?: boolean | undefined;
|
|
79
|
+
switchNetworkOnlyFromWallet?: boolean | undefined;
|
|
80
|
+
walletConnect?: {
|
|
81
|
+
sdks?: string[] | undefined;
|
|
82
|
+
} | undefined;
|
|
83
|
+
walletGroup?: string | undefined;
|
|
84
|
+
};
|
|
31
85
|
isProviderConnected(): boolean;
|
|
32
86
|
getPublicClient(): Promise<RpcProvider | undefined>;
|
|
33
87
|
/**
|
|
@@ -3,7 +3,7 @@ import { __awaiter } from '../_virtual/_tslib.js';
|
|
|
3
3
|
import { getStarknet } from 'get-starknet-core';
|
|
4
4
|
import { Contract, cairo, constants } from 'starknet';
|
|
5
5
|
import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
|
|
6
|
-
import { DynamicError, retryableFn } from '@dynamic-labs/utils';
|
|
6
|
+
import { isMobile, template, DynamicError, retryableFn } from '@dynamic-labs/utils';
|
|
7
7
|
import { ETH_STARKNET_ADDRESS } from './constants.js';
|
|
8
8
|
import ETH_CONTRACT_ABI from './ethereumContractAbi.js';
|
|
9
9
|
import { formatTypedDataMessage } from './utils/convertors.js';
|
|
@@ -24,6 +24,9 @@ class StarknetWalletConnector extends WalletConnectorBase {
|
|
|
24
24
|
this.chainRpcProviders = opts.chainRpcProviders;
|
|
25
25
|
(_a = this.chainRpcProviders) === null || _a === void 0 ? void 0 : _a.registerStarknetProviders();
|
|
26
26
|
}
|
|
27
|
+
get walletBookWallet() {
|
|
28
|
+
return this.walletBook.wallets[this.key];
|
|
29
|
+
}
|
|
27
30
|
// abstracting this method to a function due to some wallets (bitget)
|
|
28
31
|
// having non-standard use of the isConnected flag. This allows for us to use other flags to determine connectivity
|
|
29
32
|
isProviderConnected() {
|
|
@@ -81,6 +84,16 @@ class StarknetWalletConnector extends WalletConnectorBase {
|
|
|
81
84
|
getAddress() {
|
|
82
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
86
|
const wallet = this.getWallet();
|
|
87
|
+
if (!this.isInstalledOnBrowser() &&
|
|
88
|
+
isMobile() &&
|
|
89
|
+
this.walletBookWallet.mobile &&
|
|
90
|
+
this.walletBookWallet.mobile.inAppBrowser) {
|
|
91
|
+
const inAppBrowserCompiledTemplate = template(this.walletBookWallet.mobile.inAppBrowser);
|
|
92
|
+
const deepLink = inAppBrowserCompiledTemplate({
|
|
93
|
+
encodedDappURI: encodeURIComponent(window.location.toString()),
|
|
94
|
+
});
|
|
95
|
+
window.location.assign(deepLink);
|
|
96
|
+
}
|
|
84
97
|
if (wallet && !this.isProviderConnected()) {
|
|
85
98
|
yield (wallet === null || wallet === void 0 ? void 0 : wallet.isPreauthorized());
|
|
86
99
|
yield this.connect();
|