@dynamic-labs/wallet-connector-core 3.0.0-alpha.44 → 3.0.0-alpha.46

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,27 @@
1
1
 
2
+ ## [3.0.0-alpha.46](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.45...v3.0.0-alpha.46) (2024-08-19)
3
+
4
+
5
+ ### Features
6
+
7
+ * add overrides for chain info ([#6614](https://github.com/dynamic-labs/DynamicAuth/issues/6614)) ([07b76a0](https://github.com/dynamic-labs/DynamicAuth/commit/07b76a0887d3147a00d93a37bdf49a83bfec0ceb))
8
+ * add use token balances state in global store ([#6598](https://github.com/dynamic-labs/DynamicAuth/issues/6598)) ([05baefe](https://github.com/dynamic-labs/DynamicAuth/commit/05baefe7155f197c048557b15240ad93556a8604))
9
+ * refresh token balances ([#6578](https://github.com/dynamic-labs/DynamicAuth/issues/6578)) ([0768857](https://github.com/dynamic-labs/DynamicAuth/commit/0768857c924ce0e01b736173e50ea85b956ab067))
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * createEmbeddedWalletAccount ([#6642](https://github.com/dynamic-labs/DynamicAuth/issues/6642)) ([bce08de](https://github.com/dynamic-labs/DynamicAuth/commit/bce08deaa4a5e1ea0b134efb5c4d252c82af5eec))
15
+ * jwt x error when singing with embedded wallet ([#6633](https://github.com/dynamic-labs/DynamicAuth/issues/6633)) ([7d1a6d4](https://github.com/dynamic-labs/DynamicAuth/commit/7d1a6d432807c5b361ff31e6feac2e10d0145d90))
16
+
17
+ ## [3.0.0-alpha.45](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.44...v3.0.0-alpha.45) (2024-08-16)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * always check for dynamicOauthCode and use during signin or verify ([#6618](https://github.com/dynamic-labs/DynamicAuth/issues/6618)) ([dd33231](https://github.com/dynamic-labs/DynamicAuth/commit/dd332310c9fdfa7bb593b7f567751133a93c6938))
23
+ * display qr code when no primary is selected ([#6605](https://github.com/dynamic-labs/DynamicAuth/issues/6605)) ([406afa3](https://github.com/dynamic-labs/DynamicAuth/commit/406afa32b38a29a2d8ce96803ae45ab35adb5ce3))
24
+
2
25
  ## [3.0.0-alpha.44](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.43...v3.0.0-alpha.44) (2024-08-15)
3
26
 
4
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/wallet-connector-core",
3
- "version": "3.0.0-alpha.44",
3
+ "version": "3.0.0-alpha.46",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -29,11 +29,11 @@
29
29
  "@dynamic-labs/sdk-api-core": "0.0.516"
30
30
  },
31
31
  "peerDependencies": {
32
- "@dynamic-labs/logger": "3.0.0-alpha.44",
33
- "@dynamic-labs/rpc-providers": "3.0.0-alpha.44",
34
- "@dynamic-labs/types": "3.0.0-alpha.44",
35
- "@dynamic-labs/utils": "3.0.0-alpha.44",
36
- "@dynamic-labs/wallet-book": "3.0.0-alpha.44",
32
+ "@dynamic-labs/logger": "3.0.0-alpha.46",
33
+ "@dynamic-labs/rpc-providers": "3.0.0-alpha.46",
34
+ "@dynamic-labs/types": "3.0.0-alpha.46",
35
+ "@dynamic-labs/utils": "3.0.0-alpha.46",
36
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.46",
37
37
  "eventemitter3": "5.0.1"
38
38
  }
39
39
  }
package/src/index.cjs CHANGED
@@ -44,6 +44,8 @@ exports.Wallet = Wallet.Wallet;
44
44
  exports.logger = logger.logger;
45
45
  exports.ProviderLookup = ProviderLookup.ProviderLookup;
46
46
  exports.getChainInfo = getChainInfo.getChainInfo;
47
+ exports.getChainInfoWithOverrides = getChainInfo.getChainInfoWithOverrides;
48
+ exports.setChainInfoOverrides = getChainInfo.setChainInfoOverrides;
47
49
  exports.isEmailOTPWalletConnector = isEmailOTPWalletConnector.isEmailOTPWalletConnector;
48
50
  exports.isEmailWalletConnector = isEmailWalletConnector.isEmailWalletConnector;
49
51
  exports.isSameAddress = isSameAddress.isSameAddress;
package/src/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
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 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 SmartWalletConnector, type SocialProvider, type WalletConnector, type WalletConnectorConstructor, type WalletConnectorCore, type WalletConnectorEventTypes, type WalletConnectorsMethod, type WebAuthnAttestation, } from './lib';
2
2
  export type { WalletConnectorExtension } from './lib/WalletConnectorExtension';
3
3
  export type { AccountChangeEventHandler, ChainChangeEventHandler, DisconnectEventHandler, } from './types';
4
- export { ProviderLookup, addHexPrefix, bufferToHex, eventListenerHandlers, getChainInfo, getDeepLink, getMobileExperience, getRpcUrlForChain, getWalletConnectorByKey, isAccountAbstractionConnector, isBitcoinConnector, isBloctoConnector, isCoinbaseMpcWalletConnector, isEmailOTPWalletConnector, isEmailWalletConnector, isEmbeddedConnector, isHardwareWalletConnector, isHex, isMagicConnector, isPasskeyWalletConnector, isPhantomRedirectConnector, isSameAddress, isSendBalanceWalletConnector, isSessionKeyCompatibleWalletConnector, isSmartWalletConnector, isSocialWalletConnector, isWalletConnectConnector, logger, performPlatformSpecificConnectionMethod, shouldLowercaseAddress, utf8ToHex, type DeepLinkVariant, type ProviderCondition, } from './utils';
4
+ export { ProviderLookup, addHexPrefix, bufferToHex, eventListenerHandlers, getChainInfo, getChainInfoWithOverrides, setChainInfoOverrides, getDeepLink, getMobileExperience, getRpcUrlForChain, getWalletConnectorByKey, isAccountAbstractionConnector, isBitcoinConnector, isBloctoConnector, isCoinbaseMpcWalletConnector, isEmailOTPWalletConnector, isEmailWalletConnector, isEmbeddedConnector, isHardwareWalletConnector, isHex, isMagicConnector, isPasskeyWalletConnector, isPhantomRedirectConnector, isSameAddress, isSendBalanceWalletConnector, isSessionKeyCompatibleWalletConnector, isSmartWalletConnector, isSocialWalletConnector, isWalletConnectConnector, logger, performPlatformSpecificConnectionMethod, shouldLowercaseAddress, utf8ToHex, type DeepLinkVariant, type ProviderCondition, type ChainDisplayOverrides, } from './utils';
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ export { Chains, WalletConnectorBase, socialProviders } from './lib/WalletConnec
3
3
  export { Wallet } from './lib/wallets/Wallet/Wallet.js';
4
4
  export { logger } from './utils/logger.js';
5
5
  export { ProviderLookup } from './utils/ProviderLookup/ProviderLookup.js';
6
- export { getChainInfo } from './utils/getChainInfo/getChainInfo.js';
6
+ export { getChainInfo, getChainInfoWithOverrides, setChainInfoOverrides } from './utils/getChainInfo/getChainInfo.js';
7
7
  export { isEmailOTPWalletConnector } from './utils/isEmailOTPWalletConnector/isEmailOTPWalletConnector.js';
8
8
  export { isEmailWalletConnector } from './utils/isEmailWalletConnector/isEmailWalletConnector.js';
9
9
  export { isSameAddress } from './utils/isSameAddress/isSameAddress.js';
@@ -1,5 +1,6 @@
1
- import { IUITransaction } from '@dynamic-labs/types';
1
+ import { TransactionReceipt, IUITransaction } from '@dynamic-labs/types';
2
2
  import { WalletConnectorBase } from './WalletConnector';
3
3
  export interface ISendBalanceWalletConnector extends WalletConnectorBase {
4
4
  createUiTransaction(from: string): Promise<IUITransaction>;
5
+ confirmTransactionStatus?(txHash: string): Promise<TransactionReceipt>;
5
6
  }
@@ -58,6 +58,10 @@ const chainOverrides = {
58
58
  eth: 'evm',
59
59
  stark: 'starknet',
60
60
  };
61
+ let chainInfoOverrides;
62
+ const setChainInfoOverrides = (overrides) => {
63
+ chainInfoOverrides = overrides;
64
+ };
61
65
  const getChainInfo = (chain) => {
62
66
  var _a;
63
67
  const lowerCasedChain = chain.toLowerCase();
@@ -69,5 +73,22 @@ const getChainInfo = (chain) => {
69
73
  }
70
74
  return chainInfo;
71
75
  };
76
+ const getChainInfoWithOverrides = (chain) => {
77
+ var _a, _b;
78
+ const chainInfo = getChainInfo(chain);
79
+ if (!chainInfo) {
80
+ return;
81
+ }
82
+ const overrides = chainInfoOverrides === null || chainInfoOverrides === void 0 ? void 0 : chainInfoOverrides[chainInfo.name];
83
+ const chainInfoClone = Object.assign({}, chainInfo);
84
+ if (overrides) {
85
+ chainInfoClone.blockchainName =
86
+ (_a = overrides.displayName) !== null && _a !== void 0 ? _a : chainInfo.blockchainName;
87
+ chainInfoClone.displayName = (_b = overrides.displayName) !== null && _b !== void 0 ? _b : chainInfo.displayName;
88
+ }
89
+ return chainInfoClone;
90
+ };
72
91
 
73
92
  exports.getChainInfo = getChainInfo;
93
+ exports.getChainInfoWithOverrides = getChainInfoWithOverrides;
94
+ exports.setChainInfoOverrides = setChainInfoOverrides;
@@ -1,2 +1,8 @@
1
1
  import { ChainInfo } from '../../lib';
2
+ export type ChainName = 'algorand' | 'bitcoin' | 'evm' | 'flow' | 'solana' | 'starknet' | 'cosmos';
3
+ export type ChainDisplayOverrides = Partial<Record<ChainName, {
4
+ displayName?: string;
5
+ }>>;
6
+ export declare const setChainInfoOverrides: (overrides?: ChainDisplayOverrides) => void;
2
7
  export declare const getChainInfo: (chain: string) => ChainInfo | undefined;
8
+ export declare const getChainInfoWithOverrides: (chain: string) => ChainInfo | undefined;
@@ -54,6 +54,10 @@ const chainOverrides = {
54
54
  eth: 'evm',
55
55
  stark: 'starknet',
56
56
  };
57
+ let chainInfoOverrides;
58
+ const setChainInfoOverrides = (overrides) => {
59
+ chainInfoOverrides = overrides;
60
+ };
57
61
  const getChainInfo = (chain) => {
58
62
  var _a;
59
63
  const lowerCasedChain = chain.toLowerCase();
@@ -65,5 +69,20 @@ const getChainInfo = (chain) => {
65
69
  }
66
70
  return chainInfo;
67
71
  };
72
+ const getChainInfoWithOverrides = (chain) => {
73
+ var _a, _b;
74
+ const chainInfo = getChainInfo(chain);
75
+ if (!chainInfo) {
76
+ return;
77
+ }
78
+ const overrides = chainInfoOverrides === null || chainInfoOverrides === void 0 ? void 0 : chainInfoOverrides[chainInfo.name];
79
+ const chainInfoClone = Object.assign({}, chainInfo);
80
+ if (overrides) {
81
+ chainInfoClone.blockchainName =
82
+ (_a = overrides.displayName) !== null && _a !== void 0 ? _a : chainInfo.blockchainName;
83
+ chainInfoClone.displayName = (_b = overrides.displayName) !== null && _b !== void 0 ? _b : chainInfo.displayName;
84
+ }
85
+ return chainInfoClone;
86
+ };
68
87
 
69
- export { getChainInfo };
88
+ export { getChainInfo, getChainInfoWithOverrides, setChainInfoOverrides };
@@ -1 +1 @@
1
- export { getChainInfo } from './getChainInfo';
1
+ export { getChainInfo, setChainInfoOverrides, getChainInfoWithOverrides, type ChainDisplayOverrides, } from './getChainInfo';