@dynamic-labs/wallet-connector-core 4.0.0-alpha.19 → 4.0.0-alpha.20
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 +2 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +7 -7
- package/src/WalletConnectorBase/WalletConnectorBase.cjs +5 -0
- package/src/WalletConnectorBase/WalletConnectorBase.d.ts +4 -0
- package/src/WalletConnectorBase/WalletConnectorBase.js +5 -0
- package/src/WalletConnectorBase/types.d.ts +1 -2
package/CHANGELOG.md
CHANGED
package/package.cjs
CHANGED
package/package.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/wallet-connector-core",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.20",
|
|
4
4
|
"description": "Core package for utilities and types for handling multiple wallet/chain support Dynamic SDK",
|
|
5
5
|
"author": "Dynamic Labs, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@dynamic-labs/sdk-api-core": "0.0.559"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@dynamic-labs/assert-package-version": "4.0.0-alpha.
|
|
25
|
-
"@dynamic-labs/logger": "4.0.0-alpha.
|
|
26
|
-
"@dynamic-labs/rpc-providers": "4.0.0-alpha.
|
|
27
|
-
"@dynamic-labs/types": "4.0.0-alpha.
|
|
28
|
-
"@dynamic-labs/utils": "4.0.0-alpha.
|
|
29
|
-
"@dynamic-labs/wallet-book": "4.0.0-alpha.
|
|
24
|
+
"@dynamic-labs/assert-package-version": "4.0.0-alpha.20",
|
|
25
|
+
"@dynamic-labs/logger": "4.0.0-alpha.20",
|
|
26
|
+
"@dynamic-labs/rpc-providers": "4.0.0-alpha.20",
|
|
27
|
+
"@dynamic-labs/types": "4.0.0-alpha.20",
|
|
28
|
+
"@dynamic-labs/utils": "4.0.0-alpha.20",
|
|
29
|
+
"@dynamic-labs/wallet-book": "4.0.0-alpha.20",
|
|
30
30
|
"eventemitter3": "5.0.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -102,6 +102,7 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
|
|
|
102
102
|
this.isInitialized = true;
|
|
103
103
|
this.constructorProps = props;
|
|
104
104
|
this._walletBookInstance = WalletBookSingleton.WalletBookSingleton.getOrCreate(props.walletBook);
|
|
105
|
+
this._metadata = props.metadata;
|
|
105
106
|
this.walletConnectorEventsEmitter =
|
|
106
107
|
this.constructorProps.walletConnectorEventsEmitter ||
|
|
107
108
|
walletConnectorEvents.walletConnectorEvents;
|
|
@@ -286,6 +287,10 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
|
|
|
286
287
|
get key() {
|
|
287
288
|
return this.overrideKey || this.name.replace(/\W/g, '').toLowerCase();
|
|
288
289
|
}
|
|
290
|
+
get metadata() {
|
|
291
|
+
var _a;
|
|
292
|
+
return (_a = this._metadata) !== null && _a !== void 0 ? _a : { id: this.key };
|
|
293
|
+
}
|
|
289
294
|
/**
|
|
290
295
|
* Whether the wallet connector should fall back to a different wallet connector
|
|
291
296
|
* This is called after the object is instantiated, so it can't be a static property
|
|
@@ -4,6 +4,7 @@ import type { JwtVerifiedCredential, WalletAdditionalAddress } from '@dynamic-la
|
|
|
4
4
|
import { MobileExperience } from '@dynamic-labs/types';
|
|
5
5
|
import { WalletBookSchema, WalletSchema } from '@dynamic-labs/wallet-book';
|
|
6
6
|
import { WalletConnectorEventEmitter } from '../events';
|
|
7
|
+
import { WalletMetadata } from '../types';
|
|
7
8
|
import { WalletConstructor, WalletProps } from '../Wallet';
|
|
8
9
|
import { WalletBookSingleton } from '../WalletBookSingleton';
|
|
9
10
|
import { Chain, GetAddressOpts, InternalWalletConnector, NameServiceData, WalletConnectorEventTypes, WalletConnectorExtension } from './types';
|
|
@@ -20,6 +21,7 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
|
|
|
20
21
|
chainRpcProviders: IChainRpcProviders | undefined;
|
|
21
22
|
constructorProps: any;
|
|
22
23
|
_walletBookInstance: WalletBookSingleton;
|
|
24
|
+
_metadata: WalletMetadata | undefined;
|
|
23
25
|
walletConnectorEventsEmitter: WalletConnectorEventEmitter;
|
|
24
26
|
walletFallback: WalletSchema | undefined;
|
|
25
27
|
isGlobalTransaction: boolean;
|
|
@@ -31,6 +33,7 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
|
|
|
31
33
|
*/
|
|
32
34
|
constructor(props: {
|
|
33
35
|
walletBook: WalletBookSchema;
|
|
36
|
+
metadata?: WalletMetadata;
|
|
34
37
|
});
|
|
35
38
|
extend(extension: WalletConnectorExtension, settings?: {
|
|
36
39
|
walletConnectDappProjectId?: string;
|
|
@@ -217,6 +220,7 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
|
|
|
217
220
|
* Override key or the normalized wallet name if needed
|
|
218
221
|
*/
|
|
219
222
|
get key(): string;
|
|
223
|
+
get metadata(): WalletMetadata;
|
|
220
224
|
/**
|
|
221
225
|
* Wallet name
|
|
222
226
|
*/
|
|
@@ -94,6 +94,7 @@ class WalletConnectorBase extends EventEmitter {
|
|
|
94
94
|
this.isInitialized = true;
|
|
95
95
|
this.constructorProps = props;
|
|
96
96
|
this._walletBookInstance = WalletBookSingleton.getOrCreate(props.walletBook);
|
|
97
|
+
this._metadata = props.metadata;
|
|
97
98
|
this.walletConnectorEventsEmitter =
|
|
98
99
|
this.constructorProps.walletConnectorEventsEmitter ||
|
|
99
100
|
walletConnectorEvents;
|
|
@@ -278,6 +279,10 @@ class WalletConnectorBase extends EventEmitter {
|
|
|
278
279
|
get key() {
|
|
279
280
|
return this.overrideKey || this.name.replace(/\W/g, '').toLowerCase();
|
|
280
281
|
}
|
|
282
|
+
get metadata() {
|
|
283
|
+
var _a;
|
|
284
|
+
return (_a = this._metadata) !== null && _a !== void 0 ? _a : { id: this.key };
|
|
285
|
+
}
|
|
281
286
|
/**
|
|
282
287
|
* Whether the wallet connector should fall back to a different wallet connector
|
|
283
288
|
* This is called after the object is instantiated, so it can't be a static property
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter from 'eventemitter3';
|
|
2
|
-
import { WalletConnectorCore
|
|
2
|
+
import { WalletConnectorCore } from '../types';
|
|
3
3
|
export declare const Chains: readonly ["ETH", "FLOW", "SOL", "EVM", "ALGO", "STARK", "ATOM", "COSMOS", "BTC", "ECLIPSE"];
|
|
4
4
|
export type Chain = typeof Chains[number];
|
|
5
5
|
export declare const socialProviders: readonly ["google", "facebook", "apple", "github", "bitbucket", "gitlab", "linkedin", "twitter", "discord", "twitch", "microsoft"];
|
|
@@ -25,7 +25,6 @@ export type InternalWalletConnector = WalletConnectorCore.WalletConnector;
|
|
|
25
25
|
export type WalletConnector = Pick<InternalWalletConnector, 'canConnectViaCustodialService' | 'canConnectViaQrCode' | 'canConnectViaSocial' | 'chainRpcProviders' | 'connect' | 'connectedChain' | 'createWallet' | 'constructorProps' | 'endSession' | 'getAddress' | 'getAdditionalAddresses' | 'getConnectedAccounts' | 'getDeepLink' | 'getMobileOrInstalledWallet' | 'getNetwork' | 'getSession' | 'initEventListener' | 'isAvailable' | 'isEmbeddedWallet' | 'isInitialized' | 'isInstalledOnBrowser' | 'isTestnet' | 'isWalletConnect' | 'key' | 'name' | 'parseAddress' | 'proveOwnership' | 'providerResources' | 'supportedChains' | 'supportsNetworkSwitching' | 'switchNetwork' | 'switchNetworkOnlyFromWallet' | 'teardownEventListeners'> & EventEmitter<WalletConnectorEventTypes>;
|
|
26
26
|
export interface WalletConnectorConstructor {
|
|
27
27
|
new (props?: any): InternalWalletConnector;
|
|
28
|
-
metadata?: WalletMetadata;
|
|
29
28
|
}
|
|
30
29
|
export type WalletConnectorsMethod = (props?: any) => WalletConnectorConstructor[];
|
|
31
30
|
export type WalletConnectorEventTypes = {
|