@dynamic-labs/flow 3.0.0-alpha.51 → 3.0.0-alpha.53

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,55 @@
1
1
 
2
+ ## [3.0.0-alpha.53](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.52...v3.0.0-alpha.53) (2024-08-29)
3
+
4
+
5
+ ### ⚠ BREAKING CHANGES
6
+
7
+ * simplify solana wallet signer types (#6748)
8
+ * deprecate getEoaConnector (#6571)
9
+ * limit methods and props returned by wallet.connector (#6540)
10
+ * move generic solana code to solana-core package (#6701)
11
+ * revamp ether v6 interface (#6548)
12
+ * add ethereum wallet specific methods and intercept to sync when needed (#6662)
13
+ * add solana wallet specific methods and intercept to sync when needed (#6608)
14
+ * don't force primary wallet to be connected (#6128)
15
+
16
+ ### Features
17
+
18
+ * add bitcoin wallet specific methods and intercept to sync when needed ([#6663](https://github.com/dynamic-labs/DynamicAuth/issues/6663)) ([ed699b1](https://github.com/dynamic-labs/DynamicAuth/commit/ed699b1f8c264755779ec4840d105f89ade5500e))
19
+ * add ethereum wallet specific methods and intercept to sync when needed ([#6662](https://github.com/dynamic-labs/DynamicAuth/issues/6662)) ([372360e](https://github.com/dynamic-labs/DynamicAuth/commit/372360ed7ca395f88811fc62c94b2b494eb59971))
20
+ * add solana wallet specific methods and intercept to sync when needed ([#6608](https://github.com/dynamic-labs/DynamicAuth/issues/6608)) ([565f610](https://github.com/dynamic-labs/DynamicAuth/commit/565f6100340296c267e9706fd263e9bd3f7d3732))
21
+ * add useSmartWallets hook to manage aa wallets ([#6564](https://github.com/dynamic-labs/DynamicAuth/issues/6564)) ([a243d36](https://github.com/dynamic-labs/DynamicAuth/commit/a243d361ce7c368d0f1afda55f9c1fabefd75ba8))
22
+ * don't force primary wallet to be connected ([#6128](https://github.com/dynamic-labs/DynamicAuth/issues/6128)) ([018a6f6](https://github.com/dynamic-labs/DynamicAuth/commit/018a6f66f8725914ab97ea3e2e1c80626266e503))
23
+ * new prop to enable prompt for linking when account change is detected ([#6713](https://github.com/dynamic-labs/DynamicAuth/issues/6713)) ([b5a6321](https://github.com/dynamic-labs/DynamicAuth/commit/b5a63212ae33fae24401f141d5ca2356b446dcff))
24
+
25
+
26
+ ### Bug Fixes
27
+
28
+ * always sync wagmi client with primary wallet ([#6577](https://github.com/dynamic-labs/DynamicAuth/issues/6577)) ([be22fde](https://github.com/dynamic-labs/DynamicAuth/commit/be22fdea3bb61db79b06ba56cb32da6cd8141b66))
29
+ * cosmos wallet intercepts ([#6720](https://github.com/dynamic-labs/DynamicAuth/issues/6720)) ([cfc9df4](https://github.com/dynamic-labs/DynamicAuth/commit/cfc9df48a8032f7348fec14f77b9e378d2e26a22))
30
+ * magiceden wallet events not working correctly on page refresh ([#6735](https://github.com/dynamic-labs/DynamicAuth/issues/6735)) ([6ed5964](https://github.com/dynamic-labs/DynamicAuth/commit/6ed5964134a2cafd392c19f18eb71e6ca2ce238d))
31
+ * use proxy to intercept solana signer methods ([#6743](https://github.com/dynamic-labs/DynamicAuth/issues/6743)) ([ecbe5ea](https://github.com/dynamic-labs/DynamicAuth/commit/ecbe5ea772592d2c693d8222d85b7642acd151a8))
32
+ * wallet.chain references ([525c1ca](https://github.com/dynamic-labs/DynamicAuth/commit/525c1ca9a8fe6402c06eabe6aebc30e310411d9b))
33
+
34
+
35
+ * deprecate getEoaConnector ([#6571](https://github.com/dynamic-labs/DynamicAuth/issues/6571)) ([0226ee5](https://github.com/dynamic-labs/DynamicAuth/commit/0226ee5a13f2418607076ee6f2ec0a579b06dd5d))
36
+ * limit methods and props returned by wallet.connector ([#6540](https://github.com/dynamic-labs/DynamicAuth/issues/6540)) ([9c86e35](https://github.com/dynamic-labs/DynamicAuth/commit/9c86e35c72cd40313bfd19254dd6171ee8f62213))
37
+ * move generic solana code to solana-core package ([#6701](https://github.com/dynamic-labs/DynamicAuth/issues/6701)) ([30815f5](https://github.com/dynamic-labs/DynamicAuth/commit/30815f5d46feeefb2413c1b7d30b43d5370ee032))
38
+ * revamp ether v6 interface ([#6548](https://github.com/dynamic-labs/DynamicAuth/issues/6548)) ([f3b2fb8](https://github.com/dynamic-labs/DynamicAuth/commit/f3b2fb8da7de21f9c58e67fa7f5580166195092a))
39
+ * simplify solana wallet signer types ([#6748](https://github.com/dynamic-labs/DynamicAuth/issues/6748)) ([01d1a42](https://github.com/dynamic-labs/DynamicAuth/commit/01d1a42bc916ab329580b741ba60d706bf6c5491))
40
+
41
+ ## [3.0.0-alpha.52](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.51...v3.0.0-alpha.52) (2024-08-28)
42
+
43
+
44
+ ### Features
45
+
46
+ * add support for custom keplr chains ([#6635](https://github.com/dynamic-labs/DynamicAuth/issues/6635)) ([f0aa2da](https://github.com/dynamic-labs/DynamicAuth/commit/f0aa2dac2a2b259d145ff52174da7cc6ef963182))
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * better error handling on solana transaction decoding ([#6731](https://github.com/dynamic-labs/DynamicAuth/issues/6731)) ([a71af86](https://github.com/dynamic-labs/DynamicAuth/commit/a71af869395c9b99c04f0cac78a73e1b2b17bafe))
52
+
2
53
  ## [3.0.0-alpha.51](https://github.com/dynamic-labs/DynamicAuth/compare/v3.0.0-alpha.50...v3.0.0-alpha.51) (2024-08-23)
3
54
 
4
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/flow",
3
- "version": "3.0.0-alpha.51",
3
+ "version": "3.0.0-alpha.53",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dynamic-labs/dynamic-auth.git",
@@ -27,9 +27,9 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@onflow/fcl": "1.10.0",
30
- "@dynamic-labs/utils": "3.0.0-alpha.51",
31
- "@dynamic-labs/wallet-book": "3.0.0-alpha.51",
32
- "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.51"
30
+ "@dynamic-labs/utils": "3.0.0-alpha.53",
31
+ "@dynamic-labs/wallet-book": "3.0.0-alpha.53",
32
+ "@dynamic-labs/wallet-connector-core": "3.0.0-alpha.53"
33
33
  },
34
34
  "peerDependencies": {}
35
35
  }
@@ -7,11 +7,13 @@ var _tslib = require('../_virtual/_tslib.cjs');
7
7
  var fcl = require('@onflow/fcl');
8
8
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
9
  var utils = require('@dynamic-labs/utils');
10
+ var FlowWallet = require('./wallet/FlowWallet.cjs');
10
11
 
11
12
  class FlowWalletConnector extends walletConnectorCore.WalletConnectorBase {
12
13
  constructor(opts) {
13
14
  var _a;
14
15
  super(opts);
16
+ this.ChainWallet = FlowWallet.FlowWallet;
15
17
  this.connectedChain = 'FLOW';
16
18
  this.supportedChains = ['FLOW'];
17
19
  this.appName = opts.appName;
@@ -57,8 +59,9 @@ class FlowWalletConnector extends walletConnectorCore.WalletConnectorBase {
57
59
  }
58
60
  });
59
61
  }
60
- proveOwnership(messageToSign) {
62
+ proveOwnership(address, messageToSign) {
61
63
  return _tslib.__awaiter(this, void 0, void 0, function* () {
64
+ yield this.validateActiveWallet(address);
62
65
  try {
63
66
  yield this.connect();
64
67
  yield this.signDelay();
@@ -1,8 +1,10 @@
1
1
  import { Chain, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
2
2
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
3
- export declare abstract class FlowWalletConnector extends WalletConnectorBase {
3
+ import { FlowWallet } from './wallet';
4
+ export declare abstract class FlowWalletConnector extends WalletConnectorBase<typeof FlowWallet> {
4
5
  protected appName?: string;
5
6
  protected appLogoUrl?: string;
7
+ ChainWallet: typeof FlowWallet;
6
8
  connectedChain: Chain;
7
9
  supportedChains: Chain[];
8
10
  protected network: 'mainnet' | 'testnet';
@@ -18,7 +20,7 @@ export declare abstract class FlowWalletConnector extends WalletConnectorBase {
18
20
  getNetwork(): Promise<string>;
19
21
  setupConfig(): Promise<void>;
20
22
  getAddress(): Promise<string | undefined>;
21
- proveOwnership(messageToSign: string): Promise<string | undefined>;
23
+ proveOwnership(address: string, messageToSign: string): Promise<string | undefined>;
22
24
  signMessage(messageToSign: string): Promise<string | undefined>;
23
25
  getBalance(address: string): Promise<string | undefined>;
24
26
  endSession(): Promise<void>;
@@ -3,11 +3,13 @@ import { __awaiter } from '../_virtual/_tslib.js';
3
3
  import { currentUser, config, send, script, decode } from '@onflow/fcl';
4
4
  import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
5
5
  import { DynamicError } from '@dynamic-labs/utils';
6
+ import { FlowWallet } from './wallet/FlowWallet.js';
6
7
 
7
8
  class FlowWalletConnector extends WalletConnectorBase {
8
9
  constructor(opts) {
9
10
  var _a;
10
11
  super(opts);
12
+ this.ChainWallet = FlowWallet;
11
13
  this.connectedChain = 'FLOW';
12
14
  this.supportedChains = ['FLOW'];
13
15
  this.appName = opts.appName;
@@ -53,8 +55,9 @@ class FlowWalletConnector extends WalletConnectorBase {
53
55
  }
54
56
  });
55
57
  }
56
- proveOwnership(messageToSign) {
58
+ proveOwnership(address, messageToSign) {
57
59
  return __awaiter(this, void 0, void 0, function* () {
60
+ yield this.validateActiveWallet(address);
58
61
  try {
59
62
  yield this.connect();
60
63
  yield this.signDelay();
package/src/index.cjs CHANGED
@@ -7,9 +7,13 @@ var blocto = require('./blocto.cjs');
7
7
  var dapper = require('./dapper.cjs');
8
8
  var lilico = require('./lilico.cjs');
9
9
  var FlowWalletConnector = require('./FlowWalletConnector.cjs');
10
+ var FlowWallet = require('./wallet/FlowWallet.cjs');
11
+ var isFlowWallet = require('./wallet/isFlowWallet/isFlowWallet.cjs');
10
12
 
11
13
  /* eslint-disable @typescript-eslint/no-unused-vars */
12
14
  const FlowWalletConnectors = (props) => [blocto, dapper, lilico];
13
15
 
14
16
  exports.FlowWalletConnector = FlowWalletConnector.FlowWalletConnector;
17
+ exports.FlowWallet = FlowWallet.FlowWallet;
18
+ exports.isFlowWallet = isFlowWallet.isFlowWallet;
15
19
  exports.FlowWalletConnectors = FlowWalletConnectors;
package/src/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import Blocto from './blocto';
2
2
  export { FlowWalletConnector } from './FlowWalletConnector';
3
+ export * from './wallet';
3
4
  export declare const FlowWalletConnectors: (props: any) => (typeof Blocto)[];
package/src/index.js CHANGED
@@ -3,6 +3,8 @@ import Blocto from './blocto.js';
3
3
  import Dapper from './dapper.js';
4
4
  import Lilico from './lilico.js';
5
5
  export { FlowWalletConnector } from './FlowWalletConnector.js';
6
+ export { FlowWallet } from './wallet/FlowWallet.js';
7
+ export { isFlowWallet } from './wallet/isFlowWallet/isFlowWallet.js';
6
8
 
7
9
  /* eslint-disable @typescript-eslint/no-unused-vars */
8
10
  const FlowWalletConnectors = (props) => [Blocto, Dapper, Lilico];
@@ -0,0 +1,11 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
7
+
8
+ class FlowWallet extends walletConnectorCore.Wallet {
9
+ }
10
+
11
+ exports.FlowWallet = FlowWallet;
@@ -0,0 +1,4 @@
1
+ import { Wallet } from '@dynamic-labs/wallet-connector-core';
2
+ import { FlowWalletConnector } from '../FlowWalletConnector';
3
+ export declare class FlowWallet extends Wallet<FlowWalletConnector> {
4
+ }
@@ -0,0 +1,7 @@
1
+ 'use client'
2
+ import { Wallet } from '@dynamic-labs/wallet-connector-core';
3
+
4
+ class FlowWallet extends Wallet {
5
+ }
6
+
7
+ export { FlowWallet };
@@ -0,0 +1,2 @@
1
+ export * from './FlowWallet';
2
+ export * from './isFlowWallet';
@@ -0,0 +1 @@
1
+ export * from './isFlowWallet';
@@ -0,0 +1,8 @@
1
+ 'use client'
2
+ 'use strict';
3
+
4
+ Object.defineProperty(exports, '__esModule', { value: true });
5
+
6
+ const isFlowWallet = (wallet) => wallet.chain === 'FLOW';
7
+
8
+ exports.isFlowWallet = isFlowWallet;
@@ -0,0 +1,3 @@
1
+ import { Wallet } from '@dynamic-labs/wallet-connector-core';
2
+ import { FlowWallet } from '../FlowWallet';
3
+ export declare const isFlowWallet: (wallet: Wallet) => wallet is FlowWallet;
@@ -0,0 +1,4 @@
1
+ 'use client'
2
+ const isFlowWallet = (wallet) => wallet.chain === 'FLOW';
3
+
4
+ export { isFlowWallet };