@ton/sandbox 0.34.0-dev.20250626140722.3b8d306 → 0.34.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
|
@@ -5,11 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## [0.34.0] - 2025-06-26
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
12
|
- Added debugger
|
|
13
|
+
- Added `outActions` and `mode` fields to transactions
|
|
13
14
|
|
|
14
15
|
## [0.33.0] - 2025-06-16
|
|
15
16
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Address, Cell, Message,
|
|
2
|
+
import { Address, Cell, Message, ContractProvider, Contract, Sender, ShardAccount, TupleItem, ExternalAddress, StateInit, OpenedContract } from '@ton/core';
|
|
3
3
|
import { IExecutor, Executor, TickOrTock, PrevBlocksInfo } from '../executor/Executor';
|
|
4
4
|
import { BlockchainStorage } from './BlockchainStorage';
|
|
5
5
|
import { Event } from '../event/Event';
|
|
6
6
|
import { SandboxContractProvider } from './BlockchainContractProvider';
|
|
7
7
|
import { TreasuryContract } from '../treasury/Treasury';
|
|
8
|
-
import { GetMethodParams, LogsVerbosity, MessageParams, SmartContract, SmartContractSnapshot, Verbosity } from './SmartContract';
|
|
8
|
+
import { GetMethodParams, LogsVerbosity, MessageParams, SmartContract, SmartContractSnapshot, SmartContractTransaction, Verbosity } from './SmartContract';
|
|
9
9
|
import { AsyncLock } from '../utils/AsyncLock';
|
|
10
10
|
import { ContractsMeta } from '../meta/ContractsMeta';
|
|
11
11
|
export type ExternalOutInfo = {
|
|
@@ -20,16 +20,12 @@ export type ExternalOut = {
|
|
|
20
20
|
init?: StateInit;
|
|
21
21
|
body: Cell;
|
|
22
22
|
};
|
|
23
|
-
export type BlockchainTransaction =
|
|
24
|
-
blockchainLogs: string;
|
|
25
|
-
vmLogs: string;
|
|
26
|
-
debugLogs: string;
|
|
23
|
+
export type BlockchainTransaction = SmartContractTransaction & {
|
|
27
24
|
events: Event[];
|
|
28
25
|
parent?: BlockchainTransaction;
|
|
29
26
|
children: BlockchainTransaction[];
|
|
30
27
|
externals: ExternalOut[];
|
|
31
|
-
|
|
32
|
-
newStorage?: Cell;
|
|
28
|
+
mode?: number;
|
|
33
29
|
};
|
|
34
30
|
/**
|
|
35
31
|
* @type SendMessageResult Represents the result of sending a message.
|
|
@@ -61,6 +57,7 @@ export type SandboxContract<F> = {
|
|
|
61
57
|
export declare function toSandboxContract<T>(contract: OpenedContract<T>): SandboxContract<T>;
|
|
62
58
|
export type PendingMessage = (({
|
|
63
59
|
type: 'message';
|
|
60
|
+
mode?: number;
|
|
64
61
|
} & Message) | {
|
|
65
62
|
type: 'ticktock';
|
|
66
63
|
which: TickOrTock;
|
|
@@ -337,11 +337,14 @@ class Blockchain {
|
|
|
337
337
|
parent: message.parentTransaction,
|
|
338
338
|
children: [],
|
|
339
339
|
externals: [],
|
|
340
|
+
mode: message.type === 'message' ? message.mode : undefined,
|
|
340
341
|
};
|
|
341
342
|
transaction.parent?.children.push(transaction);
|
|
342
343
|
result = transaction;
|
|
343
344
|
done = true;
|
|
344
|
-
|
|
345
|
+
const sendMsgActions = (transaction.outActions?.filter((action) => action.type === 'sendMsg') ??
|
|
346
|
+
[]);
|
|
347
|
+
for (const [index, message] of transaction.outMessages) {
|
|
345
348
|
if (message.info.type === 'external-out') {
|
|
346
349
|
transaction.externals.push({
|
|
347
350
|
info: {
|
|
@@ -359,6 +362,7 @@ class Blockchain {
|
|
|
359
362
|
this.messageQueue.push({
|
|
360
363
|
type: 'message',
|
|
361
364
|
parentTransaction: transaction,
|
|
365
|
+
mode: sendMsgActions[index]?.mode,
|
|
362
366
|
...message,
|
|
363
367
|
});
|
|
364
368
|
if (message.info.type === 'internal') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { Address, Cell, Message, ShardAccount, Transaction, TupleItem, TupleReader } from '@ton/core';
|
|
2
|
+
import { Address, Cell, Message, OutAction, ShardAccount, Transaction, TupleItem, TupleReader } from '@ton/core';
|
|
3
3
|
import { Blockchain } from './Blockchain';
|
|
4
4
|
import { ExtraCurrency } from '../utils/ec';
|
|
5
5
|
import { EmulationResult, RunCommonArgs, TickOrTock } from '../executor/Executor';
|
|
@@ -25,6 +25,7 @@ export type SmartContractTransaction = Transaction & {
|
|
|
25
25
|
debugLogs: string;
|
|
26
26
|
oldStorage?: Cell;
|
|
27
27
|
newStorage?: Cell;
|
|
28
|
+
outActions?: OutAction[];
|
|
28
29
|
};
|
|
29
30
|
export type MessageParams = Partial<{
|
|
30
31
|
now: number;
|
|
@@ -291,6 +291,10 @@ class SmartContract {
|
|
|
291
291
|
if (this.blockchain.recordStorage && this.account.account?.storage.state.type === 'active') {
|
|
292
292
|
newStorage = this.account.account?.storage.state.state.data ?? undefined;
|
|
293
293
|
}
|
|
294
|
+
let outActions = undefined;
|
|
295
|
+
if (res.result.actions) {
|
|
296
|
+
outActions = (0, core_1.loadOutList)(core_1.Cell.fromBase64(res.result.actions).beginParse());
|
|
297
|
+
}
|
|
294
298
|
return {
|
|
295
299
|
...tx,
|
|
296
300
|
blockchainLogs: res.logs,
|
|
@@ -298,6 +302,7 @@ class SmartContract {
|
|
|
298
302
|
debugLogs: res.debugLogs,
|
|
299
303
|
oldStorage,
|
|
300
304
|
newStorage,
|
|
305
|
+
outActions,
|
|
301
306
|
};
|
|
302
307
|
}
|
|
303
308
|
async get(method, stack = [], params) {
|