@dynamic-labs/ton 5.9.4 → 5.9.6

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,15 @@
1
1
 
2
+ ### [5.9.6](https://github.com/dynamic-labs/dynamic-auth/compare/v5.9.5...v5.9.6) (2026-10-06)
3
+
4
+ ### [5.9.5](https://github.com/dynamic-labs/dynamic-auth/compare/v5.9.4...v5.9.5) (2026-10-06)
5
+
6
+
7
+ ### Bug Fixes
8
+
9
+ * **ton:** move encodeComment to base TonWalletConnector ([#12459](https://github.com/dynamic-labs/dynamic-auth/issues/12459)) ([647df5b](https://github.com/dynamic-labs/dynamic-auth/commit/647df5bc3986d59d89dbe31bbd3ebe1c4605ec40))
10
+ * **waas-svm:** apply overrideBlockhash before sponsorship ([#12319](https://github.com/dynamic-labs/dynamic-auth/issues/12319)) ([074ce3c](https://github.com/dynamic-labs/dynamic-auth/commit/074ce3c4ecfa080b683c84120fa7643e8fe064d4)), closes [#10599](https://github.com/dynamic-labs/dynamic-auth/issues/10599) [#10599](https://github.com/dynamic-labs/dynamic-auth/issues/10599) [#10599](https://github.com/dynamic-labs/dynamic-auth/issues/10599) [#10599](https://github.com/dynamic-labs/dynamic-auth/issues/10599)
11
+ * **wallet-book:** use phantom.com for Phantom in-app-browser links ([#12456](https://github.com/dynamic-labs/dynamic-auth/issues/12456)) ([e762553](https://github.com/dynamic-labs/dynamic-auth/commit/e7625534f8beda3e649f121e637451e2188faef6))
12
+
2
13
  ### [5.9.4](https://github.com/dynamic-labs/dynamic-auth/compare/v5.9.3...v5.9.4) (2026-10-02)
3
14
 
4
15
  ### [5.9.3](https://github.com/dynamic-labs/dynamic-auth/compare/v5.9.2...v5.9.3) (2026-10-02)
package/package.cjs CHANGED
@@ -3,6 +3,6 @@
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
- var version = "5.9.4";
6
+ var version = "5.9.6";
7
7
 
8
8
  exports.version = version;
package/package.js CHANGED
@@ -1,4 +1,4 @@
1
1
  'use client'
2
- var version = "5.9.4";
2
+ var version = "5.9.6";
3
3
 
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamic-labs/ton",
3
- "version": "5.9.4",
3
+ "version": "5.9.6",
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,14 +19,14 @@
19
19
  "homepage": "https://www.dynamic.xyz/",
20
20
  "dependencies": {
21
21
  "@dynamic-labs-sdk/client": "1.37.0",
22
- "@dynamic-labs/assert-package-version": "5.9.4",
23
- "@dynamic-labs/logger": "5.9.4",
22
+ "@dynamic-labs/assert-package-version": "5.9.6",
23
+ "@dynamic-labs/logger": "5.9.6",
24
24
  "@dynamic-labs/sdk-api-core": "0.70.0",
25
- "@dynamic-labs/types": "5.9.4",
26
- "@dynamic-labs/utils": "5.9.4",
27
- "@dynamic-labs/waas": "5.9.4",
28
- "@dynamic-labs/wallet-book": "5.9.4",
29
- "@dynamic-labs/wallet-connector-core": "5.9.4",
25
+ "@dynamic-labs/types": "5.9.6",
26
+ "@dynamic-labs/utils": "5.9.6",
27
+ "@dynamic-labs/waas": "5.9.6",
28
+ "@dynamic-labs/wallet-book": "5.9.6",
29
+ "@dynamic-labs/wallet-connector-core": "5.9.6",
30
30
  "@ton/core": "0.62.0",
31
31
  "@ton/crypto": "3.3.0",
32
32
  "@ton/ton": "16.0.0",
@@ -4,6 +4,7 @@
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
5
5
 
6
6
  var _tslib = require('../_virtual/_tslib.cjs');
7
+ var core = require('@ton/core');
7
8
  var ton = require('@ton/ton');
8
9
  var sdk = require('@tonconnect/sdk');
9
10
  var walletConnectorCore = require('@dynamic-labs/wallet-connector-core');
@@ -82,6 +83,21 @@ class TonWalletConnector extends walletConnectorCore.WalletConnectorBase {
82
83
  }
83
84
  });
84
85
  }
86
+ /**
87
+ * Encodes a text comment (memo) as a base64 BOC message payload.
88
+ * Uses the standard text comment layout (32-bit zero opcode, then the UTF-8
89
+ * text). `storeStringTail` splits long text into a snake-cell chain.
90
+ * @param comment - The comment text
91
+ * @returns The base64-encoded BOC
92
+ */
93
+ encodeComment(comment) {
94
+ return core.beginCell()
95
+ .storeUint(0, 32)
96
+ .storeStringTail(comment)
97
+ .endCell()
98
+ .toBoc()
99
+ .toString('base64');
100
+ }
85
101
  }
86
102
 
87
103
  exports.TonWalletConnector = TonWalletConnector;
@@ -35,6 +35,14 @@ export declare abstract class TonWalletConnector extends WalletConnectorBase<typ
35
35
  * Get the balance for a TON address.
36
36
  */
37
37
  getBalance(address: string): Promise<string | undefined>;
38
+ /**
39
+ * Encodes a text comment (memo) as a base64 BOC message payload.
40
+ * Uses the standard text comment layout (32-bit zero opcode, then the UTF-8
41
+ * text). `storeStringTail` splits long text into a snake-cell chain.
42
+ * @param comment - The comment text
43
+ * @returns The base64-encoded BOC
44
+ */
45
+ encodeComment(comment: string): string;
38
46
  /**
39
47
  * Signs a message with the wallet.
40
48
  * @param message - The message to sign
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../_virtual/_tslib.js';
3
+ import { beginCell } from '@ton/core';
3
4
  import { TonClient, Address, fromNano } from '@ton/ton';
4
5
  import { CHAIN } from '@tonconnect/sdk';
5
6
  import { WalletConnectorBase, logger } from '@dynamic-labs/wallet-connector-core';
@@ -78,6 +79,21 @@ class TonWalletConnector extends WalletConnectorBase {
78
79
  }
79
80
  });
80
81
  }
82
+ /**
83
+ * Encodes a text comment (memo) as a base64 BOC message payload.
84
+ * Uses the standard text comment layout (32-bit zero opcode, then the UTF-8
85
+ * text). `storeStringTail` splits long text into a snake-cell chain.
86
+ * @param comment - The comment text
87
+ * @returns The base64-encoded BOC
88
+ */
89
+ encodeComment(comment) {
90
+ return beginCell()
91
+ .storeUint(0, 32)
92
+ .storeStringTail(comment)
93
+ .endCell()
94
+ .toBoc()
95
+ .toString('base64');
96
+ }
81
97
  }
82
98
 
83
99
  export { TonWalletConnector };
@@ -448,42 +448,6 @@ class TonConnectConnector extends TonWalletConnector.TonWalletConnector {
448
448
  return address;
449
449
  }
450
450
  }
451
- /**
452
- * Encode a comment as TON message payload.
453
- * NOTE: TON cells support a maximum of 4 references per cell.
454
- * Comments longer than 123 + (4 * 127) = 631 bytes will exceed
455
- * this limit. Consider implementing proper snake-cell encoding
456
- * for arbitrarily long comments if needed.
457
- */
458
- encodeComment(comment) {
459
- const encoder = new TextEncoder();
460
- const commentBytes = encoder.encode(comment);
461
- const maxBytesPerCell = 123;
462
- if (commentBytes.length <= maxBytesPerCell) {
463
- const cell = core.beginCell()
464
- .storeUint(0, 32)
465
- .storeBuffer(Buffer.from(commentBytes))
466
- .endCell();
467
- return cell.toBoc().toString('base64');
468
- }
469
- const firstChunk = commentBytes.slice(0, maxBytesPerCell);
470
- const remainingBytes = commentBytes.slice(maxBytesPerCell);
471
- let remainingData = remainingBytes;
472
- const referenceCells = [];
473
- while (remainingData.length > 0) {
474
- const chunk = remainingData.slice(0, 127);
475
- remainingData = remainingData.slice(127);
476
- referenceCells.push(core.beginCell().storeBuffer(Buffer.from(chunk)).endCell());
477
- }
478
- let mainCellBuilder = core.beginCell()
479
- .storeUint(0, 32)
480
- .storeBuffer(Buffer.from(firstChunk));
481
- for (const refCell of referenceCells) {
482
- mainCellBuilder = mainCellBuilder.storeRef(refCell);
483
- }
484
- const mainCell = mainCellBuilder.endCell();
485
- return mainCell.toBoc().toString('base64');
486
- }
487
451
  /**
488
452
  * Elevate the TonConnect UI above the Dynamic auth modal and prevent
489
453
  * the Dynamic backdrop from intercepting pointer events.
@@ -95,14 +95,6 @@ export declare class TonConnectConnector extends TonWalletConnector {
95
95
  * Convert TON address from raw format (0:hex) to user-friendly format (UQ...)
96
96
  */
97
97
  private convertAddressToUserFriendly;
98
- /**
99
- * Encode a comment as TON message payload.
100
- * NOTE: TON cells support a maximum of 4 references per cell.
101
- * Comments longer than 123 + (4 * 127) = 631 bytes will exceed
102
- * this limit. Consider implementing proper snake-cell encoding
103
- * for arbitrarily long comments if needed.
104
- */
105
- encodeComment(comment: string): string;
106
98
  /**
107
99
  * Elevate the TonConnect UI above the Dynamic auth modal and prevent
108
100
  * the Dynamic backdrop from intercepting pointer events.
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../_virtual/_tslib.js';
3
3
  import { TonConnectUI } from '@tonconnect/ui';
4
- import { Address, beginCell, Cell, loadStateInit } from '@ton/core';
4
+ import { Address, Cell, loadStateInit } from '@ton/core';
5
5
  import { logger } from '@dynamic-labs/wallet-connector-core';
6
6
  import { DynamicError } from '@dynamic-labs/utils';
7
7
  import { TonWalletConnector } from '../../TonWalletConnector.js';
@@ -444,42 +444,6 @@ class TonConnectConnector extends TonWalletConnector {
444
444
  return address;
445
445
  }
446
446
  }
447
- /**
448
- * Encode a comment as TON message payload.
449
- * NOTE: TON cells support a maximum of 4 references per cell.
450
- * Comments longer than 123 + (4 * 127) = 631 bytes will exceed
451
- * this limit. Consider implementing proper snake-cell encoding
452
- * for arbitrarily long comments if needed.
453
- */
454
- encodeComment(comment) {
455
- const encoder = new TextEncoder();
456
- const commentBytes = encoder.encode(comment);
457
- const maxBytesPerCell = 123;
458
- if (commentBytes.length <= maxBytesPerCell) {
459
- const cell = beginCell()
460
- .storeUint(0, 32)
461
- .storeBuffer(Buffer.from(commentBytes))
462
- .endCell();
463
- return cell.toBoc().toString('base64');
464
- }
465
- const firstChunk = commentBytes.slice(0, maxBytesPerCell);
466
- const remainingBytes = commentBytes.slice(maxBytesPerCell);
467
- let remainingData = remainingBytes;
468
- const referenceCells = [];
469
- while (remainingData.length > 0) {
470
- const chunk = remainingData.slice(0, 127);
471
- remainingData = remainingData.slice(127);
472
- referenceCells.push(beginCell().storeBuffer(Buffer.from(chunk)).endCell());
473
- }
474
- let mainCellBuilder = beginCell()
475
- .storeUint(0, 32)
476
- .storeBuffer(Buffer.from(firstChunk));
477
- for (const refCell of referenceCells) {
478
- mainCellBuilder = mainCellBuilder.storeRef(refCell);
479
- }
480
- const mainCell = mainCellBuilder.endCell();
481
- return mainCell.toBoc().toString('base64');
482
- }
483
447
  /**
484
448
  * Elevate the TonConnect UI above the Dynamic auth modal and prevent
485
449
  * the Dynamic backdrop from intercepting pointer events.