@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 CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ ## [4.0.0-alpha.20](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.19...v4.0.0-alpha.20) (2024-10-30)
3
+
2
4
  ## [4.0.0-alpha.19](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.0-alpha.18...v4.0.0-alpha.19) (2024-10-29)
3
5
 
4
6
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.0.0-alpha.19";
6
+ var version = "4.0.0-alpha.20";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.0.0-alpha.19";
2
+ var version = "4.0.0-alpha.20";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-connector-core",
3
- "version": "4.0.0-alpha.19",
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.19",
25
- "@dynamic-labs/logger": "4.0.0-alpha.19",
26
- "@dynamic-labs/rpc-providers": "4.0.0-alpha.19",
27
- "@dynamic-labs/types": "4.0.0-alpha.19",
28
- "@dynamic-labs/utils": "4.0.0-alpha.19",
29
- "@dynamic-labs/wallet-book": "4.0.0-alpha.19",
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, WalletMetadata } from '../types';
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 = {