@ton/sandbox 0.28.0 → 0.29.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,6 +5,13 @@ 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.29.0] - 2025-04-30
9
+
10
+ ### Changed
11
+
12
+ - Updated API docs
13
+ - Updated emulator WASM binary (TON v2025.04)
14
+
8
15
  ## [0.28.0] - 2025-04-01
9
16
 
10
17
  ### Added
@@ -104,21 +104,27 @@ export declare class Blockchain {
104
104
  readonly executor: IExecutor;
105
105
  /**
106
106
  * Saves snapshot of current blockchain.
107
- * ```ts
107
+ * @example
108
108
  * const snapshot = blockchain.snapshot();
109
109
  * // some operations
110
110
  * await blockchain.loadFrom(snapshot); // restores blockchain state
111
- * ```
112
111
  */
113
112
  snapshot(): BlockchainSnapshot;
114
113
  /**
115
114
  * Restores blockchain state from snapshot.
116
- * Usage provided in {@link snapshot}.
115
+ * Usage provided in {@link Blockchain#snapshot}.
117
116
  *
118
117
  * @param snapshot Snapshot of blockchain
119
118
  */
120
119
  loadFrom(snapshot: BlockchainSnapshot): Promise<void>;
121
120
  get recordStorage(): boolean;
121
+ /**
122
+ * If set to `true`, [BlockchainTransaction]{@link BlockchainTransaction} will have `oldStorage` and `newStorage` fields.
123
+ *
124
+ * Note that enabling this flag will disable a certain optimization, which will slow down contract emulation
125
+ *
126
+ * @param v
127
+ */
122
128
  set recordStorage(v: boolean);
123
129
  /**
124
130
  * @returns Current time in blockchain
@@ -148,23 +154,28 @@ export declare class Blockchain {
148
154
  get configBase64(): string;
149
155
  /**
150
156
  * Emulates the result of sending a message to this Blockchain. Emulates the whole chain of transactions before returning the result. Each transaction increases lt by 1000000.
151
- * ```ts
157
+ *
158
+ * @param message Message to send
159
+ * @param params Optional params
160
+ * @returns Result of queue processing
161
+ *
162
+ * @example
152
163
  * const result = await blockchain.sendMessage(internal({
153
164
  * from: sender.address,
154
165
  * to: address,
155
166
  * value: toNano('1'),
156
167
  * body: beginCell().storeUint(0, 32).endCell(),
157
168
  * }));
158
- * ```
159
- *
160
- * @param message Message to sent
161
- * @param params Optional params
162
- * @returns Result of queue processing
163
169
  */
164
170
  sendMessage(message: Message | Cell, params?: MessageParams): Promise<SendMessageResult>;
165
171
  /**
166
172
  * Starts emulating the result of sending a message to this Blockchain (refer to {@link sendMessage}). Each iterator call emulates one transaction, so the whole chain is not emulated immediately, unlike in {@link sendMessage}.
167
- * ```ts
173
+ *
174
+ * @param message Message to send
175
+ * @param params Optional params
176
+ * @returns Async iterable of {@link BlockchainTransaction}
177
+ *
178
+ * @example
168
179
  * const message = internal({
169
180
  * from: sender.address,
170
181
  * to: address,
@@ -174,39 +185,34 @@ export declare class Blockchain {
174
185
  * for await (const tx of await blockchain.sendMessageIter(message)) {
175
186
  * // process transaction
176
187
  * }
177
- * ```
178
- *
179
- * @param message Message to sent
180
- * @param params Optional params
181
- * @returns Async iterable of {@link BlockchainTransaction}
182
188
  */
183
189
  sendMessageIter(message: Message | Cell, params?: MessageParams): Promise<AsyncIterator<BlockchainTransaction> & AsyncIterable<BlockchainTransaction>>;
184
190
  /**
185
191
  * Runs tick or tock transaction.
186
- * ```ts
187
- * let res = await blockchain.runTickTock(address, 'tock');
188
- * ```
189
192
  *
190
193
  * @param on Address or addresses to run tick-tock
191
194
  * @param which Type of transaction (tick or tock)
192
195
  * @param [params] Params to run tick tock transaction
193
196
  * @returns Result of tick-tock transaction
197
+ *
198
+ * @example
199
+ * let res = await blockchain.runTickTock(address, 'tock');
194
200
  */
195
201
  runTickTock(on: Address | Address[], which: TickOrTock, params?: MessageParams): Promise<SendMessageResult>;
196
202
  /**
197
203
  * Runs get method on contract.
198
- * ```ts
199
- * const { stackReader } = await blockchain.runGetMethod(address, 'get_now', [], {
200
- * now: 2,
201
- * });
202
- * const now = res.stackReader.readNumber();
203
- * ```
204
204
  *
205
205
  * @param address Address or addresses to run get method
206
206
  * @param method MethodId or method name to run
207
207
  * @param stack Method params
208
208
  * @param [params] Params to run get method
209
209
  * @returns Result of get method
210
+ *
211
+ * @example
212
+ * const { stackReader } = await blockchain.runGetMethod(address, 'get_now', [], {
213
+ * now: 2,
214
+ * });
215
+ * const now = res.stackReader.readNumber();
210
216
  */
211
217
  runGetMethod(address: Address, method: number | string, stack?: TupleItem[], params?: GetMethodParams): Promise<import("./SmartContract").GetMethodResult>;
212
218
  protected pushMessage(message: Message | Cell): Promise<void>;
@@ -218,57 +224,59 @@ export declare class Blockchain {
218
224
  protected processQueue(params?: MessageParams): Promise<BlockchainTransaction[]>;
219
225
  /**
220
226
  * Creates new {@link ContractProvider} for contract address.
221
- * ```ts
222
- * const contractProvider = blockchain.provider(address, init);
223
- * const txs = await contractProvider.getTransactions(...);
224
- * ```
225
227
  *
226
228
  * @param address Address to create contract provider for
227
229
  * @param init Initial state of contract
230
+ *
231
+ * @example
232
+ * const contractProvider = blockchain.provider(address, init);
228
233
  */
229
234
  provider(address: Address, init?: StateInit | null): ContractProvider;
230
235
  /**
231
236
  * Creates {@link Sender} for address.
232
- * ```ts
237
+ *
238
+ * Note, that this sender pushes internal messages to Blockchain directly.
239
+ * No value is deducted from sender address, all the values are set to defaults. Use for test purposes only.
240
+ *
241
+ * @example
233
242
  * const sender = this.sender(address);
234
243
  * await contract.send(sender, ...);
235
- * ```
236
244
  *
237
245
  * @param address Address to create sender for
238
246
  */
239
247
  sender(address: Address): Sender;
240
248
  protected treasuryParamsToMapKey(workchain: number, seed: string): string;
241
249
  /**
242
- * Creates treasury wallet contract. This wallet is used as alternative to wallet-v4 smart contract.
243
- * ```ts
250
+ * Creates treasury wallet contract. This wallet is used as alternative to wallet smart contract.
251
+ *
252
+ * @param {string} seed Initial seed for treasury. If the same seed is used to create a treasury, then these treasuries will be identical
253
+ * @param {TreasuryParams} params Params for treasury creation. See {@link TreasuryParams} for more information.
254
+ *
255
+ * @example
244
256
  * const wallet = await blockchain.treasury('wallet')
245
257
  * await wallet.send({
246
258
  * to: someAddress,
247
259
  * value: toNano('0.5'),
248
260
  * });
249
- * ```
250
- *
251
- * @param {string} seed Initial seed for treasury. If the same seed is used to create a treasury, then these treasuries will be identical
252
- * @param [params] Params for treasury creation. See {@link TreasuryParams} for more information.
253
261
  */
254
262
  treasury(seed: string, params?: TreasuryParams): Promise<SandboxContract<TreasuryContract>>;
255
263
  /**
256
264
  * Bulk variant of {@link treasury}.
257
- * ```ts
258
- * const [wallet1, wallet2, wallet3] = await blockchain.createWallets(3);
259
- * ```
260
265
  * @param n Number of wallets to create
261
266
  * @param params Params for treasury creation. See {@link TreasuryParams} for more information.
262
267
  * @returns Array of opened treasury contracts
268
+ *
269
+ * @example
270
+ * const [wallet1, wallet2, wallet3] = await blockchain.createWallets(3);
263
271
  */
264
272
  createWallets(n: number, params?: TreasuryParams): Promise<SandboxContract<TreasuryContract>[]>;
265
273
  /**
266
274
  * Opens contract. Returns proxy that substitutes the blockchain Provider in methods starting with get and set.
267
- * ```ts
268
- * const contract = blockchain.openContract(new Contract(address));
269
- * ```
270
275
  *
271
276
  * @param contract Contract to open.
277
+ *
278
+ * @example
279
+ * const contract = blockchain.openContract(new Contract(address));
272
280
  */
273
281
  openContract<T extends Contract>(contract: T): SandboxContract<T>;
274
282
  protected startFetchingContract(address: Address): Promise<SmartContract>;
@@ -286,7 +294,15 @@ export declare class Blockchain {
286
294
  * @param {LogsVerbosity} value
287
295
  */
288
296
  set verbosity(value: LogsVerbosity);
297
+ /**
298
+ * Updates logs verbosity level for address.
299
+ */
289
300
  setVerbosityForAddress(address: Address, verbosity: Partial<LogsVerbosity> | Verbosity | undefined): Promise<void>;
301
+ /**
302
+ * Updates blockchain config
303
+ *
304
+ * @param {BlockchainConfig} config - Custom config in Cell format, or predefined `default` | `slim`
305
+ */
290
306
  setConfig(config: BlockchainConfig): void;
291
307
  setShardAccount(address: Address, account: ShardAccount): Promise<void>;
292
308
  /**
@@ -295,26 +311,29 @@ export declare class Blockchain {
295
311
  get libs(): Cell | undefined;
296
312
  /**
297
313
  * Update global blockchain libs.
298
- * ```ts
314
+ *
315
+ * @param value Cell in libs format: Dictionary<CellHash, Cell>
316
+ *
317
+ * @example
299
318
  * const code = await compile('Contract');
300
319
  *
301
320
  * const libsDict = Dictionary.empty(Dictionary.Keys.Buffer(32), Dictionary.Values.Cell());
302
321
  * libsDict.set(code.hash(), code);
303
322
  *
304
323
  * blockchain.libs = beginCell().storeDictDirect(libsDict).endCell();
305
- * ```
306
- *
307
- * @param value Cell in libs format: Dictionary<CellHash, Cell>
308
324
  */
309
325
  set libs(value: Cell | undefined);
310
326
  /**
311
327
  * Creates instance of sandbox blockchain.
312
- * ```ts
328
+ *
329
+ * @param [opts.executor] Custom contract executor. If omitted {@link Executor} is used.
330
+ * @param [opts.config] Config used in blockchain. If omitted {@link defaultConfig} is used.
331
+ * @param [opts.storage] Contracts storage used for blockchain. If omitted {@link LocalBlockchainStorage} is used.
332
+ *
333
+ * @example
313
334
  * const blockchain = await Blockchain.create({ config: 'slim' });
314
- * ```
315
335
  *
316
- * Remote storage example:
317
- * ```ts
336
+ * @example Remote storage
318
337
  * let client = new TonClient4({
319
338
  * endpoint: 'https://mainnet-v4.tonhubapi.com'
320
339
  * })
@@ -322,11 +341,6 @@ export declare class Blockchain {
322
341
  * let blockchain = await Blockchain.create({
323
342
  * storage: new RemoteBlockchainStorage(wrapTonClient4ForRemote(client), 34892000)
324
343
  * });
325
- * ```
326
- *
327
- * @param [opts.executor] Custom contract executor. If omitted {@link Executor} used.
328
- * @param [opts.config] Config used in blockchain. If omitted {@link defaultConfig} used.
329
- * @param [opts.storage] Contracts storage used for blockchain. If omitted {@link LocalBlockchainStorage} used.
330
344
  */
331
345
  static create(opts?: {
332
346
  executor?: IExecutor;
@@ -45,11 +45,10 @@ function blockchainConfigToBase64(config) {
45
45
  class Blockchain {
46
46
  /**
47
47
  * Saves snapshot of current blockchain.
48
- * ```ts
48
+ * @example
49
49
  * const snapshot = blockchain.snapshot();
50
50
  * // some operations
51
51
  * await blockchain.loadFrom(snapshot); // restores blockchain state
52
- * ```
53
52
  */
54
53
  snapshot() {
55
54
  return {
@@ -64,7 +63,7 @@ class Blockchain {
64
63
  }
65
64
  /**
66
65
  * Restores blockchain state from snapshot.
67
- * Usage provided in {@link snapshot}.
66
+ * Usage provided in {@link Blockchain#snapshot}.
68
67
  *
69
68
  * @param snapshot Snapshot of blockchain
70
69
  */
@@ -85,6 +84,13 @@ class Blockchain {
85
84
  get recordStorage() {
86
85
  return this.shouldRecordStorage;
87
86
  }
87
+ /**
88
+ * If set to `true`, [BlockchainTransaction]{@link BlockchainTransaction} will have `oldStorage` and `newStorage` fields.
89
+ *
90
+ * Note that enabling this flag will disable a certain optimization, which will slow down contract emulation
91
+ *
92
+ * @param v
93
+ */
88
94
  set recordStorage(v) {
89
95
  this.shouldRecordStorage = v;
90
96
  }
@@ -138,18 +144,18 @@ class Blockchain {
138
144
  }
139
145
  /**
140
146
  * Emulates the result of sending a message to this Blockchain. Emulates the whole chain of transactions before returning the result. Each transaction increases lt by 1000000.
141
- * ```ts
147
+ *
148
+ * @param message Message to send
149
+ * @param params Optional params
150
+ * @returns Result of queue processing
151
+ *
152
+ * @example
142
153
  * const result = await blockchain.sendMessage(internal({
143
154
  * from: sender.address,
144
155
  * to: address,
145
156
  * value: toNano('1'),
146
157
  * body: beginCell().storeUint(0, 32).endCell(),
147
158
  * }));
148
- * ```
149
- *
150
- * @param message Message to sent
151
- * @param params Optional params
152
- * @returns Result of queue processing
153
159
  */
154
160
  async sendMessage(message, params) {
155
161
  await this.pushMessage(message);
@@ -157,7 +163,12 @@ class Blockchain {
157
163
  }
158
164
  /**
159
165
  * Starts emulating the result of sending a message to this Blockchain (refer to {@link sendMessage}). Each iterator call emulates one transaction, so the whole chain is not emulated immediately, unlike in {@link sendMessage}.
160
- * ```ts
166
+ *
167
+ * @param message Message to send
168
+ * @param params Optional params
169
+ * @returns Async iterable of {@link BlockchainTransaction}
170
+ *
171
+ * @example
161
172
  * const message = internal({
162
173
  * from: sender.address,
163
174
  * to: address,
@@ -167,11 +178,6 @@ class Blockchain {
167
178
  * for await (const tx of await blockchain.sendMessageIter(message)) {
168
179
  * // process transaction
169
180
  * }
170
- * ```
171
- *
172
- * @param message Message to sent
173
- * @param params Optional params
174
- * @returns Async iterable of {@link BlockchainTransaction}
175
181
  */
176
182
  async sendMessageIter(message, params) {
177
183
  params = {
@@ -184,14 +190,14 @@ class Blockchain {
184
190
  }
185
191
  /**
186
192
  * Runs tick or tock transaction.
187
- * ```ts
188
- * let res = await blockchain.runTickTock(address, 'tock');
189
- * ```
190
193
  *
191
194
  * @param on Address or addresses to run tick-tock
192
195
  * @param which Type of transaction (tick or tock)
193
196
  * @param [params] Params to run tick tock transaction
194
197
  * @returns Result of tick-tock transaction
198
+ *
199
+ * @example
200
+ * let res = await blockchain.runTickTock(address, 'tock');
195
201
  */
196
202
  async runTickTock(on, which, params) {
197
203
  for (const addr of (Array.isArray(on) ? on : [on])) {
@@ -201,18 +207,18 @@ class Blockchain {
201
207
  }
202
208
  /**
203
209
  * Runs get method on contract.
204
- * ```ts
205
- * const { stackReader } = await blockchain.runGetMethod(address, 'get_now', [], {
206
- * now: 2,
207
- * });
208
- * const now = res.stackReader.readNumber();
209
- * ```
210
210
  *
211
211
  * @param address Address or addresses to run get method
212
212
  * @param method MethodId or method name to run
213
213
  * @param stack Method params
214
214
  * @param [params] Params to run get method
215
215
  * @returns Result of get method
216
+ *
217
+ * @example
218
+ * const { stackReader } = await blockchain.runGetMethod(address, 'get_now', [], {
219
+ * now: 2,
220
+ * });
221
+ * const now = res.stackReader.readNumber();
216
222
  */
217
223
  async runGetMethod(address, method, stack = [], params) {
218
224
  return await (await this.getContract(address)).get(method, stack, {
@@ -329,13 +335,12 @@ class Blockchain {
329
335
  }
330
336
  /**
331
337
  * Creates new {@link ContractProvider} for contract address.
332
- * ```ts
333
- * const contractProvider = blockchain.provider(address, init);
334
- * const txs = await contractProvider.getTransactions(...);
335
- * ```
336
338
  *
337
339
  * @param address Address to create contract provider for
338
340
  * @param init Initial state of contract
341
+ *
342
+ * @example
343
+ * const contractProvider = blockchain.provider(address, init);
339
344
  */
340
345
  provider(address, init) {
341
346
  return new BlockchainContractProvider_1.BlockchainContractProvider({
@@ -348,10 +353,13 @@ class Blockchain {
348
353
  }
349
354
  /**
350
355
  * Creates {@link Sender} for address.
351
- * ```ts
356
+ *
357
+ * Note, that this sender pushes internal messages to Blockchain directly.
358
+ * No value is deducted from sender address, all the values are set to defaults. Use for test purposes only.
359
+ *
360
+ * @example
352
361
  * const sender = this.sender(address);
353
362
  * await contract.send(sender, ...);
354
- * ```
355
363
  *
356
364
  * @param address Address to create sender for
357
365
  */
@@ -364,17 +372,17 @@ class Blockchain {
364
372
  return `${workchain}:${seed}`;
365
373
  }
366
374
  /**
367
- * Creates treasury wallet contract. This wallet is used as alternative to wallet-v4 smart contract.
368
- * ```ts
375
+ * Creates treasury wallet contract. This wallet is used as alternative to wallet smart contract.
376
+ *
377
+ * @param {string} seed Initial seed for treasury. If the same seed is used to create a treasury, then these treasuries will be identical
378
+ * @param {TreasuryParams} params Params for treasury creation. See {@link TreasuryParams} for more information.
379
+ *
380
+ * @example
369
381
  * const wallet = await blockchain.treasury('wallet')
370
382
  * await wallet.send({
371
383
  * to: someAddress,
372
384
  * value: toNano('0.5'),
373
385
  * });
374
- * ```
375
- *
376
- * @param {string} seed Initial seed for treasury. If the same seed is used to create a treasury, then these treasuries will be identical
377
- * @param [params] Params for treasury creation. See {@link TreasuryParams} for more information.
378
386
  */
379
387
  async treasury(seed, params) {
380
388
  const subwalletId = (0, testTreasurySubwalletId_1.testSubwalletId)(seed);
@@ -396,12 +404,12 @@ class Blockchain {
396
404
  }
397
405
  /**
398
406
  * Bulk variant of {@link treasury}.
399
- * ```ts
400
- * const [wallet1, wallet2, wallet3] = await blockchain.createWallets(3);
401
- * ```
402
407
  * @param n Number of wallets to create
403
408
  * @param params Params for treasury creation. See {@link TreasuryParams} for more information.
404
409
  * @returns Array of opened treasury contracts
410
+ *
411
+ * @example
412
+ * const [wallet1, wallet2, wallet3] = await blockchain.createWallets(3);
405
413
  */
406
414
  async createWallets(n, params) {
407
415
  const wallets = [];
@@ -413,11 +421,11 @@ class Blockchain {
413
421
  }
414
422
  /**
415
423
  * Opens contract. Returns proxy that substitutes the blockchain Provider in methods starting with get and set.
416
- * ```ts
417
- * const contract = blockchain.openContract(new Contract(address));
418
- * ```
419
424
  *
420
425
  * @param contract Contract to open.
426
+ *
427
+ * @example
428
+ * const contract = blockchain.openContract(new Contract(address));
421
429
  */
422
430
  openContract(contract) {
423
431
  let address;
@@ -509,10 +517,18 @@ class Blockchain {
509
517
  set verbosity(value) {
510
518
  this.logsVerbosity = value;
511
519
  }
520
+ /**
521
+ * Updates logs verbosity level for address.
522
+ */
512
523
  async setVerbosityForAddress(address, verbosity) {
513
524
  const contract = await this.getContract(address);
514
525
  contract.setVerbosity(verbosity);
515
526
  }
527
+ /**
528
+ * Updates blockchain config
529
+ *
530
+ * @param {BlockchainConfig} config - Custom config in Cell format, or predefined `default` | `slim`
531
+ */
516
532
  setConfig(config) {
517
533
  this.networkConfig = blockchainConfigToBase64(config);
518
534
  }
@@ -528,28 +544,31 @@ class Blockchain {
528
544
  }
529
545
  /**
530
546
  * Update global blockchain libs.
531
- * ```ts
547
+ *
548
+ * @param value Cell in libs format: Dictionary<CellHash, Cell>
549
+ *
550
+ * @example
532
551
  * const code = await compile('Contract');
533
552
  *
534
553
  * const libsDict = Dictionary.empty(Dictionary.Keys.Buffer(32), Dictionary.Values.Cell());
535
554
  * libsDict.set(code.hash(), code);
536
555
  *
537
556
  * blockchain.libs = beginCell().storeDictDirect(libsDict).endCell();
538
- * ```
539
- *
540
- * @param value Cell in libs format: Dictionary<CellHash, Cell>
541
557
  */
542
558
  set libs(value) {
543
559
  this.globalLibs = value;
544
560
  }
545
561
  /**
546
562
  * Creates instance of sandbox blockchain.
547
- * ```ts
563
+ *
564
+ * @param [opts.executor] Custom contract executor. If omitted {@link Executor} is used.
565
+ * @param [opts.config] Config used in blockchain. If omitted {@link defaultConfig} is used.
566
+ * @param [opts.storage] Contracts storage used for blockchain. If omitted {@link LocalBlockchainStorage} is used.
567
+ *
568
+ * @example
548
569
  * const blockchain = await Blockchain.create({ config: 'slim' });
549
- * ```
550
570
  *
551
- * Remote storage example:
552
- * ```ts
571
+ * @example Remote storage
553
572
  * let client = new TonClient4({
554
573
  * endpoint: 'https://mainnet-v4.tonhubapi.com'
555
574
  * })
@@ -557,11 +576,6 @@ class Blockchain {
557
576
  * let blockchain = await Blockchain.create({
558
577
  * storage: new RemoteBlockchainStorage(wrapTonClient4ForRemote(client), 34892000)
559
578
  * });
560
- * ```
561
- *
562
- * @param [opts.executor] Custom contract executor. If omitted {@link Executor} used.
563
- * @param [opts.config] Config used in blockchain. If omitted {@link defaultConfig} used.
564
- * @param [opts.storage] Contracts storage used for blockchain. If omitted {@link LocalBlockchainStorage} used.
565
579
  */
566
580
  static async create(opts) {
567
581
  return new Blockchain({
@@ -6,10 +6,28 @@ import { Blockchain } from "./Blockchain";
6
6
  * @interface BlockchainStorage Provides information about contracts by blockchain
7
7
  */
8
8
  export interface BlockchainStorage {
9
+ /**
10
+ * Retrieves a smart contract by blockchain and address.
11
+ *
12
+ * @param {Blockchain} blockchain - The blockchain instance.
13
+ * @param {Address} address - The address of the smart contract.
14
+ * @returns {Promise<SmartContract>} - The smart contract instance.
15
+ */
9
16
  getContract(blockchain: Blockchain, address: Address): Promise<SmartContract>;
17
+ /**
18
+ * Lists all known smart contracts.
19
+ *
20
+ * @returns {SmartContract[]} - An array of known smart contracts.
21
+ */
10
22
  knownContracts(): SmartContract[];
23
+ /**
24
+ * Clears the internal cache of known contracts.
25
+ */
11
26
  clearKnownContracts(): void;
12
27
  }
28
+ /**
29
+ * In-memory storage for blockchain smart contracts.
30
+ */
13
31
  export declare class LocalBlockchainStorage implements BlockchainStorage {
14
32
  private contracts;
15
33
  getContract(blockchain: Blockchain, address: Address): Promise<SmartContract>;
@@ -30,13 +48,12 @@ export interface RemoteBlockchainStorageClient {
30
48
  /**
31
49
  * Wraps ton client for remote storage.
32
50
  *
33
- * ```ts
51
+ * @example
34
52
  * let client = new TonClient4({
35
53
  * endpoint: 'https://mainnet-v4.tonhubapi.com'
36
54
  * })
37
55
  *
38
56
  * let remoteStorageClient = wrapTonClient4ForRemote(client);
39
- * ```
40
57
  *
41
58
  * @param client TonClient4 to wrap
42
59
  */
@@ -70,7 +87,8 @@ export declare function wrapTonClient4ForRemote(client: {
70
87
  }): RemoteBlockchainStorageClient;
71
88
  /**
72
89
  * @class {RemoteBlockchainStorage} Remote blockchain storage implementation.
73
- * ```ts
90
+ *
91
+ * @example
74
92
  * let client = new TonClient4({
75
93
  * endpoint: 'https://mainnet-v4.tonhubapi.com'
76
94
  * })
@@ -78,7 +96,6 @@ export declare function wrapTonClient4ForRemote(client: {
78
96
  * let blockchain = await Blockchain.create({
79
97
  * storage: new RemoteBlockchainStorage(wrapTonClient4ForRemote(client), 34892000)
80
98
  * });
81
- * ```
82
99
  */
83
100
  export declare class RemoteBlockchainStorage implements BlockchainStorage {
84
101
  private contracts;
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RemoteBlockchainStorage = exports.wrapTonClient4ForRemote = exports.LocalBlockchainStorage = void 0;
4
4
  const core_1 = require("@ton/core");
5
5
  const SmartContract_1 = require("./SmartContract");
6
+ /**
7
+ * In-memory storage for blockchain smart contracts.
8
+ */
6
9
  class LocalBlockchainStorage {
7
10
  constructor() {
8
11
  this.contracts = new Map();
@@ -38,13 +41,12 @@ function convertTonClient4State(state) {
38
41
  /**
39
42
  * Wraps ton client for remote storage.
40
43
  *
41
- * ```ts
44
+ * @example
42
45
  * let client = new TonClient4({
43
46
  * endpoint: 'https://mainnet-v4.tonhubapi.com'
44
47
  * })
45
48
  *
46
49
  * let remoteStorageClient = wrapTonClient4ForRemote(client);
47
- * ```
48
50
  *
49
51
  * @param client TonClient4 to wrap
50
52
  */
@@ -70,7 +72,8 @@ function wrapTonClient4ForRemote(client) {
70
72
  exports.wrapTonClient4ForRemote = wrapTonClient4ForRemote;
71
73
  /**
72
74
  * @class {RemoteBlockchainStorage} Remote blockchain storage implementation.
73
- * ```ts
75
+ *
76
+ * @example
74
77
  * let client = new TonClient4({
75
78
  * endpoint: 'https://mainnet-v4.tonhubapi.com'
76
79
  * })
@@ -78,7 +81,6 @@ exports.wrapTonClient4ForRemote = wrapTonClient4ForRemote;
78
81
  * let blockchain = await Blockchain.create({
79
82
  * storage: new RemoteBlockchainStorage(wrapTonClient4ForRemote(client), 34892000)
80
83
  * });
81
- * ```
82
84
  */
83
85
  class RemoteBlockchainStorage {
84
86
  constructor(client, blockSeqno) {