@dynamic-labs/eclipse 4.1.0 → 4.2.1

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,25 @@
1
1
 
2
+ ### [4.2.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.2.0...v4.2.1) (2025-01-15)
3
+
4
+
5
+ ### Bug Fixes
6
+
7
+ * remove dependency on @dynamic-labs/ethereum-aa from sdk-react core ([#7804](https://github.com/dynamic-labs/dynamic-auth/issues/7804)) ([d1692d2](https://github.com/dynamic-labs/dynamic-auth/commit/d1692d2f58d4f0e14f7978ef81c020e871973810))
8
+
9
+ ## [4.2.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.1.0...v4.2.0) (2025-01-14)
10
+
11
+
12
+ ### Features
13
+
14
+ * add EthereumWalletConnectorsWithConfig ([#7796](https://github.com/dynamic-labs/dynamic-auth/issues/7796)) ([52146c3](https://github.com/dynamic-labs/dynamic-auth/commit/52146c38acbbe9ad31d5f047527b06ea44846065))
15
+ * add new userWalletsChanged event that aggregates all user wallet events ([#7797](https://github.com/dynamic-labs/dynamic-auth/issues/7797)) ([058e629](https://github.com/dynamic-labs/dynamic-auth/commit/058e629f0e760ad9dff2b03f86354355c6f8bffe))
16
+ * add support for connect with OKX Wallet on Eclipse ([#7793](https://github.com/dynamic-labs/dynamic-auth/issues/7793)) ([b6cd047](https://github.com/dynamic-labs/dynamic-auth/commit/b6cd04781402868443b02cbce269dd3c02c358b5))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * getWalletClient method not returning client with chain for Coinbase ([#7799](https://github.com/dynamic-labs/dynamic-auth/issues/7799)) ([e075493](https://github.com/dynamic-labs/dynamic-auth/commit/e0754936582c19850c905fc3d62c3621df7c274c))
22
+
2
23
  ## [4.1.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.0.1...v4.1.0) (2025-01-14)
3
24
 
4
25
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.1.0";
6
+ var version = "4.2.1";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.1.0";
2
+ var version = "4.2.1";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/eclipse",
3
- "version": "4.1.0",
3
+ "version": "4.2.1",
4
4
  "description": "A React SDK for implementing wallet web3 authentication and authorization to your website.",
5
5
  "author": "Dynamic Labs, Inc.",
6
6
  "license": "MIT",
@@ -19,15 +19,15 @@
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
21
  "@solana/web3.js": "1.92.1",
22
- "@dynamic-labs/assert-package-version": "4.1.0",
23
- "@dynamic-labs/rpc-providers": "4.1.0",
22
+ "@dynamic-labs/assert-package-version": "4.2.1",
23
+ "@dynamic-labs/rpc-providers": "4.2.1",
24
24
  "@dynamic-labs/sdk-api-core": "0.0.586",
25
- "@dynamic-labs/solana": "4.1.0",
26
- "@dynamic-labs/solana-core": "4.1.0",
27
- "@dynamic-labs/types": "4.1.0",
28
- "@dynamic-labs/utils": "4.1.0",
29
- "@dynamic-labs/wallet-book": "4.1.0",
30
- "@dynamic-labs/wallet-connector-core": "4.1.0"
25
+ "@dynamic-labs/solana": "4.2.1",
26
+ "@dynamic-labs/solana-core": "4.2.1",
27
+ "@dynamic-labs/types": "4.2.1",
28
+ "@dynamic-labs/utils": "4.2.1",
29
+ "@dynamic-labs/wallet-book": "4.2.1",
30
+ "@dynamic-labs/wallet-connector-core": "4.2.1"
31
31
  },
32
32
  "peerDependencies": {}
33
33
  }
@@ -3,8 +3,14 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var Backpack = require('./Backpack/Backpack.cjs');
6
+ require('../../_virtual/_tslib.cjs');
7
+ require('@solana/web3.js');
8
+ require('@dynamic-labs/solana');
9
+ require('@dynamic-labs/solana-core');
10
+ require('@dynamic-labs/utils');
11
+ var Backpack = require('./injected/Backpack/Backpack.cjs');
12
+ var OKX = require('./injected/OKX/OKX.cjs');
7
13
 
8
- const EclipseWalletConnectors = () => [Backpack.Backpack];
14
+ const EclipseWalletConnectors = () => [Backpack.Backpack, OKX.OKX];
9
15
 
10
16
  exports.EclipseWalletConnectors = EclipseWalletConnectors;
@@ -1,2 +1,2 @@
1
- import { Backpack } from './Backpack';
1
+ import { Backpack } from './injected';
2
2
  export declare const EclipseWalletConnectors: () => (typeof Backpack)[];
@@ -1,6 +1,12 @@
1
1
  'use client'
2
- import { Backpack } from './Backpack/Backpack.js';
2
+ import '../../_virtual/_tslib.js';
3
+ import '@solana/web3.js';
4
+ import '@dynamic-labs/solana';
5
+ import '@dynamic-labs/solana-core';
6
+ import '@dynamic-labs/utils';
7
+ import { Backpack } from './injected/Backpack/Backpack.js';
8
+ import { OKX } from './injected/OKX/OKX.js';
3
9
 
4
- const EclipseWalletConnectors = () => [Backpack];
10
+ const EclipseWalletConnectors = () => [Backpack, OKX];
5
11
 
6
12
  export { EclipseWalletConnectors };
@@ -1,4 +1,3 @@
1
- export * from './Backpack';
2
1
  export * from './EclipseWalletConnector';
3
2
  export * from './EclipseWalletConnectors';
4
3
  export * from './EclipseWalletConnectorsWithConfig';
@@ -0,0 +1,44 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var _tslib = require('../../../../_virtual/_tslib.cjs');
7
+ var utils = require('@dynamic-labs/utils');
8
+ var InjectedWalletBase = require('../InjectedWalletBase/InjectedWalletBase.cjs');
9
+
10
+ class Backpack extends InjectedWalletBase.InjectedWalletBase {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.name = 'Backpack';
14
+ this.overrideKey = 'backpackeclipse';
15
+ }
16
+ getSigner() {
17
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
18
+ var _a;
19
+ return (_a = this.solProviderHelper) === null || _a === void 0 ? void 0 : _a.connect();
20
+ });
21
+ }
22
+ signMessage(messageToSign) {
23
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
24
+ const publicAddress = yield this.getAddress();
25
+ if (!publicAddress) {
26
+ return undefined;
27
+ }
28
+ const provider = yield this.getSigner();
29
+ if (!provider) {
30
+ return undefined;
31
+ }
32
+ const signedMessage = yield provider.signMessage(Buffer.from(messageToSign, 'utf8'));
33
+ if (!signedMessage) {
34
+ return undefined;
35
+ }
36
+ if (typeof signedMessage === 'object' && 'signature' in signedMessage) {
37
+ return utils.bufferToBase64(signedMessage.signature);
38
+ }
39
+ return utils.bufferToBase64(signedMessage);
40
+ });
41
+ }
42
+ }
43
+
44
+ exports.Backpack = Backpack;
@@ -0,0 +1,7 @@
1
+ import { InjectedWalletBase } from '../InjectedWalletBase';
2
+ export declare class Backpack extends InjectedWalletBase {
3
+ name: string;
4
+ overrideKey: string;
5
+ getSigner<IBackpackSolanaSigner>(): Promise<IBackpackSolanaSigner | undefined>;
6
+ signMessage(messageToSign: string): Promise<string | undefined>;
7
+ }
@@ -0,0 +1,40 @@
1
+ 'use client'
2
+ import { __awaiter } from '../../../../_virtual/_tslib.js';
3
+ import { bufferToBase64 } from '@dynamic-labs/utils';
4
+ import { InjectedWalletBase } from '../InjectedWalletBase/InjectedWalletBase.js';
5
+
6
+ class Backpack extends InjectedWalletBase {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.name = 'Backpack';
10
+ this.overrideKey = 'backpackeclipse';
11
+ }
12
+ getSigner() {
13
+ return __awaiter(this, void 0, void 0, function* () {
14
+ var _a;
15
+ return (_a = this.solProviderHelper) === null || _a === void 0 ? void 0 : _a.connect();
16
+ });
17
+ }
18
+ signMessage(messageToSign) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const publicAddress = yield this.getAddress();
21
+ if (!publicAddress) {
22
+ return undefined;
23
+ }
24
+ const provider = yield this.getSigner();
25
+ if (!provider) {
26
+ return undefined;
27
+ }
28
+ const signedMessage = yield provider.signMessage(Buffer.from(messageToSign, 'utf8'));
29
+ if (!signedMessage) {
30
+ return undefined;
31
+ }
32
+ if (typeof signedMessage === 'object' && 'signature' in signedMessage) {
33
+ return bufferToBase64(signedMessage.signature);
34
+ }
35
+ return bufferToBase64(signedMessage);
36
+ });
37
+ }
38
+ }
39
+
40
+ export { Backpack };
@@ -3,14 +3,14 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var _tslib = require('../../../_virtual/_tslib.cjs');
6
+ var _tslib = require('../../../../_virtual/_tslib.cjs');
7
7
  var web3_js = require('@solana/web3.js');
8
8
  var solana = require('@dynamic-labs/solana');
9
9
  var solanaCore = require('@dynamic-labs/solana-core');
10
10
  var utils = require('@dynamic-labs/utils');
11
- var constants = require('../constants.cjs');
11
+ var constants = require('../../constants.cjs');
12
12
 
13
- class Backpack extends solana.BackpackConnector {
13
+ class InjectedWalletBase extends solana.SolanaInjectedConnector {
14
14
  constructor(opts) {
15
15
  var _a;
16
16
  super(opts);
@@ -70,4 +70,4 @@ class Backpack extends solana.BackpackConnector {
70
70
  }
71
71
  }
72
72
 
73
- exports.Backpack = Backpack;
73
+ exports.InjectedWalletBase = InjectedWalletBase;
@@ -1,18 +1,18 @@
1
1
  import { Connection } from '@solana/web3.js';
2
- import { BackpackConnector } from '@dynamic-labs/solana';
2
+ import { SolanaInjectedConnector } from '@dynamic-labs/solana';
3
+ import { Chain } from '@dynamic-labs/wallet-connector-core';
3
4
  import { SolanaWalletConnectorOpts } from '@dynamic-labs/solana-core';
4
5
  import { GenericNetwork } from '@dynamic-labs/types';
5
- import { Chain } from '@dynamic-labs/wallet-connector-core';
6
- type BackpackOpts = {
6
+ type EclipseInjectedConnectorOpts = {
7
7
  eclipseNetworks: GenericNetwork[];
8
8
  } & SolanaWalletConnectorOpts;
9
- export declare class Backpack extends BackpackConnector {
9
+ export declare abstract class InjectedWalletBase extends SolanaInjectedConnector {
10
10
  connectedChain: Chain;
11
11
  supportedChains: Chain[];
12
12
  name: string;
13
13
  overrideKey: string;
14
14
  eclipseNetworks: GenericNetwork[];
15
- constructor(opts: BackpackOpts);
15
+ constructor(opts: EclipseInjectedConnectorOpts);
16
16
  getPublicClient(): Promise<Connection | undefined>;
17
17
  getWalletClient(): Connection;
18
18
  getNetwork(): Promise<string>;
@@ -1,12 +1,12 @@
1
1
  'use client'
2
- import { __awaiter } from '../../../_virtual/_tslib.js';
2
+ import { __awaiter } from '../../../../_virtual/_tslib.js';
3
3
  import { Connection } from '@solana/web3.js';
4
- import { BackpackConnector } from '@dynamic-labs/solana';
4
+ import { SolanaInjectedConnector } from '@dynamic-labs/solana';
5
5
  import { getGenesisHashLSKey } from '@dynamic-labs/solana-core';
6
6
  import { DynamicError } from '@dynamic-labs/utils';
7
- import { eclipseMainnetHash, eclipseTestnetHash } from '../constants.js';
7
+ import { eclipseMainnetHash, eclipseTestnetHash } from '../../constants.js';
8
8
 
9
- class Backpack extends BackpackConnector {
9
+ class InjectedWalletBase extends SolanaInjectedConnector {
10
10
  constructor(opts) {
11
11
  var _a;
12
12
  super(opts);
@@ -66,4 +66,4 @@ class Backpack extends BackpackConnector {
66
66
  }
67
67
  }
68
68
 
69
- export { Backpack };
69
+ export { InjectedWalletBase };
@@ -0,0 +1 @@
1
+ export * from './InjectedWalletBase';
@@ -0,0 +1,16 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var InjectedWalletBase = require('../InjectedWalletBase/InjectedWalletBase.cjs');
7
+
8
+ class OKX extends InjectedWalletBase.InjectedWalletBase {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.name = 'OKX Wallet';
12
+ this.overrideKey = 'okxeclipse';
13
+ }
14
+ }
15
+
16
+ exports.OKX = OKX;
@@ -0,0 +1,5 @@
1
+ import { InjectedWalletBase } from '../InjectedWalletBase';
2
+ export declare class OKX extends InjectedWalletBase {
3
+ name: string;
4
+ overrideKey: string;
5
+ }
@@ -0,0 +1,12 @@
1
+ 'use client'
2
+ import { InjectedWalletBase } from '../InjectedWalletBase/InjectedWalletBase.js';
3
+
4
+ class OKX extends InjectedWalletBase {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.name = 'OKX Wallet';
8
+ this.overrideKey = 'okxeclipse';
9
+ }
10
+ }
11
+
12
+ export { OKX };
@@ -0,0 +1 @@
1
+ export * from './OKX';
@@ -0,0 +1,3 @@
1
+ export { InjectedWalletBase as EclipseInjectedConnector } from './InjectedWalletBase';
2
+ export * from './Backpack';
3
+ export * from './OKX';
package/src/index.cjs CHANGED
@@ -5,11 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var assertPackageVersion = require('@dynamic-labs/assert-package-version');
7
7
  var _package = require('../package.cjs');
8
- require('../_virtual/_tslib.cjs');
9
- require('@solana/web3.js');
10
- require('@dynamic-labs/solana');
11
- require('@dynamic-labs/solana-core');
12
- require('@dynamic-labs/utils');
13
8
  require('@dynamic-labs/wallet-connector-core');
14
9
  var EclipseWallet = require('./wallet/EclipseWallet.cjs');
15
10
  var isEclipseWallet = require('./wallet/isEclipseWallet/isEclipseWallet.cjs');
package/src/index.js CHANGED
@@ -1,11 +1,6 @@
1
1
  'use client'
2
2
  import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
3
3
  import { version } from '../package.js';
4
- import '../_virtual/_tslib.js';
5
- import '@solana/web3.js';
6
- import '@dynamic-labs/solana';
7
- import '@dynamic-labs/solana-core';
8
- import '@dynamic-labs/utils';
9
4
  import '@dynamic-labs/wallet-connector-core';
10
5
  export { EclipseWallet } from './wallet/EclipseWallet.js';
11
6
  export { isEclipseWallet } from './wallet/isEclipseWallet/isEclipseWallet.js';