@dynamic-labs/wallet-connector-core 3.4.3 → 3.4.5
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 +14 -0
- package/package.cjs +1 -1
- package/package.js +1 -1
- package/package.json +8 -8
- package/src/index.d.ts +1 -1
- package/src/lib/WalletConnector.cjs +9 -0
- package/src/lib/WalletConnector.d.ts +6 -1
- package/src/lib/WalletConnector.js +9 -0
- package/src/lib/types.d.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
|
|
2
|
+
### [3.4.5](https://github.com/dynamic-labs/DynamicAuth/compare/v3.4.4...v3.4.5) (2024-10-30)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* add support for epicgames social ([#7222](https://github.com/dynamic-labs/DynamicAuth/issues/7222)) ([f34f027](https://github.com/dynamic-labs/DynamicAuth/commit/f34f02738a4d163792ff457dfe053335a4d57328))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* show connect view when user selects a wallet to connect with ([#7211](https://github.com/dynamic-labs/DynamicAuth/issues/7211)) ([c7d3ab0](https://github.com/dynamic-labs/DynamicAuth/commit/c7d3ab00d4ced00128e0e7bde908165707a15a5c))
|
|
13
|
+
|
|
14
|
+
### [3.4.4](https://github.com/dynamic-labs/DynamicAuth/compare/v3.4.3...v3.4.4) (2024-10-24)
|
|
15
|
+
|
|
2
16
|
### [3.4.3](https://github.com/dynamic-labs/DynamicAuth/compare/v3.4.2...v3.4.3) (2024-10-23)
|
|
3
17
|
|
|
4
18
|
|
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": "3.4.
|
|
3
|
+
"version": "3.4.5",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"./package.json": "./package.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@dynamic-labs/sdk-api-core": "0.0.
|
|
29
|
+
"@dynamic-labs/sdk-api-core": "0.0.559"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@dynamic-labs/assert-package-version": "3.4.
|
|
33
|
-
"@dynamic-labs/logger": "3.4.
|
|
34
|
-
"@dynamic-labs/rpc-providers": "3.4.
|
|
35
|
-
"@dynamic-labs/types": "3.4.
|
|
36
|
-
"@dynamic-labs/utils": "3.4.
|
|
37
|
-
"@dynamic-labs/wallet-book": "3.4.
|
|
32
|
+
"@dynamic-labs/assert-package-version": "3.4.5",
|
|
33
|
+
"@dynamic-labs/logger": "3.4.5",
|
|
34
|
+
"@dynamic-labs/rpc-providers": "3.4.5",
|
|
35
|
+
"@dynamic-labs/types": "3.4.5",
|
|
36
|
+
"@dynamic-labs/utils": "3.4.5",
|
|
37
|
+
"@dynamic-labs/wallet-book": "3.4.5",
|
|
38
38
|
"eventemitter3": "5.0.1"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Chains, Wallet, WalletConnectorBase, socialProviders, type Attestation, type AuthenticatorRecoveryHandler, type AuthenticatorType, type BitcoinSignPsbtRequest, type BitcoinSignPsbtRequestSignature, type BitcoinSignPsbtResponse, type Chain, type ChainInfo, type ExportHandler, type ExtendedPrivateKey, type GetAddressOpts, type IAccountAbstractionWalletConnector, type IBitcoinWalletConnector, type ICoinbaseMPCWalletConnector, type IEmailOTPWalletConnector, type IEmailWalletConnector, type IHardwareWalletConnector, type ITurnkeyWalletConnector, type InternalWalletConnector, type IPasskeyWalletConnector, type IPhantomRedirectConnector, type IPhantomRedirectConnectorWithEvents, type ISMSWalletConnector, type ISendBalanceWalletConnector, type ISessionKeyCompatibleWalletConnector, type ITurnkeyWalletConnectorStamper, type IWalletConnectConnector, type NameServiceData, type PayloadParams, type RawPrivateKey, type RecoveryEmailParams, type RecoveryWebAuthnAttestation, type SignAllTransactionsListener, type SignAndSendTransactionListener, type SignMessageListener, type SignTransactionListener, type SocialProvider, type WalletConnector, type WalletConnectorConstructor, type WalletConnectorCore, type WalletConnectorEventTypes, type WalletConnectorsMethod, type WalletConstructor, type WalletProps, type WebAuthnAttestation, } from './lib';
|
|
1
|
+
export { Chains, Wallet, WalletConnectorBase, socialProviders, type Attestation, type AuthenticatorRecoveryHandler, type AuthenticatorType, type BitcoinSignPsbtRequest, type BitcoinSignPsbtRequestSignature, type BitcoinSignPsbtResponse, type Chain, type ChainInfo, type ExportHandler, type ExtendedPrivateKey, type GetAddressOpts, type IAccountAbstractionWalletConnector, type IBitcoinWalletConnector, type ICoinbaseMPCWalletConnector, type IEmailOTPWalletConnector, type IEmailWalletConnector, type IHardwareWalletConnector, type ITurnkeyWalletConnector, type InternalWalletConnector, type IPasskeyWalletConnector, type IPhantomRedirectConnector, type IPhantomRedirectConnectorWithEvents, type ISMSWalletConnector, type ISendBalanceWalletConnector, type ISessionKeyCompatibleWalletConnector, type ITurnkeyWalletConnectorStamper, type IWalletConnectConnector, type NameServiceData, type PayloadParams, type RawPrivateKey, type RecoveryEmailParams, type RecoveryWebAuthnAttestation, type SignAllTransactionsListener, type SignAndSendTransactionListener, type SignMessageListener, type SignTransactionListener, type SocialProvider, type WalletConnector, type WalletConnectorConstructor, type WalletConnectorCore, type WalletConnectorEventTypes, type WalletConnectorsMethod, type WalletConstructor, type WalletProps, type WebAuthnAttestation, type WalletMetadata, } from './lib';
|
|
2
2
|
export type { WalletConnectorExtension } from './lib/WalletConnectorExtension';
|
|
3
3
|
export { walletConnectorEvents } from './lib/events';
|
|
4
4
|
export type { AccountChangeEventHandler, ChainChangeEventHandler, DisconnectEventHandler, } from './types';
|
|
@@ -12,6 +12,7 @@ var isSameAddress = require('../utils/isSameAddress/isSameAddress.cjs');
|
|
|
12
12
|
var getMobileExperience = require('../utils/getMobileExperience/getMobileExperience.cjs');
|
|
13
13
|
var isConnectorMethodSupported = require('../utils/isConnectorMethodSupported/isConnectorMethodSupported.cjs');
|
|
14
14
|
var WalletBookSingleton = require('./WalletBookSingleton.cjs');
|
|
15
|
+
var walletConnectorEvents = require('./events/walletConnectorEvents.cjs');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
@@ -126,6 +127,10 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
|
|
|
126
127
|
this.isInitialized = true;
|
|
127
128
|
this.constructorProps = props;
|
|
128
129
|
this._walletBookInstance = WalletBookSingleton.WalletBookSingleton.getOrCreate(props.walletBook);
|
|
130
|
+
this._metadata = props.metadata;
|
|
131
|
+
this.walletConnectorEventsEmitter =
|
|
132
|
+
this.constructorProps.walletConnectorEventsEmitter ||
|
|
133
|
+
walletConnectorEvents.walletConnectorEvents;
|
|
129
134
|
if (this.walletBook === undefined) {
|
|
130
135
|
throw new Error('WalletConnectorBase was not called with super(props) and is missing wallet-book');
|
|
131
136
|
}
|
|
@@ -307,6 +312,10 @@ class WalletConnectorBase extends EventEmitter__default["default"] {
|
|
|
307
312
|
get key() {
|
|
308
313
|
return this.overrideKey || this.name.replace(/\W/g, '').toLowerCase();
|
|
309
314
|
}
|
|
315
|
+
get metadata() {
|
|
316
|
+
var _a;
|
|
317
|
+
return (_a = this._metadata) !== null && _a !== void 0 ? _a : { id: this.key };
|
|
318
|
+
}
|
|
310
319
|
/**
|
|
311
320
|
* Whether the wallet connector should fall back to a different wallet connector
|
|
312
321
|
* This is called after the object is instantiated, so it can't be a static property
|
|
@@ -5,8 +5,9 @@ import { IChainRpcProviders } from '@dynamic-labs/rpc-providers';
|
|
|
5
5
|
import { MobileExperience } from '@dynamic-labs/types';
|
|
6
6
|
import { WalletBookSingleton } from './WalletBookSingleton';
|
|
7
7
|
import { WalletConnectorExtension } from './WalletConnectorExtension';
|
|
8
|
-
import { WalletConnectorCore } from './types';
|
|
8
|
+
import { WalletConnectorCore, WalletMetadata } from './types';
|
|
9
9
|
import { WalletConstructor, WalletProps } from './wallets';
|
|
10
|
+
import { WalletConnectorEventEmitter } from './events';
|
|
10
11
|
export declare const Chains: readonly ["ETH", "FLOW", "SOL", "EVM", "ALGO", "STARK", "ATOM", "COSMOS", "BTC"];
|
|
11
12
|
export type Chain = typeof Chains[number];
|
|
12
13
|
export declare const socialProviders: readonly ["google", "facebook", "apple", "github", "bitbucket", "gitlab", "linkedin", "twitter", "discord", "twitch", "microsoft"];
|
|
@@ -56,6 +57,8 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
|
|
|
56
57
|
chainRpcProviders: IChainRpcProviders | undefined;
|
|
57
58
|
constructorProps: any;
|
|
58
59
|
_walletBookInstance: WalletBookSingleton;
|
|
60
|
+
_metadata: WalletMetadata | undefined;
|
|
61
|
+
walletConnectorEventsEmitter: WalletConnectorEventEmitter;
|
|
59
62
|
walletFallback: WalletSchema | undefined;
|
|
60
63
|
isGlobalTransaction: boolean;
|
|
61
64
|
/**
|
|
@@ -66,6 +69,7 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
|
|
|
66
69
|
*/
|
|
67
70
|
constructor(props: {
|
|
68
71
|
walletBook: WalletBookSchema;
|
|
72
|
+
metadata?: WalletMetadata;
|
|
69
73
|
});
|
|
70
74
|
extend(extension: WalletConnectorExtension): void;
|
|
71
75
|
didSetup: boolean;
|
|
@@ -250,6 +254,7 @@ export declare abstract class WalletConnectorBase<C extends WalletConstructor<an
|
|
|
250
254
|
* Override key or the normalized wallet name if needed
|
|
251
255
|
*/
|
|
252
256
|
get key(): string;
|
|
257
|
+
get metadata(): WalletMetadata;
|
|
253
258
|
/**
|
|
254
259
|
* Wallet name
|
|
255
260
|
*/
|
|
@@ -8,6 +8,7 @@ import { isSameAddress } from '../utils/isSameAddress/isSameAddress.js';
|
|
|
8
8
|
import { getMobileExperience } from '../utils/getMobileExperience/getMobileExperience.js';
|
|
9
9
|
import { isConnectorMethodSupported } from '../utils/isConnectorMethodSupported/isConnectorMethodSupported.js';
|
|
10
10
|
import { WalletBookSingleton } from './WalletBookSingleton.js';
|
|
11
|
+
import { walletConnectorEvents } from './events/walletConnectorEvents.js';
|
|
11
12
|
|
|
12
13
|
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
13
14
|
/* eslint-disable @typescript-eslint/no-namespace */
|
|
@@ -118,6 +119,10 @@ class WalletConnectorBase extends EventEmitter {
|
|
|
118
119
|
this.isInitialized = true;
|
|
119
120
|
this.constructorProps = props;
|
|
120
121
|
this._walletBookInstance = WalletBookSingleton.getOrCreate(props.walletBook);
|
|
122
|
+
this._metadata = props.metadata;
|
|
123
|
+
this.walletConnectorEventsEmitter =
|
|
124
|
+
this.constructorProps.walletConnectorEventsEmitter ||
|
|
125
|
+
walletConnectorEvents;
|
|
121
126
|
if (this.walletBook === undefined) {
|
|
122
127
|
throw new Error('WalletConnectorBase was not called with super(props) and is missing wallet-book');
|
|
123
128
|
}
|
|
@@ -299,6 +304,10 @@ class WalletConnectorBase extends EventEmitter {
|
|
|
299
304
|
get key() {
|
|
300
305
|
return this.overrideKey || this.name.replace(/\W/g, '').toLowerCase();
|
|
301
306
|
}
|
|
307
|
+
get metadata() {
|
|
308
|
+
var _a;
|
|
309
|
+
return (_a = this._metadata) !== null && _a !== void 0 ? _a : { id: this.key };
|
|
310
|
+
}
|
|
302
311
|
/**
|
|
303
312
|
* Whether the wallet connector should fall back to a different wallet connector
|
|
304
313
|
* This is called after the object is instantiated, so it can't be a static property
|
package/src/lib/types.d.ts
CHANGED
|
@@ -5,4 +5,11 @@ export type ChainInfo = {
|
|
|
5
5
|
name: string;
|
|
6
6
|
symbol: Chain;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* @property id - A key that can be used to identify the wallet/connector, based on the wallet name.
|
|
10
|
+
* Example: 'metamask', 'magiceden', 'phantom', etc
|
|
11
|
+
*/
|
|
12
|
+
export type WalletMetadata = {
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
8
15
|
export declare namespace WalletConnectorCore { }
|