@ton/sandbox 0.22.0-ecbeta.0 → 0.22.0-ecbeta.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.
@@ -71,6 +71,9 @@ export type SmartContractSnapshot = {
71
71
  lastTxTime: number;
72
72
  verbosity?: Partial<LogsVerbosity>;
73
73
  };
74
+ export type ExtraCurrency = {
75
+ [key: number]: bigint;
76
+ };
74
77
  export declare class SmartContract {
75
78
  #private;
76
79
  readonly address: Address;
@@ -78,8 +81,8 @@ export declare class SmartContract {
78
81
  constructor(shardAccount: ShardAccount, blockchain: Blockchain);
79
82
  snapshot(): SmartContractSnapshot;
80
83
  loadFrom(snapshot: SmartContractSnapshot): void;
81
- get ec(): [number, bigint][];
82
- set ec(nv: [number, bigint][]);
84
+ get ec(): ExtraCurrency;
85
+ set ec(nv: ExtraCurrency);
83
86
  get balance(): bigint;
84
87
  set balance(v: bigint);
85
88
  get lastTransactionHash(): bigint;
@@ -123,11 +123,10 @@ class EmulationError extends Error {
123
123
  }
124
124
  exports.EmulationError = EmulationError;
125
125
  function extractEc(cc) {
126
- const r = [];
126
+ const r = {};
127
127
  for (const [k, v] of cc) {
128
- r.push([k, v]);
128
+ r[k] = v;
129
129
  }
130
- r.sort((a, b) => a[0] - b[0]);
131
130
  return r;
132
131
  }
133
132
  class SmartContract {
@@ -159,12 +158,12 @@ class SmartContract {
159
158
  __classPrivateFieldSet(this, _SmartContract_verbosity, snapshot.verbosity === undefined ? undefined : { ...snapshot.verbosity }, "f");
160
159
  }
161
160
  get ec() {
162
- return extractEc(this.account.account?.storage.balance.other ?? core_1.Dictionary.empty());
161
+ return extractEc(this.account.account?.storage.balance.other ?? core_1.Dictionary.empty(core_1.Dictionary.Keys.Uint(32), core_1.Dictionary.Values.BigVarUint(5)));
163
162
  }
164
163
  set ec(nv) {
165
- const cc = core_1.Dictionary.empty();
166
- for (const [k, v] of nv) {
167
- cc.set(k, v);
164
+ const cc = core_1.Dictionary.empty(core_1.Dictionary.Keys.Uint(32), core_1.Dictionary.Values.BigVarUint(5));
165
+ for (const [k, v] of Object.entries(nv)) {
166
+ cc.set(Number(k), v);
168
167
  }
169
168
  const acc = this.account;
170
169
  if (acc.account === undefined) {
@@ -9,7 +9,7 @@ function internal(params) {
9
9
  let ecd = undefined;
10
10
  if (params.ec !== undefined) {
11
11
  if (Array.isArray(params.ec)) {
12
- ecd = core_1.Dictionary.empty();
12
+ ecd = core_1.Dictionary.empty(core_1.Dictionary.Keys.Uint(32), core_1.Dictionary.Values.BigVarUint(5));
13
13
  for (const [k, v] of params.ec) {
14
14
  ecd.set(k, v);
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ton/sandbox",
3
- "version": "0.22.0-ecbeta.0",
3
+ "version": "0.22.0-ecbeta.1",
4
4
  "description": "TON transaction emulator",
5
5
  "main": "dist/index.js",
6
6
  "license": "MIT",