@dynamic-labs/wallet-connector-core 4.0.0-alpha.5 → 4.0.0-alpha.51
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 +468 -0
- package/package.cjs +8 -0
- package/package.js +4 -0
- package/package.json +9 -16
- package/src/{lib/wallets/Wallet → Wallet}/Wallet.cjs +6 -6
- package/src/{lib/wallets/Wallet → Wallet}/Wallet.d.ts +6 -2
- package/src/{lib/wallets/Wallet → Wallet}/Wallet.js +6 -6
- package/src/{lib → WalletBookSingleton}/WalletBookSingleton.cjs +3 -0
- package/src/{lib → WalletBookSingleton}/WalletBookSingleton.d.ts +1 -0
- package/src/{lib → WalletBookSingleton}/WalletBookSingleton.js +3 -0
- package/src/WalletBookSingleton/index.d.ts +1 -0
- package/src/{lib/WalletConnector.cjs → WalletConnectorBase/WalletConnectorBase.cjs} +21 -38
- package/src/{lib/WalletConnector.d.ts → WalletConnectorBase/WalletConnectorBase.d.ts} +16 -45
- package/src/{lib/WalletConnector.js → WalletConnectorBase/WalletConnectorBase.js} +22 -37
- package/src/WalletConnectorBase/index.d.ts +2 -0
- package/src/WalletConnectorBase/types.cjs +33 -0
- package/src/WalletConnectorBase/types.d.ts +54 -0
- package/src/WalletConnectorBase/types.js +28 -0
- package/src/events/index.d.ts +1 -0
- package/src/events/walletConnectorEvents.cjs +14 -0
- package/src/events/walletConnectorEvents.d.ts +34 -0
- package/src/events/walletConnectorEvents.js +6 -0
- package/src/index.cjs +25 -7
- package/src/index.d.ts +7 -4
- package/src/index.js +14 -2
- package/src/{lib → interfaces}/IAccountAbstractionWalletConnector.d.ts +11 -2
- package/src/{lib → interfaces}/IBitcoinWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/ICoinbaseMPCWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/IEmailWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/IHardwareWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/IPasskeyWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/IPhantomRedirectConnector.d.ts +1 -1
- package/src/{lib → interfaces}/ISMSWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/ISendBalanceWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/ISessionKeyCompatibleWalletConnector.d.ts +1 -1
- package/src/{lib → interfaces}/ITurnkeyWalletConnector.d.ts +1 -1
- package/src/interfaces/ITurnkeyWalletConnectorStamper.d.ts +35 -0
- package/src/{lib → interfaces}/IWalletConnectConnector.d.ts +1 -1
- package/src/{lib → interfaces}/index.d.ts +7 -10
- package/src/types.d.ts +88 -0
- package/src/utils/convertWalletToBaseWallet/convertWalletToBaseWallet.cjs +24 -0
- package/src/utils/convertWalletToBaseWallet/convertWalletToBaseWallet.d.ts +4 -0
- package/src/utils/convertWalletToBaseWallet/convertWalletToBaseWallet.js +19 -0
- package/src/utils/convertWalletToBaseWallet/index.d.ts +1 -0
- package/src/utils/eventListenerHandlers.d.ts +1 -1
- package/src/utils/getChainInfo/getChainInfo.cjs +4 -4
- package/src/utils/getChainInfo/getChainInfo.d.ts +2 -2
- package/src/utils/getChainInfo/getChainInfo.js +4 -4
- package/src/utils/getWalletConnectorByKey.d.ts +1 -1
- package/src/utils/getWalletLinks/getWalletLinks.cjs +32 -0
- package/src/utils/getWalletLinks/getWalletLinks.d.ts +2 -0
- package/src/utils/getWalletLinks/getWalletLinks.js +28 -0
- package/src/utils/getWalletLinks/index.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/getDeepLinks.cjs +36 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/getDeepLinks.d.ts +6 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/getDeepLinks.js +32 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDeepLinks/index.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/getDownloadLinks.cjs +36 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/getDownloadLinks.d.ts +3 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/getDownloadLinks.js +32 -0
- package/src/utils/getWalletMetadataFromWalletBook/getDownloadLinks/index.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/getIconUrl.cjs +15 -0
- package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/getIconUrl.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/getIconUrl.js +11 -0
- package/src/utils/getWalletMetadataFromWalletBook/getIconUrl/index.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/getValidHexColor.cjs +15 -0
- package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/getValidHexColor.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/getValidHexColor.js +11 -0
- package/src/utils/getWalletMetadataFromWalletBook/getValidHexColor/index.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/getWalletLimitations.cjs +19 -0
- package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/getWalletLimitations.d.ts +3 -0
- package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/getWalletLimitations.js +15 -0
- package/src/utils/getWalletMetadataFromWalletBook/getWalletLimitations/index.d.ts +1 -0
- package/src/utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.cjs +54 -0
- package/src/utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.d.ts +10 -0
- package/src/utils/getWalletMetadataFromWalletBook/getWalletMetadataFromWalletBook.js +50 -0
- package/src/utils/getWalletMetadataFromWalletBook/index.d.ts +1 -0
- package/src/utils/index.d.ts +5 -0
- package/src/utils/isAccountAbstractionConnector/isAccountAbstractionConnector.d.ts +1 -1
- package/src/utils/isBitcoinConnector/isBitcoinConnector.d.ts +1 -1
- package/src/utils/isBloctoConnector/isBloctoConnector.d.ts +1 -1
- package/src/utils/isCoinbaseMpcWalletConnector/isCoinbaseMpcWalletConnector.d.ts +1 -1
- package/src/utils/isConnectorEventSupported/index.d.ts +1 -0
- package/src/utils/isConnectorEventSupported/isConnectorEventSupported.cjs +11 -0
- package/src/utils/isConnectorEventSupported/isConnectorEventSupported.d.ts +3 -0
- package/src/utils/isConnectorEventSupported/isConnectorEventSupported.js +7 -0
- package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.cjs +2 -5
- package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.d.ts +3 -3
- package/src/utils/isConnectorMethodSupported/isConnectorMethodSupported.js +2 -5
- package/src/utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.d.ts +1 -1
- package/src/utils/isEmailWalletConnector/isEmailWalletConnector.d.ts +1 -1
- package/src/utils/isEmbeddedConnector/isEmbeddedConnector.d.ts +1 -1
- package/src/utils/isHardwareWalletConnector/isHardwareWalletConnector.d.ts +1 -1
- package/src/utils/isMagicConnector/isMagicConnector.d.ts +1 -1
- package/src/utils/isPasskeyWalletConnector/isPasskeyWalletConnector.d.ts +1 -1
- package/src/utils/isPhantomRedirectConnector/isPhantomRedirectConnector.d.ts +1 -1
- package/src/utils/isSendBalanceWalletConnector/isSendBalanceWalletConnector.cjs +2 -1
- package/src/utils/isSendBalanceWalletConnector/isSendBalanceWalletConnector.d.ts +2 -2
- package/src/utils/isSendBalanceWalletConnector/isSendBalanceWalletConnector.js +2 -1
- package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWallet/isSessionKeyCompatibleWallet.d.ts +1 -1
- package/src/utils/isSessionKeyCompatible/isSessionKeyCompatibleWalletConnector/isSessionKeyCompatibleWalletConnector.d.ts +2 -2
- package/src/utils/isSocialWalletConnector/isSocialWalletConnector.d.ts +1 -1
- package/src/utils/isTurnkeyWalletConnector/isTurnkeyWalletConnector.d.ts +1 -1
- package/src/utils/isWalletConnectConnector/isWalletConnectConnector.d.ts +1 -1
- package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.cjs +3 -3
- package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.d.ts +3 -3
- package/src/utils/walletConnectDeepLinks/performPlatformSpecificConnectionMethod.js +3 -3
- package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.cjs +11 -8
- package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.d.ts +3 -3
- package/src/utils/walletConnectDeepLinks/walletConnectDeepLinks.js +11 -8
- package/src/lib/ITurnkeyWalletConnectorStamper.d.ts +0 -18
- package/src/lib/WalletConnectorExtension.d.ts +0 -7
- package/src/lib/types.d.ts +0 -8
- package/src/lib/wallets/index.d.ts +0 -1
- /package/src/{lib/wallets/Wallet → Wallet}/index.d.ts +0 -0
- /package/src/{lib → interfaces}/IEmailOTPWalletConnector.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IUITransaction } from '@dynamic-labs/types';
|
|
2
|
-
import {
|
|
2
|
+
import { EcdsaValidatorOptions, ProviderEntryPointVersionEnum, ProviderKernelVersionEnum } from '@dynamic-labs/sdk-api-core';
|
|
3
|
+
import { WalletConnector, WalletConnectorBase } from '../WalletConnectorBase';
|
|
3
4
|
type GetAccountAbstractionProviderProps = {
|
|
4
5
|
withSponsorship?: boolean;
|
|
5
6
|
};
|
|
@@ -8,11 +9,19 @@ export interface IAccountAbstractionWalletConnector extends WalletConnectorBase
|
|
|
8
9
|
disableGasSponsorshipOnce(): void;
|
|
9
10
|
getAccountAbstractionProvider<T>(props?: GetAccountAbstractionProviderProps): T;
|
|
10
11
|
getAccountAbstractionProvider(props?: GetAccountAbstractionProviderProps): unknown;
|
|
11
|
-
setEoaConnector(connector: WalletConnectorBase): Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* @deprecated You should get the EOA connector by passing the SCW wallet to getEOAConnector,
|
|
14
14
|
* from the useSmartWallet hook
|
|
15
15
|
*/
|
|
16
16
|
getEOAConnector(): WalletConnector | undefined;
|
|
17
|
+
registerEoa({ smartWalletAddress, eoaAddress, eoaConnector, shouldSetEoaConnector, ecdsaProviderType, entryPointVersion, kernelVersion, }: {
|
|
18
|
+
smartWalletAddress: string;
|
|
19
|
+
eoaAddress: string;
|
|
20
|
+
eoaConnector: WalletConnectorBase;
|
|
21
|
+
shouldSetEoaConnector?: boolean;
|
|
22
|
+
ecdsaProviderType?: EcdsaValidatorOptions;
|
|
23
|
+
entryPointVersion?: ProviderEntryPointVersionEnum;
|
|
24
|
+
kernelVersion?: ProviderKernelVersionEnum;
|
|
25
|
+
}): Promise<void>;
|
|
17
26
|
}
|
|
18
27
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WalletConnectorBase } from '
|
|
1
|
+
import { WalletConnectorBase } from '../WalletConnectorBase';
|
|
2
2
|
export interface ISMSWalletConnector extends WalletConnectorBase {
|
|
3
3
|
get phone(): string | undefined | null;
|
|
4
4
|
setPhone(phone: ISMSWalletConnector['phone']): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransactionReceipt, IUITransaction } from '@dynamic-labs/types';
|
|
2
|
-
import { WalletConnectorBase } from '
|
|
2
|
+
import { WalletConnectorBase } from '../WalletConnectorBase';
|
|
3
3
|
export interface ISendBalanceWalletConnector extends WalletConnectorBase {
|
|
4
4
|
createUiTransaction(from: string): Promise<IUITransaction>;
|
|
5
5
|
confirmTransactionStatus?(txHash: string): Promise<TransactionReceipt>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JwtVerifiedCredential, TurnkeyWalletProperties } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
import { WalletConnectorBase } from '
|
|
2
|
+
import { WalletConnectorBase } from '../WalletConnectorBase';
|
|
3
3
|
type JwtVerifiedCredentialWithSmartWalletRef = JwtVerifiedCredential & {
|
|
4
4
|
smartWalletRefId?: string;
|
|
5
5
|
smartWalletRefAddress?: string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { WalletConnectorBase } from '../WalletConnectorBase';
|
|
2
|
+
export interface ITurnkeyWalletConnectorStamper extends WalletConnectorBase {
|
|
3
|
+
stampCreateWalletAccountRequest: ({ request, }: {
|
|
4
|
+
request: {
|
|
5
|
+
type: string;
|
|
6
|
+
timestampMs: string;
|
|
7
|
+
organizationId: string;
|
|
8
|
+
parameters: any;
|
|
9
|
+
};
|
|
10
|
+
}) => Promise<{
|
|
11
|
+
body: string;
|
|
12
|
+
url: string;
|
|
13
|
+
stamp: {
|
|
14
|
+
stampHeaderName: string;
|
|
15
|
+
stampHeaderValue: string;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
stampDeleteSubOrganizationRequest: ({ request, }: {
|
|
19
|
+
request: {
|
|
20
|
+
type: string;
|
|
21
|
+
timestampMs: string;
|
|
22
|
+
organizationId: string;
|
|
23
|
+
parameters: {
|
|
24
|
+
deleteWithoutExport?: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}) => Promise<{
|
|
28
|
+
body: string;
|
|
29
|
+
url: string;
|
|
30
|
+
stamp: {
|
|
31
|
+
stampHeaderName: string;
|
|
32
|
+
stampHeaderValue: string;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
export * from './IEmailOTPWalletConnector';
|
|
2
|
-
export * from './IEmailWalletConnector';
|
|
3
|
-
export * from './WalletConnector';
|
|
4
|
-
export * from './types';
|
|
5
|
-
export * from './IPasskeyWalletConnector';
|
|
6
|
-
export * from './ITurnkeyWalletConnector';
|
|
7
|
-
export * from './ITurnkeyWalletConnectorStamper';
|
|
8
1
|
export * from './IAccountAbstractionWalletConnector';
|
|
9
2
|
export * from './IBitcoinWalletConnector';
|
|
3
|
+
export * from './ICoinbaseMPCWalletConnector';
|
|
4
|
+
export * from './IEmailOTPWalletConnector';
|
|
5
|
+
export * from './IEmailWalletConnector';
|
|
10
6
|
export * from './IHardwareWalletConnector';
|
|
7
|
+
export * from './IPasskeyWalletConnector';
|
|
11
8
|
export * from './IPhantomRedirectConnector';
|
|
12
|
-
export * from './ICoinbaseMPCWalletConnector';
|
|
13
|
-
export * from './IWalletConnectConnector';
|
|
14
9
|
export * from './ISendBalanceWalletConnector';
|
|
15
10
|
export * from './ISessionKeyCompatibleWalletConnector';
|
|
16
11
|
export * from './ISMSWalletConnector';
|
|
17
|
-
export * from './
|
|
12
|
+
export * from './ITurnkeyWalletConnector';
|
|
13
|
+
export * from './ITurnkeyWalletConnectorStamper';
|
|
14
|
+
export * from './IWalletConnectConnector';
|
package/src/types.d.ts
CHANGED
|
@@ -3,3 +3,91 @@ export type ChainChangeEventHandler = (chainId: string | number) => Promise<void
|
|
|
3
3
|
export type DisconnectEventHandler = (error?: {
|
|
4
4
|
code: number;
|
|
5
5
|
}) => Promise<void>;
|
|
6
|
+
export type WalletEvent = 'accountChanged' | 'chainChanged';
|
|
7
|
+
export type WalletMethod = 'getConnectedAccounts';
|
|
8
|
+
export type WalletLimitations = {
|
|
9
|
+
desktop?: {
|
|
10
|
+
unsupportedEvents?: WalletEvent[];
|
|
11
|
+
unsupportedMethods?: WalletMethod[];
|
|
12
|
+
};
|
|
13
|
+
mobile?: {
|
|
14
|
+
unsupportedEvents?: WalletEvent[];
|
|
15
|
+
unsupportedMethods?: WalletMethod[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* @property android - The full url to download the wallet on Android
|
|
20
|
+
* @property brave - The full url to download the wallet on Brave
|
|
21
|
+
* @property chrome - The full url to download the wallet on Chrome
|
|
22
|
+
* @property edge - The full url to download the wallet on Edge
|
|
23
|
+
* @property firefox - The full url to download the wallet on Firefox
|
|
24
|
+
* @property ios - The full url to download the wallet on iOS
|
|
25
|
+
*/
|
|
26
|
+
export type WalletLinks = {
|
|
27
|
+
android: string;
|
|
28
|
+
brave: string;
|
|
29
|
+
chrome: string;
|
|
30
|
+
edge: string;
|
|
31
|
+
firefox: string;
|
|
32
|
+
ios: string;
|
|
33
|
+
};
|
|
34
|
+
export type WalletDownloadLinks = {
|
|
35
|
+
chromeId?: string;
|
|
36
|
+
edgeId?: string;
|
|
37
|
+
firefoxId?: string;
|
|
38
|
+
operaId?: string;
|
|
39
|
+
safariId?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @property androidId - The id to download the wallet on Google Play
|
|
42
|
+
*/
|
|
43
|
+
androidId?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @property iosId - The id to download the wallet on App Store
|
|
46
|
+
*/
|
|
47
|
+
iosId?: string;
|
|
48
|
+
/**
|
|
49
|
+
* @property android - The url to download the wallet on Android
|
|
50
|
+
*/
|
|
51
|
+
androidUrl?: string;
|
|
52
|
+
/**
|
|
53
|
+
* @property ios - The url to download the wallet on iOS
|
|
54
|
+
*/
|
|
55
|
+
iosUrl?: string;
|
|
56
|
+
};
|
|
57
|
+
export type WalletDeepLinks = {
|
|
58
|
+
mobile?: {
|
|
59
|
+
native?: string;
|
|
60
|
+
universal?: string;
|
|
61
|
+
};
|
|
62
|
+
desktop?: {
|
|
63
|
+
native?: string;
|
|
64
|
+
universal?: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export type HardwareWallet = 'ledger';
|
|
68
|
+
/**
|
|
69
|
+
* @property id - A key that can be used to identify the wallet/connector, based on the wallet name
|
|
70
|
+
* @property name - The wallet name
|
|
71
|
+
* @property icon - The url or data for the wallet icon
|
|
72
|
+
* @property brandColor - The hex valye for the wallet brand color
|
|
73
|
+
* @property groupKey - Key used to group wallets together, for example, by chain
|
|
74
|
+
* @property inAppBrowserUrl - The url to open the wallet in the in-app browser
|
|
75
|
+
* @property deepLinks - The mobile deep links of the wallet
|
|
76
|
+
* @property downloadLinks - The ids to download the wallet in the different browsers and mobile stores
|
|
77
|
+
* @property walletLimitations - The limitations of the wallet in regards to methods and events
|
|
78
|
+
* @property rdns - The wallet rdns if it supports EIP-6963
|
|
79
|
+
*/
|
|
80
|
+
export type WalletMetadata = {
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
icon: string;
|
|
84
|
+
brandColor?: `#${string}`;
|
|
85
|
+
groupKey?: string;
|
|
86
|
+
inAppBrowserUrl?: string;
|
|
87
|
+
deepLinks?: WalletDeepLinks;
|
|
88
|
+
downloadLinks?: WalletDownloadLinks;
|
|
89
|
+
walletLimitations?: WalletLimitations;
|
|
90
|
+
supportedHardwareWallets?: HardwareWallet[];
|
|
91
|
+
rdns?: string;
|
|
92
|
+
};
|
|
93
|
+
export declare namespace WalletConnectorCore { }
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const convertWalletToBaseWallet = (wallet) => ({
|
|
7
|
+
additionalAddresses: wallet.additionalAddresses,
|
|
8
|
+
address: wallet.address,
|
|
9
|
+
chain: wallet.chain,
|
|
10
|
+
id: wallet.id,
|
|
11
|
+
isAuthenticated: wallet.isAuthenticated,
|
|
12
|
+
key: wallet.key,
|
|
13
|
+
});
|
|
14
|
+
const convertWalletToBaseWalletPartial = (wallet) => ({
|
|
15
|
+
additionalAddresses: wallet.additionalAddresses,
|
|
16
|
+
address: wallet.address,
|
|
17
|
+
chain: wallet.chain,
|
|
18
|
+
id: wallet.id,
|
|
19
|
+
isAuthenticated: wallet.isAuthenticated,
|
|
20
|
+
key: wallet.key,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
exports.convertWalletToBaseWallet = convertWalletToBaseWallet;
|
|
24
|
+
exports.convertWalletToBaseWalletPartial = convertWalletToBaseWalletPartial;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BaseWallet } from '@dynamic-labs/types';
|
|
2
|
+
import { Wallet } from '../../Wallet';
|
|
3
|
+
export declare const convertWalletToBaseWallet: (wallet: Wallet) => BaseWallet;
|
|
4
|
+
export declare const convertWalletToBaseWalletPartial: (wallet: Partial<Wallet>) => Partial<BaseWallet>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const convertWalletToBaseWallet = (wallet) => ({
|
|
3
|
+
additionalAddresses: wallet.additionalAddresses,
|
|
4
|
+
address: wallet.address,
|
|
5
|
+
chain: wallet.chain,
|
|
6
|
+
id: wallet.id,
|
|
7
|
+
isAuthenticated: wallet.isAuthenticated,
|
|
8
|
+
key: wallet.key,
|
|
9
|
+
});
|
|
10
|
+
const convertWalletToBaseWalletPartial = (wallet) => ({
|
|
11
|
+
additionalAddresses: wallet.additionalAddresses,
|
|
12
|
+
address: wallet.address,
|
|
13
|
+
chain: wallet.chain,
|
|
14
|
+
id: wallet.id,
|
|
15
|
+
isAuthenticated: wallet.isAuthenticated,
|
|
16
|
+
key: wallet.key,
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { convertWalletToBaseWallet, convertWalletToBaseWalletPartial };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './convertWalletToBaseWallet';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WalletConnector } from '
|
|
1
|
+
import { WalletConnector } from '..';
|
|
2
2
|
import { AccountChangeEventHandler, ChainChangeEventHandler, DisconnectEventHandler } from '../types';
|
|
3
3
|
export declare const eventListenerHandlers: (walletConnector: WalletConnector) => {
|
|
4
4
|
handleAccountChange: AccountChangeEventHandler;
|
|
@@ -47,10 +47,10 @@ const chainsInfo = [
|
|
|
47
47
|
symbol: 'COSMOS',
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
blockchainName: '
|
|
51
|
-
displayName: '
|
|
52
|
-
name: '
|
|
53
|
-
symbol: '
|
|
50
|
+
blockchainName: 'Eclipse',
|
|
51
|
+
displayName: 'Eclipse',
|
|
52
|
+
name: 'eclipse',
|
|
53
|
+
symbol: 'ECLIPSE',
|
|
54
54
|
},
|
|
55
55
|
];
|
|
56
56
|
const chainOverrides = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ChainInfo } from '
|
|
2
|
-
export type ChainName = 'algorand' | 'bitcoin' | 'evm' | 'flow' | 'solana' | 'starknet' | 'cosmos';
|
|
1
|
+
import { ChainInfo } from '../..';
|
|
2
|
+
export type ChainName = 'algorand' | 'eclipse' | 'bitcoin' | 'evm' | 'flow' | 'solana' | 'starknet' | 'cosmos';
|
|
3
3
|
export type ChainDisplayOverrides = Partial<Record<ChainName, {
|
|
4
4
|
displayName?: string;
|
|
5
5
|
}>>;
|
|
@@ -43,10 +43,10 @@ const chainsInfo = [
|
|
|
43
43
|
symbol: 'COSMOS',
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
blockchainName: '
|
|
47
|
-
displayName: '
|
|
48
|
-
name: '
|
|
49
|
-
symbol: '
|
|
46
|
+
blockchainName: 'Eclipse',
|
|
47
|
+
displayName: 'Eclipse',
|
|
48
|
+
name: 'eclipse',
|
|
49
|
+
symbol: 'ECLIPSE',
|
|
50
50
|
},
|
|
51
51
|
];
|
|
52
52
|
const chainOverrides = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { InternalWalletConnector } from '
|
|
1
|
+
import { InternalWalletConnector } from '..';
|
|
2
2
|
export declare const getWalletConnectorByKey: (wallets: InternalWalletConnector[], key: string) => InternalWalletConnector | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
|
|
8
|
+
const getWalletLinks = (downloadLinks) => {
|
|
9
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10
|
+
const links = {
|
|
11
|
+
android: '',
|
|
12
|
+
brave: '',
|
|
13
|
+
chrome: '',
|
|
14
|
+
edge: '',
|
|
15
|
+
firefox: '',
|
|
16
|
+
ios: '',
|
|
17
|
+
};
|
|
18
|
+
if (!downloadLinks) {
|
|
19
|
+
return links;
|
|
20
|
+
}
|
|
21
|
+
links.brave = (_a = walletBook.renderTemplate('chromeUrl', downloadLinks.chromeId)) !== null && _a !== void 0 ? _a : '';
|
|
22
|
+
links.chrome = (_b = walletBook.renderTemplate('chromeUrl', downloadLinks.chromeId)) !== null && _b !== void 0 ? _b : '';
|
|
23
|
+
links.edge = (_c = walletBook.renderTemplate('edgeUrl', downloadLinks.edgeId)) !== null && _c !== void 0 ? _c : '';
|
|
24
|
+
links.firefox = (_d = walletBook.renderTemplate('firefoxUrl', downloadLinks.firefoxId)) !== null && _d !== void 0 ? _d : '';
|
|
25
|
+
links.ios =
|
|
26
|
+
(_f = (_e = walletBook.renderTemplate('iosUrl', downloadLinks.iosId)) !== null && _e !== void 0 ? _e : downloadLinks.iosUrl) !== null && _f !== void 0 ? _f : '';
|
|
27
|
+
links.android =
|
|
28
|
+
(_h = (_g = walletBook.renderTemplate('androidUrl', downloadLinks.androidId)) !== null && _g !== void 0 ? _g : downloadLinks.androidUrl) !== null && _h !== void 0 ? _h : '';
|
|
29
|
+
return links;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.getWalletLinks = getWalletLinks;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { renderTemplate } from '@dynamic-labs/wallet-book';
|
|
3
|
+
|
|
4
|
+
const getWalletLinks = (downloadLinks) => {
|
|
5
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6
|
+
const links = {
|
|
7
|
+
android: '',
|
|
8
|
+
brave: '',
|
|
9
|
+
chrome: '',
|
|
10
|
+
edge: '',
|
|
11
|
+
firefox: '',
|
|
12
|
+
ios: '',
|
|
13
|
+
};
|
|
14
|
+
if (!downloadLinks) {
|
|
15
|
+
return links;
|
|
16
|
+
}
|
|
17
|
+
links.brave = (_a = renderTemplate('chromeUrl', downloadLinks.chromeId)) !== null && _a !== void 0 ? _a : '';
|
|
18
|
+
links.chrome = (_b = renderTemplate('chromeUrl', downloadLinks.chromeId)) !== null && _b !== void 0 ? _b : '';
|
|
19
|
+
links.edge = (_c = renderTemplate('edgeUrl', downloadLinks.edgeId)) !== null && _c !== void 0 ? _c : '';
|
|
20
|
+
links.firefox = (_d = renderTemplate('firefoxUrl', downloadLinks.firefoxId)) !== null && _d !== void 0 ? _d : '';
|
|
21
|
+
links.ios =
|
|
22
|
+
(_f = (_e = renderTemplate('iosUrl', downloadLinks.iosId)) !== null && _e !== void 0 ? _e : downloadLinks.iosUrl) !== null && _f !== void 0 ? _f : '';
|
|
23
|
+
links.android =
|
|
24
|
+
(_h = (_g = renderTemplate('androidUrl', downloadLinks.androidId)) !== null && _g !== void 0 ? _g : downloadLinks.androidUrl) !== null && _h !== void 0 ? _h : '';
|
|
25
|
+
return links;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { getWalletLinks };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getWalletLinks } from './getWalletLinks';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const getMobileDeepLinks = (mobile) => {
|
|
7
|
+
if (!mobile) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
native: mobile.native,
|
|
12
|
+
universal: mobile.universal,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const getDesktopDeepLinks = (desktop) => {
|
|
16
|
+
if (!desktop) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
native: desktop.native,
|
|
21
|
+
universal: desktop.universal,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const getDeepLinks = ({ mobile, desktop, }) => {
|
|
25
|
+
const mobileDeepLinks = getMobileDeepLinks(mobile);
|
|
26
|
+
const desktopDeepLinks = getDesktopDeepLinks(desktop);
|
|
27
|
+
if (!mobileDeepLinks && !desktopDeepLinks) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
return {
|
|
31
|
+
desktop: desktopDeepLinks,
|
|
32
|
+
mobile: mobileDeepLinks,
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.getDeepLinks = getDeepLinks;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WalletSchema } from '@dynamic-labs/wallet-book';
|
|
2
|
+
import { WalletDeepLinks } from '../../../types';
|
|
3
|
+
export declare const getDeepLinks: ({ mobile, desktop, }: {
|
|
4
|
+
mobile?: WalletSchema['mobile'];
|
|
5
|
+
desktop?: WalletSchema['desktop'];
|
|
6
|
+
}) => WalletDeepLinks | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const getMobileDeepLinks = (mobile) => {
|
|
3
|
+
if (!mobile) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
return {
|
|
7
|
+
native: mobile.native,
|
|
8
|
+
universal: mobile.universal,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const getDesktopDeepLinks = (desktop) => {
|
|
12
|
+
if (!desktop) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
native: desktop.native,
|
|
17
|
+
universal: desktop.universal,
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
const getDeepLinks = ({ mobile, desktop, }) => {
|
|
21
|
+
const mobileDeepLinks = getMobileDeepLinks(mobile);
|
|
22
|
+
const desktopDeepLinks = getDesktopDeepLinks(desktop);
|
|
23
|
+
if (!mobileDeepLinks && !desktopDeepLinks) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
desktop: desktopDeepLinks,
|
|
28
|
+
mobile: mobileDeepLinks,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { getDeepLinks };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getDeepLinks';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
const getMobileDownloadLinks = (mobile) => {
|
|
7
|
+
if (!mobile) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
androidId: mobile.androidId,
|
|
12
|
+
iosId: mobile.iosId,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const getDesktopDownloadLinks = (desktop) => {
|
|
16
|
+
if (!desktop) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
chromeId: desktop.chromeId,
|
|
21
|
+
edgeId: desktop.edgeId,
|
|
22
|
+
firefoxId: desktop.firefoxId,
|
|
23
|
+
operaId: desktop.operaId,
|
|
24
|
+
safariId: desktop.safariId,
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
const getDownloadLinks = (wallet) => {
|
|
28
|
+
const mobileLinks = getMobileDownloadLinks(wallet.mobile);
|
|
29
|
+
const desktopLinks = getDesktopDownloadLinks(wallet.desktop);
|
|
30
|
+
if (!mobileLinks && !desktopLinks) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
return Object.assign(Object.assign({}, mobileLinks), desktopLinks);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.getDownloadLinks = getDownloadLinks;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
const getMobileDownloadLinks = (mobile) => {
|
|
3
|
+
if (!mobile) {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
return {
|
|
7
|
+
androidId: mobile.androidId,
|
|
8
|
+
iosId: mobile.iosId,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const getDesktopDownloadLinks = (desktop) => {
|
|
12
|
+
if (!desktop) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
chromeId: desktop.chromeId,
|
|
17
|
+
edgeId: desktop.edgeId,
|
|
18
|
+
firefoxId: desktop.firefoxId,
|
|
19
|
+
operaId: desktop.operaId,
|
|
20
|
+
safariId: desktop.safariId,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
const getDownloadLinks = (wallet) => {
|
|
24
|
+
const mobileLinks = getMobileDownloadLinks(wallet.mobile);
|
|
25
|
+
const desktopLinks = getDesktopDownloadLinks(wallet.desktop);
|
|
26
|
+
if (!mobileLinks && !desktopLinks) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
return Object.assign(Object.assign({}, mobileLinks), desktopLinks);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { getDownloadLinks };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getDownloadLinks';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var walletBook = require('@dynamic-labs/wallet-book');
|
|
7
|
+
|
|
8
|
+
const getIconUrl = (spriteId) => {
|
|
9
|
+
if (!spriteId) {
|
|
10
|
+
return walletBook.renderTemplate('iconicUrl', 'defaultwallet');
|
|
11
|
+
}
|
|
12
|
+
return walletBook.renderTemplate('iconicUrl', spriteId);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
exports.getIconUrl = getIconUrl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getIconUrl: (spriteId?: string) => string | undefined;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import { renderTemplate } from '@dynamic-labs/wallet-book';
|
|
3
|
+
|
|
4
|
+
const getIconUrl = (spriteId) => {
|
|
5
|
+
if (!spriteId) {
|
|
6
|
+
return renderTemplate('iconicUrl', 'defaultwallet');
|
|
7
|
+
}
|
|
8
|
+
return renderTemplate('iconicUrl', spriteId);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { getIconUrl };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './getIconUrl';
|