@dynamic-labs/ton 4.57.2 → 4.58.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  3. package/package.cjs +1 -1
  4. package/package.js +1 -1
  5. package/package.json +10 -9
  6. package/src/TonWalletConnector.cjs +2 -2
  7. package/src/TonWalletConnector.d.ts +2 -2
  8. package/src/TonWalletConnector.js +1 -1
  9. package/src/index.cjs +0 -5
  10. package/src/index.js +0 -1
  11. package/src/types.d.ts +16 -9
  12. package/src/utils/convertNanoTonToTon/convertNanoTonToTon.d.ts +16 -0
  13. package/src/utils/convertNanoTonToTon/index.d.ts +1 -0
  14. package/src/utils/fetchTonBalance/fetchTonBalance.d.ts +25 -0
  15. package/src/utils/fetchTonBalance/index.d.ts +1 -0
  16. package/src/utils/handleTonConnectError/handleTonConnectError.d.ts +20 -0
  17. package/src/utils/handleTonConnectError/index.d.ts +1 -0
  18. package/src/utils/prepareJettonTransfer/prepareJettonTransfer.cjs +3 -3
  19. package/src/utils/prepareJettonTransfer/prepareJettonTransfer.d.ts +2 -1
  20. package/src/utils/prepareJettonTransfer/prepareJettonTransfer.js +1 -1
  21. package/src/utils/prepareTonTransfer/prepareTonTransfer.cjs +3 -3
  22. package/src/utils/prepareTonTransfer/prepareTonTransfer.d.ts +2 -1
  23. package/src/utils/prepareTonTransfer/prepareTonTransfer.js +1 -1
  24. package/src/utils/prepareTransaction/prepareTransaction.cjs +2 -2
  25. package/src/utils/prepareTransaction/prepareTransaction.d.ts +2 -1
  26. package/src/utils/prepareTransaction/prepareTransaction.js +1 -1
  27. package/src/utils/selectTonWallet/index.d.ts +1 -0
  28. package/src/utils/selectTonWallet/selectTonWallet.d.ts +16 -0
  29. package/src/waas/connector/DynamicWaasTonConnector.cjs +2 -2
  30. package/src/waas/connector/DynamicWaasTonConnector.d.ts +9 -2
  31. package/src/waas/connector/DynamicWaasTonConnector.js +1 -1
  32. package/src/types.cjs +0 -13
  33. package/src/types.js +0 -11
package/CHANGELOG.md CHANGED
@@ -1,4 +1,18 @@
1
1
 
2
+ ## [4.58.0](https://github.com/dynamic-labs/dynamic-auth/compare/v4.57.2...v4.58.0) (2026-01-28)
3
+
4
+
5
+ ### Features
6
+
7
+ * add password setup flow for WaaS wallets ([#10308](https://github.com/dynamic-labs/dynamic-auth/issues/10308)) ([aad892d](https://github.com/dynamic-labs/dynamic-auth/commit/aad892d0359df589753b141c1099a03c72b799d9))
8
+ * add useRefreshAuth ([#10280](https://github.com/dynamic-labs/dynamic-auth/issues/10280)) ([bff850a](https://github.com/dynamic-labs/dynamic-auth/commit/bff850afc4167d47d3a38c5e9845d35b754ea573))
9
+ * **waas:** add unlockWallet and getWalletRecoveryState methods ([#10286](https://github.com/dynamic-labs/dynamic-auth/issues/10286)) ([4c2f26b](https://github.com/dynamic-labs/dynamic-auth/commit/4c2f26b1cd6483406288513d73be66554cd3c66a))
10
+
11
+ ### Bug Fixes
12
+
13
+ * ensure refresh user not update the jwt ([#10278](https://github.com/dynamic-labs/dynamic-auth/issues/10278)) ([c8cdbe6](https://github.com/dynamic-labs/dynamic-auth/commit/c8cdbe6e10636b39985f299a219fa362c25b4cd0))
14
+ * use isVersionedTransaction for reliable Solana transaction type detection ([#10319](https://github.com/dynamic-labs/dynamic-auth/issues/10319)) ([472aa15](https://github.com/dynamic-labs/dynamic-auth/commit/472aa15a94cfe541b22b96c5c63483e6a5971781))
15
+
2
16
  ### [4.57.2](https://github.com/dynamic-labs/dynamic-auth/compare/v4.57.1...v4.57.2) (2026-01-23)
3
17
 
4
18
  ### [4.57.1](https://github.com/dynamic-labs/dynamic-auth/compare/v4.57.0...v4.57.1) (2026-01-22)
package/README.md CHANGED
@@ -4,7 +4,7 @@ TON (The Open Network) blockchain integration for the Dynamic SDK.
4
4
 
5
5
  ## Overview
6
6
 
7
- This package provides seamless integration with TON wallets in your dApp. The package is currently in development and will support wallet connection, transaction handling, and TON-specific functionality.
7
+ This package provides seamless integration with TON wallets in your dApp. The package is currently in development and will support wallet connection, transaction handling, and TON-specific functionality. This package leverages the ton connect sdk to support all wallets that conform to the ton connect standard.
8
8
 
9
9
  ## Installation
10
10
 
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "4.57.2";
6
+ var version = "4.58.0";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "4.57.2";
2
+ var version = "4.58.0";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ton",
3
- "version": "4.57.2",
3
+ "version": "4.58.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",
@@ -18,16 +18,17 @@
18
18
  },
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
- "@dynamic-labs/assert-package-version": "4.57.2",
22
- "@dynamic-labs/logger": "4.57.2",
21
+ "@dynamic-labs/assert-package-version": "4.58.0",
22
+ "@dynamic-labs/logger": "4.58.0",
23
23
  "@dynamic-labs/sdk-api-core": "0.0.860",
24
- "@dynamic-labs/types": "4.57.2",
25
- "@dynamic-labs/utils": "4.57.2",
26
- "@dynamic-labs/waas": "4.57.2",
27
- "@dynamic-labs/wallet-book": "4.57.2",
28
- "@dynamic-labs/wallet-connector-core": "4.57.2",
24
+ "@dynamic-labs/types": "4.58.0",
25
+ "@dynamic-labs/utils": "4.58.0",
26
+ "@dynamic-labs/waas": "4.58.0",
27
+ "@dynamic-labs/wallet-book": "4.58.0",
28
+ "@dynamic-labs/wallet-connector-core": "4.58.0",
29
29
  "@ton/core": "0.62.0",
30
30
  "@ton/crypto": "3.3.0",
31
- "@ton/ton": "16.0.0"
31
+ "@ton/ton": "16.0.0",
32
+ "@tonconnect/sdk": "3.3.1"
32
33
  }
33
34
  }
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../_virtual/_tslib.cjs');
7
7
  var ton = require('@ton/ton');
8
+ var sdk = require('@tonconnect/sdk');
8
9
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
9
10
  var utils = require('@dynamic-labs/utils');
10
11
  var TonWallet = require('./wallet/TonWallet.cjs');
11
- var types = require('./types.cjs');
12
12
 
13
13
  /**
14
14
  * Base TonWalletConnector class for TON blockchain wallets.
@@ -36,7 +36,7 @@ class TonWalletConnector extends walletConnectorCore.WalletConnectorBase {
36
36
  getNetwork() {
37
37
  return _tslib.__awaiter(this, void 0, void 0, function* () {
38
38
  var _a, _b, _c;
39
- return ((_c = (_b = (_a = this.tonNetworks) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.networkId) === null || _c === void 0 ? void 0 : _c.toString()) || types.CHAIN.MAINNET;
39
+ return ((_c = (_b = (_a = this.tonNetworks) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.networkId) === null || _c === void 0 ? void 0 : _c.toString()) || sdk.CHAIN.MAINNET;
40
40
  });
41
41
  }
42
42
  /**
@@ -2,7 +2,7 @@ import { TonClient } from '@ton/ton';
2
2
  import { Chain, WalletConnectorBase } from '@dynamic-labs/wallet-connector-core';
3
3
  import { GenericNetwork } from '@dynamic-labs/types';
4
4
  import { TonWallet } from './wallet/TonWallet';
5
- import { SendTransactionRequest, TonConnectProof, TonWalletConnectorOpts } from './types';
5
+ import { SendTransactionRequest, TonConnectProof, TonConnectConnectorOpts } from './types';
6
6
  /**
7
7
  * Base TonWalletConnector class for TON blockchain wallets.
8
8
  * Provides core functionality for connecting to and interacting with TON wallets.
@@ -12,7 +12,7 @@ export declare abstract class TonWalletConnector extends WalletConnectorBase<typ
12
12
  connectedChain: Chain;
13
13
  supportedChains: Chain[];
14
14
  tonNetworks: GenericNetwork[];
15
- constructor(opts: TonWalletConnectorOpts);
15
+ constructor(opts: TonConnectConnectorOpts);
16
16
  /**
17
17
  * Get the enabled networks for the wallet.
18
18
  * Networks are configured via project settings.
@@ -1,10 +1,10 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../_virtual/_tslib.js';
3
3
  import { TonClient, Address, fromNano } from '@ton/ton';
4
+ import { CHAIN } from '@tonconnect/sdk';
4
5
  import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
5
6
  import { DynamicError } from '@dynamic-labs/utils';
6
7
  import { TonWallet } from './wallet/TonWallet.js';
7
- import { CHAIN } from './types.js';
8
8
 
9
9
  /**
10
10
  * Base TonWalletConnector class for TON blockchain wallets.
package/src/index.cjs CHANGED
@@ -6,7 +6,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
6
6
  var assertPackageVersion = require('@dynamic-labs/assert-package-version');
7
7
  var _package = require('../package.cjs');
8
8
  var TonWalletConnector = require('./TonWalletConnector.cjs');
9
- var types = require('./types.cjs');
10
9
  var TonWallet = require('./wallet/TonWallet.cjs');
11
10
  var isTonWallet = require('./wallet/isTonWallet/isTonWallet.cjs');
12
11
  var WaasTonWallet = require('./wallet/WaasTonWallet.cjs');
@@ -30,10 +29,6 @@ var DynamicWaasTonConnectors = require('./waas/DynamicWaasTonConnectors.cjs');
30
29
  assertPackageVersion.assertPackageVersion('@dynamic-labs/ton', _package.version);
31
30
 
32
31
  exports.TonWalletConnector = TonWalletConnector.TonWalletConnector;
33
- Object.defineProperty(exports, 'CHAIN', {
34
- enumerable: true,
35
- get: function () { return types.CHAIN; }
36
- });
37
32
  exports.TonWallet = TonWallet.TonWallet;
38
33
  exports.isTonWallet = isTonWallet.isTonWallet;
39
34
  exports.WaasTonWallet = WaasTonWallet.WaasTonWallet;
package/src/index.js CHANGED
@@ -2,7 +2,6 @@
2
2
  import { assertPackageVersion } from '@dynamic-labs/assert-package-version';
3
3
  import { version } from '../package.js';
4
4
  export { TonWalletConnector } from './TonWalletConnector.js';
5
- export { CHAIN } from './types.js';
6
5
  export { TonWallet } from './wallet/TonWallet.js';
7
6
  export { isTonWallet } from './wallet/isTonWallet/isTonWallet.js';
8
7
  export { WaasTonWallet } from './wallet/WaasTonWallet.js';
package/src/types.d.ts CHANGED
@@ -1,6 +1,8 @@
1
+ import type { CHAIN } from '@tonconnect/sdk';
1
2
  import { WalletBookSchema } from '@dynamic-labs/wallet-book';
2
3
  import { WalletMetadata } from '@dynamic-labs/wallet-connector-core';
3
4
  import { GenericNetwork } from '@dynamic-labs/types';
5
+ export { CHAIN };
4
6
  /**
5
7
  * Domain information for TON Connect protocol
6
8
  */
@@ -25,13 +27,6 @@ export interface TonConnectProof {
25
27
  /** Signature as base64 string */
26
28
  signature: string;
27
29
  }
28
- /**
29
- * Network chain identifier for TON
30
- */
31
- export declare enum CHAIN {
32
- MAINNET = "-239",
33
- TESTNET = "-3"
34
- }
35
30
  /**
36
31
  * TON Connect compatible transaction request
37
32
  * @see https://ton-connect.github.io/sdk/interfaces/_tonconnect_ui.SendTransactionRequest.html
@@ -73,10 +68,22 @@ export interface TonTransactionData {
73
68
  timeout: number;
74
69
  }
75
70
  /**
76
- * Options for creating a TonWalletConnector
71
+ * Options for creating a TON Connect connector instance.
77
72
  */
78
- export type TonWalletConnectorOpts = {
73
+ export type TonConnectConnectorOpts = {
74
+ /** The wallet book schema containing wallet configurations */
79
75
  walletBook: WalletBookSchema;
76
+ /** TON network configurations (mainnet, testnet, etc.) */
80
77
  tonNetworks: GenericNetwork[];
78
+ /** Optional wallet metadata */
81
79
  metadata?: WalletMetadata;
80
+ /** Optional manifest URL for TON Connect (required for TON Connect initialization) */
81
+ manifestUrl?: string;
82
+ };
83
+ /**
84
+ * TON network configuration.
85
+ */
86
+ export type TonNetwork = GenericNetwork & {
87
+ /** TON chain ID using CHAIN enum from @tonconnect/sdk */
88
+ chainId: CHAIN;
82
89
  };
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Converts nanoTON (smallest unit) to TON with proper decimal formatting.
3
+ *
4
+ * TON uses nanoTON as its smallest unit, where 1 TON = 10^9 nanoTON.
5
+ *
6
+ * @param balanceNano - The balance in nanoTON as a string
7
+ * @returns The balance in TON as a string with proper decimal formatting
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * convertNanoTonToTon('1000000000') // Returns '1'
12
+ * convertNanoTonToTon('1500000000') // Returns '1.5'
13
+ * convertNanoTonToTon('123456789') // Returns '0.123456789'
14
+ * ```
15
+ */
16
+ export declare const convertNanoTonToTon: (balanceNano: string) => string;
@@ -0,0 +1 @@
1
+ export { convertNanoTonToTon } from './convertNanoTonToTon';
@@ -0,0 +1,25 @@
1
+ import type { GenericNetwork } from '@dynamic-labs/types';
2
+ /**
3
+ * Fetches the balance of a TON address using the TON RPC API.
4
+ *
5
+ * @param address - The TON address to fetch balance for
6
+ * @param rpcUrl - The RPC URL for the TON network
7
+ * @returns The balance in TON as a string, or '0' if the fetch fails
8
+ *
9
+ * @example
10
+ * ```typescript
11
+ * const balance = await fetchTonBalance(
12
+ * 'EQD...',
13
+ * 'https://toncenter.com/api/v2/jsonRPC'
14
+ * );
15
+ * ```
16
+ */
17
+ export declare const fetchTonBalance: (address: string, rpcUrl: string) => Promise<string>;
18
+ /**
19
+ * Gets the RPC URL for a given chain ID from network configurations.
20
+ *
21
+ * @param chainId - The chain ID to find the network for
22
+ * @param networks - Array of network configurations
23
+ * @returns The first RPC URL for the network, or undefined if not found
24
+ */
25
+ export declare const getRpcUrlForChain: (chainId: string, networks: GenericNetwork[]) => string | undefined;
@@ -0,0 +1 @@
1
+ export { fetchTonBalance, getRpcUrlForChain } from './fetchTonBalance';
@@ -0,0 +1,20 @@
1
+ import { DynamicError } from '@dynamic-labs/utils';
2
+ /**
3
+ * Transforms TON Connect SDK errors into DynamicError instances.
4
+ *
5
+ * This provides more user-friendly error messages and consistent error handling
6
+ * across the Dynamic SDK.
7
+ *
8
+ * @param error - The error to transform
9
+ * @returns A DynamicError with an appropriate message
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * try {
14
+ * await tonConnect.connect(wallet);
15
+ * } catch (error) {
16
+ * throw handleTonConnectError(error);
17
+ * }
18
+ * ```
19
+ */
20
+ export declare const handleTonConnectError: (error: unknown) => DynamicError;
@@ -0,0 +1 @@
1
+ export { handleTonConnectError } from './handleTonConnectError';
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../../_virtual/_tslib.cjs');
7
7
  var ton = require('@ton/ton');
8
- var types = require('../../types.cjs');
8
+ var sdk = require('@tonconnect/sdk');
9
9
  var getJettonWalletAddress = require('../getJettonWalletAddress/getJettonWalletAddress.cjs');
10
10
 
11
11
  const DEFAULT_JETTON_GAS = BigInt(50000000);
@@ -16,7 +16,7 @@ const DEFAULT_JETTON_GAS = BigInt(50000000);
16
16
  * @returns TON Connect SendTransactionRequest
17
17
  */
18
18
  const prepareJettonTransfer = (params) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
19
- const { walletAddress, jettonMasterAddress, recipientAddress, jettonAmount, forwardTonAmount, client, forwardPayload = '', timeout = 60, gasAmount = DEFAULT_JETTON_GAS, network = types.CHAIN.MAINNET, } = params;
19
+ const { walletAddress, jettonMasterAddress, recipientAddress, jettonAmount, forwardTonAmount, client, forwardPayload = '', timeout = 60, gasAmount = DEFAULT_JETTON_GAS, network = sdk.CHAIN.MAINNET, } = params;
20
20
  const validUntil = Math.floor(Date.now() / 1000) + timeout;
21
21
  const jettonWalletAddress = yield getJettonWalletAddress.getJettonWalletAddress({
22
22
  client,
@@ -26,7 +26,7 @@ const prepareJettonTransfer = (params) => _tslib.__awaiter(void 0, void 0, void
26
26
  const jettonWalletAddr = ton.Address.parse(jettonWalletAddress);
27
27
  const recipientAddr = ton.Address.parse(recipientAddress);
28
28
  const walletAddr = ton.Address.parse(walletAddress);
29
- const isTestnet = network === types.CHAIN.TESTNET;
29
+ const isTestnet = network === sdk.CHAIN.TESTNET;
30
30
  // Build jetton transfer payload
31
31
  // Jetton transfer message format (TEP-74):
32
32
  // transfer#0f8a7ea5 query_id:uint64 amount:(VarUInteger 16)
@@ -1,5 +1,6 @@
1
1
  import { TonClient } from '@ton/ton';
2
- import { CHAIN, SendTransactionRequest } from '../../types';
2
+ import { CHAIN } from '@tonconnect/sdk';
3
+ import { SendTransactionRequest } from '../../types';
3
4
  export interface PrepareJettonTransferParams {
4
5
  /** Sender wallet address */
5
6
  walletAddress: string;
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { Address, beginCell } from '@ton/ton';
4
- import { CHAIN } from '../../types.js';
4
+ import { CHAIN } from '@tonconnect/sdk';
5
5
  import { getJettonWalletAddress } from '../getJettonWalletAddress/getJettonWalletAddress.js';
6
6
 
7
7
  const DEFAULT_JETTON_GAS = BigInt(50000000);
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../../_virtual/_tslib.cjs');
7
7
  var ton = require('@ton/ton');
8
- var types = require('../../types.cjs');
8
+ var sdk = require('@tonconnect/sdk');
9
9
 
10
10
  /**
11
11
  * Prepares a native TON transfer transaction
@@ -14,12 +14,12 @@ var types = require('../../types.cjs');
14
14
  * @returns TON Connect SendTransactionRequest
15
15
  */
16
16
  const prepareTonTransfer = (params) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
17
- const { walletAddress, recipient, amount, timeout = 60, network = types.CHAIN.MAINNET, } = params;
17
+ const { walletAddress, recipient, amount, timeout = 60, network = sdk.CHAIN.MAINNET, } = params;
18
18
  const validUntil = Math.floor(Date.now() / 1000) + timeout;
19
19
  const recipientAddress = ton.Address.parse(recipient);
20
20
  const amountNano = ton.toNano(amount.toString());
21
21
  const walletAddr = ton.Address.parse(walletAddress);
22
- const isTestnet = network === types.CHAIN.TESTNET;
22
+ const isTestnet = network === sdk.CHAIN.TESTNET;
23
23
  // Create TON Connect compatible message
24
24
  const message = {
25
25
  address: recipientAddress.toString({
@@ -1,5 +1,6 @@
1
1
  import { TonClient } from '@ton/ton';
2
- import { CHAIN, SendTransactionRequest } from '../../types';
2
+ import { CHAIN } from '@tonconnect/sdk';
3
+ import { SendTransactionRequest } from '../../types';
3
4
  export interface PrepareTonTransferParams {
4
5
  /** Sender wallet address */
5
6
  walletAddress: string;
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { Address, toNano } from '@ton/ton';
4
- import { CHAIN } from '../../types.js';
4
+ import { CHAIN } from '@tonconnect/sdk';
5
5
 
6
6
  /**
7
7
  * Prepares a native TON transfer transaction
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var ton = require('@ton/ton');
7
7
  var core = require('@ton/core');
8
- var types = require('../../types.cjs');
8
+ var sdk = require('@tonconnect/sdk');
9
9
 
10
10
  /**
11
11
  * Prepares a v5r1 wallet transaction from an array of actions
@@ -14,7 +14,7 @@ var types = require('../../types.cjs');
14
14
  * @returns The hash to sign and transaction data
15
15
  */
16
16
  const prepareTransaction = (params) => {
17
- const { actionsArray, walletAddress, seqno, validUntil, timeout, networkGlobalId = types.CHAIN.MAINNET, } = params;
17
+ const { actionsArray, walletAddress, seqno, validUntil, timeout, networkGlobalId = sdk.CHAIN.MAINNET, } = params;
18
18
  const walletAddr = ton.Address.parse(walletAddress);
19
19
  // Build actions cell from actions array
20
20
  const actionsCell = ton.beginCell().store(core.storeOutList(actionsArray)).endCell();
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { OutActionSendMsg } from '@ton/core';
3
- import { CHAIN, type TonTransactionData } from '../../types';
3
+ import { CHAIN } from '@tonconnect/sdk';
4
+ import { type TonTransactionData } from '../../types';
4
5
  export interface PrepareTransactionParams {
5
6
  /** Array of actions to include in the transaction */
6
7
  actionsArray: OutActionSendMsg[];
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { Address, beginCell, WalletContractV5R1 } from '@ton/ton';
3
3
  import { storeOutList } from '@ton/core';
4
- import { CHAIN } from '../../types.js';
4
+ import { CHAIN } from '@tonconnect/sdk';
5
5
 
6
6
  /**
7
7
  * Prepares a v5r1 wallet transaction from an array of actions
@@ -0,0 +1 @@
1
+ export { selectTonWallet, checkWalletFeatures } from './selectTonWallet';
@@ -0,0 +1,16 @@
1
+ import { type WalletInfo, type RequiredFeatures } from '@tonconnect/sdk';
2
+ /**
3
+ * Selects the best wallet from available wallets, preferring injected wallets.
4
+ *
5
+ * @param wallets - Array of available TON Connect wallets
6
+ * @returns The selected wallet, or undefined if no wallet is available
7
+ */
8
+ export declare const selectTonWallet: (wallets: WalletInfo[]) => WalletInfo | undefined;
9
+ /**
10
+ * Checks if a wallet supports the required features and logs a warning if not.
11
+ *
12
+ * @param wallet - The wallet to check
13
+ * @param requiredFeatures - The required features configuration
14
+ * @returns true if the wallet supports all required features, false otherwise
15
+ */
16
+ export declare const checkWalletFeatures: (wallet: WalletInfo, requiredFeatures: RequiredFeatures) => boolean;
@@ -4,13 +4,13 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../../../_virtual/_tslib.cjs');
7
+ var sdk = require('@tonconnect/sdk');
7
8
  var sdkApiCore = require('@dynamic-labs/sdk-api-core');
8
9
  var utils = require('@dynamic-labs/utils');
9
10
  var waas = require('@dynamic-labs/waas');
10
11
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
11
12
  var TonUiTransaction = require('../../utils/TonUiTransaction/TonUiTransaction.cjs');
12
13
  var TonWalletConnector = require('../../TonWalletConnector.cjs');
13
- var types = require('../../types.cjs');
14
14
  var convertSendTransactionRequest = require('../../utils/convertSendTransactionRequest/convertSendTransactionRequest.cjs');
15
15
  var executeTransaction = require('../../utils/executeTransaction/executeTransaction.cjs');
16
16
  var extractDisplayInfoFromRequest = require('../../utils/extractDisplayInfoFromRequest/extractDisplayInfoFromRequest.cjs');
@@ -225,7 +225,7 @@ class DynamicWaasTonConnector extends waas.withDynamicWaas(TonWalletConnector.To
225
225
  }
226
226
  const client = this.getTonClient();
227
227
  const walletAddress = request.from || this.activeAccountAddress;
228
- const network = request.network || types.CHAIN.MAINNET;
228
+ const network = request.network || sdk.CHAIN.MAINNET;
229
229
  const deployed = yield isWalletDeployed.isWalletDeployed({ client, walletAddress });
230
230
  const seqno = deployed ? yield getWalletSeqno.getWalletSeqno(walletAddress, client) : 0;
231
231
  const stateInit = deployed
@@ -3,10 +3,10 @@ import { JwtVerifiedCredential, MFAAction, SignMessageContext } from '@dynamic-l
3
3
  import { IUITransaction, WalletUiUtils } from '@dynamic-labs/types';
4
4
  import { IDynamicWaasConnector, InternalWalletConnector } from '@dynamic-labs/wallet-connector-core';
5
5
  import { TonWalletConnector } from '../../TonWalletConnector';
6
- import { SendTransactionRequest, TonConnectProof, TonWalletConnectorOpts } from '../../types';
6
+ import { SendTransactionRequest, TonConnectProof, TonConnectConnectorOpts } from '../../types';
7
7
  import { Logger } from '../../utils/logger/logger';
8
8
  import { WaasTonWallet } from '../../wallet/WaasTonWallet';
9
- export type DynamicWaasTonConnectorProps = TonWalletConnectorOpts & {
9
+ export type DynamicWaasTonConnectorProps = TonConnectConnectorOpts & {
10
10
  walletUiUtils: WalletUiUtils<InternalWalletConnector>;
11
11
  };
12
12
  declare const DynamicWaasTonConnector_base: (abstract new (...args: any[]) => {
@@ -114,6 +114,13 @@ declare const DynamicWaasTonConnector_base: (abstract new (...args: any[]) => {
114
114
  message: string;
115
115
  password?: string | undefined;
116
116
  }): Promise<string>;
117
+ unlockWallet({ accountAddress, password, }: {
118
+ accountAddress: string;
119
+ password: string;
120
+ }): Promise<import("@dynamic-labs-wallet/core").GetWalletResponse>;
121
+ getWalletRecoveryState({ accountAddress, }: {
122
+ accountAddress: string;
123
+ }): Promise<import("@dynamic-labs-wallet/core").WalletRecoveryState>;
117
124
  endSession(): Promise<void>;
118
125
  getActiveAccountAddress(): Promise<string | undefined>;
119
126
  getConnectedAccounts(): Promise<string[]>;
@@ -1,12 +1,12 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../_virtual/_tslib.js';
3
+ import { CHAIN } from '@tonconnect/sdk';
3
4
  import { MFAAction } from '@dynamic-labs/sdk-api-core';
4
5
  import { DynamicError, PlatformService } from '@dynamic-labs/utils';
5
6
  import { withDynamicWaas } from '@dynamic-labs/waas';
6
7
  import { isSameAddress } from '@dynamic-labs/wallet-connector-core';
7
8
  import { TonUiTransaction, NANOTON_PER_TON } from '../../utils/TonUiTransaction/TonUiTransaction.js';
8
9
  import { TonWalletConnector } from '../../TonWalletConnector.js';
9
- import { CHAIN } from '../../types.js';
10
10
  import { convertSendTransactionRequest } from '../../utils/convertSendTransactionRequest/convertSendTransactionRequest.js';
11
11
  import { executeTransaction } from '../../utils/executeTransaction/executeTransaction.js';
12
12
  import { extractDisplayInfoFromRequest } from '../../utils/extractDisplayInfoFromRequest/extractDisplayInfoFromRequest.js';
package/src/types.cjs DELETED
@@ -1,13 +0,0 @@
1
- 'use client'
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, '__esModule', { value: true });
5
-
6
- /**
7
- * Network chain identifier for TON
8
- */
9
- exports.CHAIN = void 0;
10
- (function (CHAIN) {
11
- CHAIN["MAINNET"] = "-239";
12
- CHAIN["TESTNET"] = "-3";
13
- })(exports.CHAIN || (exports.CHAIN = {}));
package/src/types.js DELETED
@@ -1,11 +0,0 @@
1
- 'use client'
2
- /**
3
- * Network chain identifier for TON
4
- */
5
- var CHAIN;
6
- (function (CHAIN) {
7
- CHAIN["MAINNET"] = "-239";
8
- CHAIN["TESTNET"] = "-3";
9
- })(CHAIN || (CHAIN = {}));
10
-
11
- export { CHAIN };