@layerzerolabs/ton-sdk-tools 3.0.18-ton.2 → 3.0.19-ton.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/dist/index.d.mts CHANGED
@@ -1,18 +1,14 @@
1
- import { Cell, Builder, ContractProvider, Sender, SenderArguments, Address, SendMode, Contract, Transaction, TransactionComputeVm, Message } from '@ton/core';
1
+ import { Cell, Address, SendMode, Contract, ContractProvider, Sender, SenderArguments, Builder, Transaction, TransactionComputeVm, Message } from '@ton/core';
2
2
  import { BlockchainTransaction, Blockchain } from '@ton/sandbox';
3
3
  import { FlatTransactionComparable } from '@ton/test-utils';
4
4
 
5
5
  interface ConstructorArgs {
6
6
  [key: string]: string;
7
7
  }
8
- type MetaType = 'const' | 'inputArg' | 'constClass' | 'classWithArgs';
9
8
  interface Attribute {
10
9
  name: string;
11
10
  type: string;
12
11
  value: string;
13
- metaType: MetaType;
14
- dependencyName: string;
15
- dependencyConstructorCallGenerator?: ConstructorCallGenerator;
16
12
  }
17
13
  type ConstructorCallGenerator = (args: ConstructorArgs, _: unknown) => string;
18
14
  interface FieldMap {
@@ -25,26 +21,16 @@ interface TonObject {
25
21
  constructorName: string;
26
22
  constructorInputArgs: ConstructorArgs;
27
23
  attributes: Attribute[];
28
- constructorIncomplete: boolean;
29
- dependencies: string[];
30
24
  tonName: string;
31
25
  fieldMap: FieldMap;
32
26
  inverseFieldMap: InverseFieldMap;
33
27
  constructorCode?: string;
34
28
  constructorCodeCallGenerator?: ConstructorCallGenerator;
35
- flatConstructorArgs?: ConstructorArgs;
36
- nonClassConstructorArgs?: ConstructorArgs;
37
- fromScratchConstructorCode?: string;
38
- fromScratchConstructorName?: string;
39
- scratchConstructorCodeCallGenerator?: ConstructorCallGenerator;
40
29
  tsTypeName?: string;
41
30
  tsTypeCode?: string;
42
31
  deconstructorName?: string;
43
- deconstructorIncomplete?: boolean;
44
32
  deconstructorCode?: string;
45
33
  deconstructorCodeCallGenerator?: ConstructorCallGenerator;
46
- cellConstructorCode?: string;
47
- cellConstructorCodeCallGenerator?: ConstructorCallGenerator;
48
34
  is_md?: boolean;
49
35
  }
50
36
  interface TonObjectsDict {
@@ -63,12 +49,15 @@ interface TonViewFunctionsDict {
63
49
  }
64
50
  declare function mergeConstructorDicts(result: TonObjectsDict, added: TonObjectsDict): TonObjectsDict;
65
51
  declare function parseDirectory(directoryPath: string): TonObjectsDict;
66
- declare function saveTonContractWrapper(tonObjects: TonObjectsDict, directory: string): void;
52
+ declare function saveTonContractWrapper(tonObjects: TonObjectsDict, directory: string, baseWrapper?: string): void;
67
53
  declare function saveAllTypes(tonObjects: TonObjectsDict, directory: string): void;
68
54
  declare function saveTonObjectUnwrapper(tonObjects: TonObjectsDict, directory: string): void;
69
- declare function recursiveGenConstructorCode(classConstructors: TonObjectsDict, key?: string): TonObjectsDict;
70
- declare function recursiveGenTSTypes(classConstructors: TonObjectsDict, key?: string): TonObjectsDict;
71
- declare function recursiveGenDeconstructorCode(classConstructors: TonObjectsDict, key?: string): TonObjectsDict;
55
+ declare function generateConstructorCode(className: string, tonClasses: TonObjectsDict): TonObjectsDict;
56
+ declare function generateAllConstructorCodes(tonClasses: TonObjectsDict): TonObjectsDict;
57
+ declare function generateTonClassType(name: string, tonClasses: TonObjectsDict): TonObjectsDict;
58
+ declare function generateAllTonClassTypes(tonClasses: TonObjectsDict): TonObjectsDict;
59
+ declare function generateDeconstructorCode(className: string, tonClasses: TonObjectsDict): TonObjectsDict;
60
+ declare function generateAllDeconstructorCodes(tonClasses: TonObjectsDict): TonObjectsDict;
72
61
  declare function getSpecificFiles(dirPath: string, includeName: string): string[];
73
62
  declare function saveObjectsAsTS(tonObjects: TonObjectsDict, filePath: string, fileName: string): void;
74
63
  declare function extractConstants(fileNames: string[], constType: 'opcode' | 'error'): Map<string, bigint>;
@@ -94,9 +83,6 @@ declare function getOpcodeCRC(input: string): bigint;
94
83
  declare const MASTER_CHAIN_ID = -1;
95
84
  declare const BASE_CHAIN_ID = 0;
96
85
  declare const MASTER_CHAIN_SHARD = "8000000000000000";
97
- declare function randomQueryId(): number;
98
- declare function beginMessage(opcode: number | bigint, queryId?: number | bigint): Builder;
99
- declare function sendRequest(provider: ContractProvider, via: Sender, request: SenderArguments): Promise<void>;
100
86
  declare function bigintToAddress(value: bigint): Address;
101
87
  declare const addressToBigInt: (address: Address) => bigint;
102
88
  /**
@@ -127,13 +113,10 @@ declare abstract class BaseWrapper implements Contract {
127
113
  data: Cell;
128
114
  } | undefined);
129
115
  sendDeploy(provider: ContractProvider, via: Sender, value: bigint | string): Promise<void>;
130
- buildSenderArguments(body: Cell, opts: SendRequestOptions): SenderArguments;
131
116
  sendRequest(provider: ContractProvider, via: Sender, request: SenderArguments): Promise<void>;
132
- sendArbitraryOp(provider: ContractProvider, via: Sender, op_code: number, opts: {
133
- value: bigint | string;
134
- queryId?: number | bigint;
135
- }): Promise<void>;
136
117
  getDeployed(provider: ContractProvider): Promise<boolean>;
118
+ buildSenderArguments(body: Cell, opts: SendRequestOptions): SenderArguments;
119
+ beginMessage(opcode: number | bigint, queryId?: number | bigint): Builder;
137
120
  }
138
121
 
139
122
  declare function generateTestUtilsCode(directory: string, filename: string): void;
@@ -448,4 +431,4 @@ declare function printTransactionTrace(transactions: Transaction[], opcodeInfo:
448
431
  [p: string]: string;
449
432
  }, callerStack?: string, profile?: Profile): void;
450
433
 
451
- export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type MetaType, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findDeepestCell, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
434
+ export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findDeepestCell, findTransaction, formatCoinsPure, generateAllConstructorCodes, generateAllDeconstructorCodes, generateAllTonClassTypes, generateAllViewFunctions, generateConstructorCode, generateDeconstructorCode, generateTestUtilsCode, generateTonClassType, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, storageCollected, to32ByteBuffer };
package/dist/index.d.ts CHANGED
@@ -1,18 +1,14 @@
1
- import { Cell, Builder, ContractProvider, Sender, SenderArguments, Address, SendMode, Contract, Transaction, TransactionComputeVm, Message } from '@ton/core';
1
+ import { Cell, Address, SendMode, Contract, ContractProvider, Sender, SenderArguments, Builder, Transaction, TransactionComputeVm, Message } from '@ton/core';
2
2
  import { BlockchainTransaction, Blockchain } from '@ton/sandbox';
3
3
  import { FlatTransactionComparable } from '@ton/test-utils';
4
4
 
5
5
  interface ConstructorArgs {
6
6
  [key: string]: string;
7
7
  }
8
- type MetaType = 'const' | 'inputArg' | 'constClass' | 'classWithArgs';
9
8
  interface Attribute {
10
9
  name: string;
11
10
  type: string;
12
11
  value: string;
13
- metaType: MetaType;
14
- dependencyName: string;
15
- dependencyConstructorCallGenerator?: ConstructorCallGenerator;
16
12
  }
17
13
  type ConstructorCallGenerator = (args: ConstructorArgs, _: unknown) => string;
18
14
  interface FieldMap {
@@ -25,26 +21,16 @@ interface TonObject {
25
21
  constructorName: string;
26
22
  constructorInputArgs: ConstructorArgs;
27
23
  attributes: Attribute[];
28
- constructorIncomplete: boolean;
29
- dependencies: string[];
30
24
  tonName: string;
31
25
  fieldMap: FieldMap;
32
26
  inverseFieldMap: InverseFieldMap;
33
27
  constructorCode?: string;
34
28
  constructorCodeCallGenerator?: ConstructorCallGenerator;
35
- flatConstructorArgs?: ConstructorArgs;
36
- nonClassConstructorArgs?: ConstructorArgs;
37
- fromScratchConstructorCode?: string;
38
- fromScratchConstructorName?: string;
39
- scratchConstructorCodeCallGenerator?: ConstructorCallGenerator;
40
29
  tsTypeName?: string;
41
30
  tsTypeCode?: string;
42
31
  deconstructorName?: string;
43
- deconstructorIncomplete?: boolean;
44
32
  deconstructorCode?: string;
45
33
  deconstructorCodeCallGenerator?: ConstructorCallGenerator;
46
- cellConstructorCode?: string;
47
- cellConstructorCodeCallGenerator?: ConstructorCallGenerator;
48
34
  is_md?: boolean;
49
35
  }
50
36
  interface TonObjectsDict {
@@ -63,12 +49,15 @@ interface TonViewFunctionsDict {
63
49
  }
64
50
  declare function mergeConstructorDicts(result: TonObjectsDict, added: TonObjectsDict): TonObjectsDict;
65
51
  declare function parseDirectory(directoryPath: string): TonObjectsDict;
66
- declare function saveTonContractWrapper(tonObjects: TonObjectsDict, directory: string): void;
52
+ declare function saveTonContractWrapper(tonObjects: TonObjectsDict, directory: string, baseWrapper?: string): void;
67
53
  declare function saveAllTypes(tonObjects: TonObjectsDict, directory: string): void;
68
54
  declare function saveTonObjectUnwrapper(tonObjects: TonObjectsDict, directory: string): void;
69
- declare function recursiveGenConstructorCode(classConstructors: TonObjectsDict, key?: string): TonObjectsDict;
70
- declare function recursiveGenTSTypes(classConstructors: TonObjectsDict, key?: string): TonObjectsDict;
71
- declare function recursiveGenDeconstructorCode(classConstructors: TonObjectsDict, key?: string): TonObjectsDict;
55
+ declare function generateConstructorCode(className: string, tonClasses: TonObjectsDict): TonObjectsDict;
56
+ declare function generateAllConstructorCodes(tonClasses: TonObjectsDict): TonObjectsDict;
57
+ declare function generateTonClassType(name: string, tonClasses: TonObjectsDict): TonObjectsDict;
58
+ declare function generateAllTonClassTypes(tonClasses: TonObjectsDict): TonObjectsDict;
59
+ declare function generateDeconstructorCode(className: string, tonClasses: TonObjectsDict): TonObjectsDict;
60
+ declare function generateAllDeconstructorCodes(tonClasses: TonObjectsDict): TonObjectsDict;
72
61
  declare function getSpecificFiles(dirPath: string, includeName: string): string[];
73
62
  declare function saveObjectsAsTS(tonObjects: TonObjectsDict, filePath: string, fileName: string): void;
74
63
  declare function extractConstants(fileNames: string[], constType: 'opcode' | 'error'): Map<string, bigint>;
@@ -94,9 +83,6 @@ declare function getOpcodeCRC(input: string): bigint;
94
83
  declare const MASTER_CHAIN_ID = -1;
95
84
  declare const BASE_CHAIN_ID = 0;
96
85
  declare const MASTER_CHAIN_SHARD = "8000000000000000";
97
- declare function randomQueryId(): number;
98
- declare function beginMessage(opcode: number | bigint, queryId?: number | bigint): Builder;
99
- declare function sendRequest(provider: ContractProvider, via: Sender, request: SenderArguments): Promise<void>;
100
86
  declare function bigintToAddress(value: bigint): Address;
101
87
  declare const addressToBigInt: (address: Address) => bigint;
102
88
  /**
@@ -127,13 +113,10 @@ declare abstract class BaseWrapper implements Contract {
127
113
  data: Cell;
128
114
  } | undefined);
129
115
  sendDeploy(provider: ContractProvider, via: Sender, value: bigint | string): Promise<void>;
130
- buildSenderArguments(body: Cell, opts: SendRequestOptions): SenderArguments;
131
116
  sendRequest(provider: ContractProvider, via: Sender, request: SenderArguments): Promise<void>;
132
- sendArbitraryOp(provider: ContractProvider, via: Sender, op_code: number, opts: {
133
- value: bigint | string;
134
- queryId?: number | bigint;
135
- }): Promise<void>;
136
117
  getDeployed(provider: ContractProvider): Promise<boolean>;
118
+ buildSenderArguments(body: Cell, opts: SendRequestOptions): SenderArguments;
119
+ beginMessage(opcode: number | bigint, queryId?: number | bigint): Builder;
137
120
  }
138
121
 
139
122
  declare function generateTestUtilsCode(directory: string, filename: string): void;
@@ -448,4 +431,4 @@ declare function printTransactionTrace(transactions: Transaction[], opcodeInfo:
448
431
  [p: string]: string;
449
432
  }, callerStack?: string, profile?: Profile): void;
450
433
 
451
- export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type MetaType, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, beginMessage, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findDeepestCell, findTransaction, formatCoinsPure, generateAllViewFunctions, generateTestUtilsCode, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, randomQueryId, recursiveGenConstructorCode, recursiveGenDeconstructorCode, recursiveGenTSTypes, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendRequest, storageCollected, to32ByteBuffer };
434
+ export { type Action, type Attribute, BASE_CHAIN_ID, BaseWrapper, type ConstructorArgs, type ConstructorCallGenerator, Errors, type FieldMap, type GasInfo, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, Op, Order, type OrderFullConfig, type OrderInitConfig, type Profile, type SendRequestOptions, type TonObject, type TonObjectsDict, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, addressToBigInt, bigintToAddress, buildOnchainMetadata, cellFromArtifact, computedGeneric, differentAddress, executeFrom, executeTill, extractConstants, extractEvents, findDeepestCell, findTransaction, formatCoinsPure, generateAllConstructorCodes, generateAllDeconstructorCodes, generateAllTonClassTypes, generateAllViewFunctions, generateConstructorCode, generateDeconstructorCode, generateTestUtilsCode, generateTonClassType, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, orderConfigToCell, parseDirectory, printTransactionTrace, saveAllTypes, saveConstantsFile, saveEventsFile, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, storageCollected, to32ByteBuffer };