@ton/sandbox 0.26.0 → 0.27.1

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,6 +5,22 @@ 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
+ ## [0.27.1] - 2025-02-25
9
+
10
+ ### Fixed
11
+
12
+ - Fixed a bug pertaining to blockchain snapshot loading
13
+
14
+ ## [0.27.0] - 2025-02-20
15
+
16
+ ### Added
17
+
18
+ - Added better extra currency support
19
+
20
+ ### Changed
21
+
22
+ - Updated dependencies
23
+
8
24
  ## [0.26.0] - 2025-02-12
9
25
 
10
26
  ### Changed
@@ -70,6 +70,7 @@ class Blockchain {
70
70
  */
71
71
  async loadFrom(snapshot) {
72
72
  this.storage.clearKnownContracts();
73
+ this.contractFetches.clear();
73
74
  for (const contract of snapshot.contracts) {
74
75
  const storageContract = await this.getContract(contract.address);
75
76
  storageContract.loadFrom(contract);
@@ -1,5 +1,5 @@
1
1
  /// <reference types="node" />
2
- import { Address, Cell, Contract, ContractGetMethodResult, ContractProvider, ContractState, Message, OpenedContract, Sender, SendMode, StateInit, Transaction, TupleItem } from "@ton/core";
2
+ import { Address, Cell, Contract, ContractGetMethodResult, ContractProvider, ContractState, ExtraCurrency, Message, OpenedContract, Sender, SendMode, StateInit, Transaction, TupleItem } from "@ton/core";
3
3
  import { TickOrTock } from "../executor/Executor";
4
4
  import { GetMethodResult, SmartContract } from "./SmartContract";
5
5
  export interface SandboxContractProvider extends ContractProvider {
@@ -47,6 +47,7 @@ export declare class BlockchainContractProvider implements SandboxContractProvid
47
47
  */
48
48
  internal(via: Sender, args: {
49
49
  value: string | bigint;
50
+ extracurrency?: ExtraCurrency;
50
51
  bounce?: boolean | null;
51
52
  sendMode?: SendMode;
52
53
  body?: string | Cell | null;
@@ -51,6 +51,7 @@ class BlockchainContractProvider {
51
51
  const contract = await this.blockchain.getContract(this.address);
52
52
  return {
53
53
  balance: contract.balance,
54
+ extracurrency: contract.ec,
54
55
  last: {
55
56
  lt: contract.lastTransactionLt,
56
57
  hash: bigintToBuffer(contract.lastTransactionHash),
@@ -111,6 +112,7 @@ class BlockchainContractProvider {
111
112
  to: this.address,
112
113
  value,
113
114
  bounce,
115
+ extracurrency: args.extracurrency,
114
116
  sendMode: args.sendMode,
115
117
  init,
116
118
  body,
@@ -20,7 +20,7 @@ class BlockchainSender {
20
20
  bounced: false,
21
21
  src: this.address,
22
22
  dest: args.to,
23
- value: { coins: args.value },
23
+ value: { coins: args.value, other: args.extracurrency ? (0, core_1.packExtraCurrencyDict)(args.extracurrency) : undefined },
24
24
  forwardFee: 0n,
25
25
  createdAt: 0,
26
26
  createdLt: 0n,
@@ -17,6 +17,7 @@ function senderArgsToMessageRelaxed(args) {
17
17
  return (0, core_1.internal)({
18
18
  to: args.to,
19
19
  value: args.value,
20
+ extracurrency: args.extracurrency,
20
21
  init: args.init,
21
22
  body: args.body,
22
23
  bounce: args.bounce
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ton/sandbox",
3
- "version": "0.26.0",
3
+ "version": "0.27.1",
4
4
  "description": "TON transaction emulator",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",
@@ -13,10 +13,10 @@
13
13
  "url": "git+https://github.com/ton-org/sandbox"
14
14
  },
15
15
  "devDependencies": {
16
- "@ton/core": "^0.59.1",
16
+ "@ton/core": "^0.60.1",
17
17
  "@ton/crypto": "3.3.0",
18
18
  "@ton/test-utils": "^0.3.1",
19
- "@ton/ton": "^15.0.0",
19
+ "@ton/ton": "^15.2.1",
20
20
  "@types/jest": "^29.5.0",
21
21
  "@types/node": "^18.15.11",
22
22
  "jest": "^29.5.0",
@@ -25,7 +25,6 @@
25
25
  "typescript": "^4.9.5"
26
26
  },
27
27
  "peerDependencies": {
28
- "@ton/core": ">=0.58.1",
29
28
  "@ton/crypto": ">=3.3.0"
30
29
  },
31
30
  "scripts": {