@dynamic-labs/aptos 4.40.2 → 4.41.0

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,16 @@
1
1
 
2
+ ## [4.41.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.2...v4.41.0) (2025-10-29)
3
+
4
+
5
+ ### Features
6
+
7
+ * **react-native:** add MFA recovery methods ([#9788](https://github.com/dynamic-labs/dynamic-auth/issues/9788)) ([664e0d5](https://github.com/dynamic-labs/dynamic-auth/commit/664e0d5878530abc9e645c8801a87f3109cfd8f9))
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * crypto.com link opening on mobile ([#9779](https://github.com/dynamic-labs/dynamic-auth/issues/9779)) ([3439ac9](https://github.com/dynamic-labs/dynamic-auth/commit/3439ac9e2610360c6204f6195433ae3e05e26c30))
13
+
2
14
  ### [4.40.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.40.1...v4.40.2) (2025-10-28)
3
15
 
4
16
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.40.2";
6
+ var version = "4.41.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.40.2";
2
+ var version = "4.41.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/aptos",
3
- "version": "4.40.2",
3
+ "version": "4.41.0",
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",
@@ -20,13 +20,13 @@
20
20
  "dependencies": {
21
21
  "@aptos-labs/ts-sdk": "5.1.1",
22
22
  "@aptos-labs/wallet-standard": "0.5.2",
23
- "@dynamic-labs/assert-package-version": "4.40.2",
23
+ "@dynamic-labs/assert-package-version": "4.41.0",
24
24
  "@wallet-standard/core": "1.1.1",
25
25
  "@wallet-standard/features": "1.0.3",
26
- "@dynamic-labs/logger": "4.40.2",
27
- "@dynamic-labs/utils": "4.40.2",
28
- "@dynamic-labs/wallet-book": "4.40.2",
29
- "@dynamic-labs/wallet-connector-core": "4.40.2"
26
+ "@dynamic-labs/logger": "4.41.0",
27
+ "@dynamic-labs/utils": "4.41.0",
28
+ "@dynamic-labs/wallet-book": "4.41.0",
29
+ "@dynamic-labs/wallet-connector-core": "4.41.0"
30
30
  },
31
31
  "peerDependencies": {}
32
32
  }
@@ -14,6 +14,25 @@ var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
14
14
  * methods for transactions, signing, and network operations.
15
15
  */
16
16
  class AptosWallet extends walletConnectorCore.Wallet {
17
+ /**
18
+ * Get balance of the wallet.
19
+ * @returns Balance of the wallet
20
+ */
21
+ getBalance() {
22
+ return _tslib.__awaiter(this, void 0, void 0, function* () {
23
+ yield this._connector.connect();
24
+ const aptosClient = yield this.getAptosClient();
25
+ if (!aptosClient) {
26
+ throw new Error('Aptos client not available');
27
+ }
28
+ const balance = yield aptosClient.getBalance({
29
+ accountAddress: this.address,
30
+ // APT coin type
31
+ asset: '0x1::aptos_coin::AptosCoin',
32
+ });
33
+ return (balance / Math.pow(10, 8)).toString();
34
+ });
35
+ }
17
36
  /**
18
37
  * Sends balance to another address.
19
38
  * @param amount - Amount to send (in APT for native transfers)
@@ -11,6 +11,11 @@ import type { AptosWalletConnector } from '../connectors/AptosWalletConnector/Ap
11
11
  * methods for transactions, signing, and network operations.
12
12
  */
13
13
  export declare class AptosWallet extends Wallet<AptosWalletConnector> {
14
+ /**
15
+ * Get balance of the wallet.
16
+ * @returns Balance of the wallet
17
+ */
18
+ getBalance(): Promise<string>;
14
19
  /**
15
20
  * Sends balance to another address.
16
21
  * @param amount - Amount to send (in APT for native transfers)
@@ -10,6 +10,25 @@ import { Wallet } from '@dynamic-labs/wallet-connector-core';
10
10
  * methods for transactions, signing, and network operations.
11
11
  */
12
12
  class AptosWallet extends Wallet {
13
+ /**
14
+ * Get balance of the wallet.
15
+ * @returns Balance of the wallet
16
+ */
17
+ getBalance() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ yield this._connector.connect();
20
+ const aptosClient = yield this.getAptosClient();
21
+ if (!aptosClient) {
22
+ throw new Error('Aptos client not available');
23
+ }
24
+ const balance = yield aptosClient.getBalance({
25
+ accountAddress: this.address,
26
+ // APT coin type
27
+ asset: '0x1::aptos_coin::AptosCoin',
28
+ });
29
+ return (balance / Math.pow(10, 8)).toString();
30
+ });
31
+ }
13
32
  /**
14
33
  * Sends balance to another address.
15
34
  * @param amount - Amount to send (in APT for native transfers)
@@ -8,7 +8,7 @@ var walletStandard = require('@aptos-labs/wallet-standard');
8
8
  var logger$1 = require('@dynamic-labs/logger');
9
9
 
10
10
  const logger = new logger$1.Logger('AptosWalletStandardConnector');
11
- const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
11
+ const createAptosSignerFromWalletStandard = ({ wallet, }) => {
12
12
  const features = wallet.features;
13
13
  const hasAutoConnectedAccounts = () => {
14
14
  var _a, _b, _c;
@@ -63,9 +63,7 @@ const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
63
63
  }
64
64
  return {
65
65
  args: new walletStandard.AccountInfo({
66
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
66
  address: resultArgs.address,
68
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
69
67
  publicKey: resultArgs.publicKey,
70
68
  }),
71
69
  status: walletStandard.UserResponseStatus.APPROVED,
@@ -91,9 +89,10 @@ const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
91
89
  });
92
90
  });
93
91
  const network = () => _tslib.__awaiter(void 0, void 0, void 0, function* () {
92
+ var _e;
94
93
  try {
95
94
  // Try to get network info from the wallet connector
96
- const networkInfo = yield walletConnector.getNetworkInfo();
95
+ const networkInfo = yield ((_e = features['aptos:network']) === null || _e === void 0 ? void 0 : _e.network());
97
96
  if (networkInfo) {
98
97
  return networkInfo;
99
98
  }
@@ -151,9 +150,7 @@ const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
151
150
  const account = (_a = prop.accounts) === null || _a === void 0 ? void 0 : _a[0];
152
151
  if (account) {
153
152
  callback(new walletStandard.AccountInfo({
154
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
155
153
  address: account.address,
156
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
157
154
  publicKey: account.publicKey,
158
155
  }));
159
156
  }
@@ -1,9 +1,7 @@
1
1
  import type { Wallet } from '@aptos-labs/wallet-standard';
2
2
  import type { IAptosProvider } from '../types';
3
- import { AptosWalletConnector } from '../connectors/AptosWalletConnector';
4
3
  type CreateAptosSignerFromWalletStandardProps = {
5
4
  wallet: Wallet;
6
- walletConnector: AptosWalletConnector;
7
5
  };
8
- export declare const createAptosSignerFromWalletStandard: ({ wallet, walletConnector, }: CreateAptosSignerFromWalletStandardProps) => IAptosProvider;
6
+ export declare const createAptosSignerFromWalletStandard: ({ wallet, }: CreateAptosSignerFromWalletStandardProps) => IAptosProvider;
9
7
  export {};
@@ -4,7 +4,7 @@ import { AccountInfo, UserResponseStatus } from '@aptos-labs/wallet-standard';
4
4
  import { Logger } from '@dynamic-labs/logger';
5
5
 
6
6
  const logger = new Logger('AptosWalletStandardConnector');
7
- const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
7
+ const createAptosSignerFromWalletStandard = ({ wallet, }) => {
8
8
  const features = wallet.features;
9
9
  const hasAutoConnectedAccounts = () => {
10
10
  var _a, _b, _c;
@@ -59,9 +59,7 @@ const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
59
59
  }
60
60
  return {
61
61
  args: new AccountInfo({
62
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
62
  address: resultArgs.address,
64
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
63
  publicKey: resultArgs.publicKey,
66
64
  }),
67
65
  status: UserResponseStatus.APPROVED,
@@ -87,9 +85,10 @@ const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
87
85
  });
88
86
  });
89
87
  const network = () => __awaiter(void 0, void 0, void 0, function* () {
88
+ var _e;
90
89
  try {
91
90
  // Try to get network info from the wallet connector
92
- const networkInfo = yield walletConnector.getNetworkInfo();
91
+ const networkInfo = yield ((_e = features['aptos:network']) === null || _e === void 0 ? void 0 : _e.network());
93
92
  if (networkInfo) {
94
93
  return networkInfo;
95
94
  }
@@ -147,9 +146,7 @@ const createAptosSignerFromWalletStandard = ({ wallet, walletConnector, }) => {
147
146
  const account = (_a = prop.accounts) === null || _a === void 0 ? void 0 : _a[0];
148
147
  if (account) {
149
148
  callback(new AccountInfo({
150
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
151
149
  address: account.address,
152
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
153
150
  publicKey: account.publicKey,
154
151
  }));
155
152
  }
@@ -16,7 +16,6 @@ const getConnectorConstructorForWalletStandardWallet = (wallet, walletBookMetada
16
16
  this.overrideKey = `${sanitizedName}aptos`;
17
17
  this._provider = createAptosSignerFromWalletStandard.createAptosSignerFromWalletStandard({
18
18
  wallet,
19
- walletConnector: this,
20
19
  });
21
20
  }
22
21
  findProvider() {
@@ -12,7 +12,6 @@ const getConnectorConstructorForWalletStandardWallet = (wallet, walletBookMetada
12
12
  this.overrideKey = `${sanitizedName}aptos`;
13
13
  this._provider = createAptosSignerFromWalletStandard({
14
14
  wallet,
15
- walletConnector: this,
16
15
  });
17
16
  }
18
17
  findProvider() {