@layerzerolabs/ton-sdk-tools 3.0.84 → 3.0.85
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 +6 -0
- package/dist/index.cjs +869 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +504 -22
- package/dist/index.d.ts +504 -22
- package/dist/index.mjs +821 -34
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Cell, Address, SendMode, Contract, ContractProvider, Sender, SenderArguments, Builder, OpenedContract, TupleReader, ContractState, TupleItem, Transaction, TransactionComputeVm, Message } from '@ton/core';
|
|
1
|
+
import { Cell, Address, Dictionary, SendMode, Contract, ContractProvider, Sender, SenderArguments, Builder, OpenedContract, TupleReader, ContractState, TupleItem, Transaction, TransactionComputeVm, Message, MessageRelaxed, DictionaryValue } from '@ton/core';
|
|
2
2
|
import { SandboxContract, BlockchainTransaction, Blockchain, Treasury, SendMessageResult, TreasuryContract } from '@ton/sandbox';
|
|
3
3
|
import { FlatTransactionComparable } from '@ton/test-utils';
|
|
4
|
+
import { KeyPair } from '@ton/crypto';
|
|
5
|
+
import { WalletContractV4 } from '@ton/ton';
|
|
4
6
|
|
|
5
7
|
interface ConstructorArgs {
|
|
6
8
|
[key: string]: string;
|
|
@@ -71,34 +73,73 @@ declare function saveConstantsFile(constants: Map<string, bigint>, directory: st
|
|
|
71
73
|
declare function generateAllViewFunctions(rootDir: string, nameWhitelist: string[], blacklist: string[]): TonViewFunctionsDict;
|
|
72
74
|
declare function saveViewFunctions(viewFunctions: TonViewFunctionsDict, directory: string, filename: string): void;
|
|
73
75
|
|
|
76
|
+
declare const cl: {
|
|
77
|
+
readonly t: {
|
|
78
|
+
readonly uint1: 0;
|
|
79
|
+
readonly bool: 0;
|
|
80
|
+
readonly uint2: 1;
|
|
81
|
+
readonly uint4: 2;
|
|
82
|
+
readonly uint8: 3;
|
|
83
|
+
readonly uint16: 4;
|
|
84
|
+
readonly uint32: 5;
|
|
85
|
+
readonly uint64: 6;
|
|
86
|
+
readonly uint128: 7;
|
|
87
|
+
readonly coins: 7;
|
|
88
|
+
readonly uint256: 8;
|
|
89
|
+
readonly address: 8;
|
|
90
|
+
readonly cellRef: 9;
|
|
91
|
+
readonly dict256: 9;
|
|
92
|
+
readonly objRef: 9;
|
|
93
|
+
readonly addressList: 9;
|
|
94
|
+
};
|
|
95
|
+
readonly NULL_CLASS_NAME: "NULL";
|
|
96
|
+
readonly ERROR: {
|
|
97
|
+
readonly INVALID_CLASS: "INVALID_CLASS";
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
declare const NAME_WIDTH: number;
|
|
101
|
+
declare const MAX_CELL_BITS = 1023;
|
|
102
|
+
type ClassTypeLike = Cell;
|
|
103
|
+
type NumberTypeLike = string | bigint | number;
|
|
104
|
+
type BoolTypeLike = NumberTypeLike | boolean;
|
|
105
|
+
type AddressTypeLike = Address | string | bigint;
|
|
106
|
+
type AddressListTypeLike = AddressTypeLike[] | Cell;
|
|
107
|
+
type DecodedAndRaw<T, _Cell extends Cell = Cell> = T & {
|
|
108
|
+
rawCell: _Cell;
|
|
109
|
+
};
|
|
110
|
+
type DictionaryTypeLike<V> = Dictionary<bigint, V> | Cell | DecodedAndRaw<object>;
|
|
111
|
+
interface ClDeclareCellField {
|
|
112
|
+
type: typeof cl.t.objRef;
|
|
113
|
+
value: Cell;
|
|
114
|
+
}
|
|
115
|
+
interface ClDeclareNumericField {
|
|
116
|
+
type: (typeof cl.t)[keyof Omit<typeof cl.t, 'objRef' | 'cellRef' | 'dict256'>];
|
|
117
|
+
value: NumberTypeLike | BoolTypeLike | AddressTypeLike;
|
|
118
|
+
typeMetadata: keyof (typeof cl)['t'];
|
|
119
|
+
}
|
|
120
|
+
type ClDeclareField = ClDeclareCellField | ClDeclareNumericField;
|
|
74
121
|
/**
|
|
75
|
-
*
|
|
76
|
-
* and only the `hex` property is made required.
|
|
77
|
-
*
|
|
78
|
-
* @param artifact Blueprint JSON artifact object
|
|
79
|
-
* @returns {Cell}
|
|
122
|
+
* Throws an error if value is smaller than -1
|
|
80
123
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
declare function getOpcodeCRC(input: string): bigint;
|
|
88
|
-
declare const MASTER_CHAIN_ID = -1;
|
|
89
|
-
declare const BASE_CHAIN_ID = 0;
|
|
90
|
-
declare const MASTER_CHAIN_SHARD = "8000000000000000";
|
|
91
|
-
declare function bigintToAddress(value: bigint): Address;
|
|
92
|
-
declare const addressToBigInt: (address: Address) => bigint;
|
|
124
|
+
declare const numberTypeLikeToAbsBigInt: (val: NumberTypeLike | BoolTypeLike | AddressTypeLike, typeMetadata?: keyof (typeof cl)['t']) => bigint;
|
|
125
|
+
declare const _getTypeWidth: (clType: (typeof cl.t)[keyof typeof cl.t]) => number;
|
|
126
|
+
declare const clDeclare: (name: bigint, fields: ClDeclareField[]) => Cell;
|
|
127
|
+
declare const clGetUint: (cell: Cell, fieldName: number, width: number) => bigint;
|
|
128
|
+
declare const clGetCellRef: (cell: Cell, fieldName: number) => Cell;
|
|
129
|
+
|
|
93
130
|
/**
|
|
94
131
|
* Convert a value to a 32 byte buffer, if the value is a string, it can only be a hex string
|
|
95
132
|
* @param value
|
|
96
133
|
* @param maxIntermediateBufferSize
|
|
97
134
|
*/
|
|
98
135
|
declare function to32ByteBuffer(value: bigint | number | string | Uint8Array, maxIntermediateBufferSize?: number): Buffer;
|
|
99
|
-
declare function
|
|
100
|
-
|
|
101
|
-
|
|
136
|
+
declare function trim0x(str: string): string;
|
|
137
|
+
declare function bigintToAddress(value: bigint): Address;
|
|
138
|
+
declare const parseTonAddress: (address: AddressTypeLike) => Address;
|
|
139
|
+
declare const bigIntToHex: (bigInt: bigint) => string;
|
|
140
|
+
declare const addressToHex: (address: AddressTypeLike) => string;
|
|
141
|
+
declare const addressToBigInt: (address: AddressTypeLike) => bigint;
|
|
142
|
+
declare const compareAddresses: (addressA: AddressTypeLike, addressB: AddressTypeLike) => boolean;
|
|
102
143
|
|
|
103
144
|
interface SendRequestOptions {
|
|
104
145
|
value: number | bigint | string;
|
|
@@ -500,6 +541,447 @@ declare function sendMessageViaMultisigAndExpect({ blockchain, multiSigContract,
|
|
|
500
541
|
declare function sendInternalMessageAndExpect({ sender, contract, opCode, md, expectedTransactions, value, balanceRefill, queryId, profile, recursiveDecode, txDecoder, invertedOpcodes, }: SendInternalMessageAndExpectArgs): Promise<SendMessageResult>;
|
|
501
542
|
declare function toHaveTransactions(actualTransactions: BlockchainTransaction[], expectedTransactions: FlatTransactionComparable[]): void;
|
|
502
543
|
|
|
544
|
+
declare const MASTER_CHAIN_ID = -1;
|
|
545
|
+
declare const BASE_CHAIN_ID = 0;
|
|
546
|
+
declare const MASTER_CHAIN_SHARD = "8000000000000000";
|
|
547
|
+
declare const PUBLIC_KEY_BYTE_LENGTH = 64;
|
|
548
|
+
declare function publicKeyToHash(publicKey: Uint8Array): bigint;
|
|
549
|
+
declare function createVerifierDictSet(verifiers: Uint8Array[]): Cell;
|
|
550
|
+
declare const getBocStringFromMessage: (message: MessageRelaxed) => string;
|
|
551
|
+
declare const getMessageFromBocString: (bocString: string) => MessageRelaxed;
|
|
552
|
+
/**
|
|
553
|
+
* Wraps a blueprint-like artifact in a `Cell`. The constrains on the input type are loosened
|
|
554
|
+
* and only the `hex` property is made required.
|
|
555
|
+
*
|
|
556
|
+
* @param artifact Blueprint JSON artifact object
|
|
557
|
+
* @returns {Cell}
|
|
558
|
+
*/
|
|
559
|
+
interface BlueprintArtfiact {
|
|
560
|
+
hex: string;
|
|
561
|
+
hash?: string;
|
|
562
|
+
hashBase64?: string;
|
|
563
|
+
}
|
|
564
|
+
declare const cellFromArtifact: ({ hex }: BlueprintArtfiact) => Cell;
|
|
565
|
+
declare function getOpcodeCRC(input: string): bigint;
|
|
566
|
+
declare function findDeepestCell(cell: Cell): {
|
|
567
|
+
subTreeCells: number;
|
|
568
|
+
};
|
|
569
|
+
|
|
503
570
|
declare function openAndDeployAllStoragesTemplate(blockchain: Blockchain, deployer: SandboxContract<TreasuryContract>, artifact: BlueprintArtfiact, gasValue: bigint, opCode: bigint, md: Cell): Promise<SandboxContract<ClasslibWrapper>>;
|
|
504
571
|
|
|
505
|
-
|
|
572
|
+
declare function toPathArray(path: string): number[];
|
|
573
|
+
declare function getTonWalletFromMnemonic(mnemonic: string, path?: string, workchain?: number): Promise<{
|
|
574
|
+
wallet: WalletContractV4;
|
|
575
|
+
keyPair: KeyPair;
|
|
576
|
+
}>;
|
|
577
|
+
declare const getTonWalletFromMnemonicLegacy: (mnemonic: string, workchain?: number) => Promise<{
|
|
578
|
+
wallet: WalletContractV4;
|
|
579
|
+
keyPair: KeyPair;
|
|
580
|
+
}>;
|
|
581
|
+
|
|
582
|
+
type ValueOf<T> = T[keyof T];
|
|
583
|
+
declare const fieldTypes: readonly ["cl::t::uint1", "cl::t::bool", "cl::t::uint2", "cl::t::uint4", "cl::t::uint8", "cl::t::uint16", "cl::t::uint32", "cl::t::uint64", "cl::t::uint128", "cl::t::coins", "cl::t::uint256", "cl::t::address", "cl::t::dict256", "cl::t::cellRef", "cl::t::objRef", "cl::t::addressList"];
|
|
584
|
+
interface TonObjects {
|
|
585
|
+
[key: string]: {
|
|
586
|
+
name: string;
|
|
587
|
+
} & {
|
|
588
|
+
[key in `${number}`]: {
|
|
589
|
+
fieldName: string;
|
|
590
|
+
fieldType: FieldTypes<TonObjects>;
|
|
591
|
+
};
|
|
592
|
+
};
|
|
593
|
+
}
|
|
594
|
+
type TonObjectsKeys<_TonObjects extends TonObjects> = keyof _TonObjects & string;
|
|
595
|
+
type FieldTypes<_TonObjects extends TonObjects> = (typeof fieldTypes)[number] | TonObjectsKeys<_TonObjects>;
|
|
596
|
+
type ClassDefinition<_TonObjects extends TonObjects, ClassName extends TonObjectsKeys<_TonObjects>> = Omit<_TonObjects[ClassName], 'name'>;
|
|
597
|
+
type EnhancedAddress = Address & {
|
|
598
|
+
toHex: () => string;
|
|
599
|
+
toBigInt: () => bigint;
|
|
600
|
+
};
|
|
601
|
+
type EnhancedAddressList = EnhancedAddress[] & {
|
|
602
|
+
toHex: () => string[];
|
|
603
|
+
toBigInt: () => bigint[];
|
|
604
|
+
};
|
|
605
|
+
type EnhancedCell<_TonObjects extends TonObjects> = Cell & {
|
|
606
|
+
getAddressList: () => EnhancedAddressList;
|
|
607
|
+
cellsToHex: () => string;
|
|
608
|
+
getDict: <V>(valueType: DictionaryValue<V>) => Dictionary<bigint, V>;
|
|
609
|
+
decode: <ClassName extends TonObjectsKeys<_TonObjects>>(className: ClassName) => Fields<_TonObjects, ClassName>;
|
|
610
|
+
clGetCellRef: (index: number) => EnhancedCell<_TonObjects>;
|
|
611
|
+
clGetUint: (index: number, width: number) => bigint;
|
|
612
|
+
getCellName: () => string;
|
|
613
|
+
};
|
|
614
|
+
type LoadableDict<_TonObjects extends TonObjects> = DecodedAndRaw<{
|
|
615
|
+
getDict: <V>(valueType: DictionaryValue<V>) => Dictionary<bigint, V>;
|
|
616
|
+
}, EnhancedCell<_TonObjects>>;
|
|
617
|
+
type FieldTypeToValue<_TonObjects extends TonObjects, FieldType, ClassType extends ClassTypeLike | EnhancedCell<_TonObjects>, NumberType extends NumberTypeLike, BoolType extends BoolTypeLike, AddressType extends AddressTypeLike, AddressListType extends AddressListTypeLike, DictionaryType extends DictionaryTypeLike<any>> = FieldType extends TonObjectsKeys<_TonObjects> ? [
|
|
618
|
+
ClassTypeLike
|
|
619
|
+
] extends [ClassType] ? // eslint-disable-next-line no-use-before-define
|
|
620
|
+
Fields<_TonObjects, FieldType, ClassType, NumberType, BoolType, AddressType, AddressListType> | ClassType : DecodedAndRaw<Fields<_TonObjects, FieldType, ClassType, NumberType, BoolType, AddressType, AddressListType>, EnhancedCell<_TonObjects>> : FieldType extends 'cl::t::cellRef' | 'cl::t::objRef' ? ClassType : FieldType extends 'cl::t::bool' ? BoolType : FieldType extends 'cl::t::address' ? AddressType : FieldType extends 'cl::t::addressList' ? AddressListType : FieldType extends 'cl::t::dict256' ? DictionaryType : NumberType;
|
|
621
|
+
type Fields<_TonObjects extends TonObjects, ClassName extends TonObjectsKeys<_TonObjects>, ClassType extends ClassTypeLike | EnhancedCell<_TonObjects> = EnhancedCell<_TonObjects>, NumberType extends NumberTypeLike = bigint, BoolType extends BoolTypeLike = boolean, AddressType extends AddressTypeLike = EnhancedAddress, AddressListType extends AddressListTypeLike = EnhancedAddressList, DictionaryType extends DictionaryTypeLike<any> = LoadableDict<_TonObjects>> = ValueOf<ClassDefinition<_TonObjects, ClassName>> extends {
|
|
622
|
+
fieldName: string;
|
|
623
|
+
fieldType: FieldTypes<_TonObjects>;
|
|
624
|
+
} ? {
|
|
625
|
+
[K in ValueOf<ClassDefinition<_TonObjects, ClassName>> as K['fieldName'] extends `${ClassName}::${infer PropName}` ? PropName : never]: FieldTypeToValue<_TonObjects, K['fieldType'], ClassType, NumberType, BoolType, AddressType, AddressListType, DictionaryType>;
|
|
626
|
+
} : never;
|
|
627
|
+
declare const isClassName: <_TonObjects extends TonObjects>(_tonObjects: _TonObjects, fieldType: FieldTypes<_TonObjects>) => fieldType is TonObjectsKeys<_TonObjects>;
|
|
628
|
+
declare const generateEncodeClass: <_TonObjects extends TonObjects>(_tonObjects: _TonObjects) => <ClassName extends TonObjectsKeys<_TonObjects>>(_className: ClassName, fields: Fields<_TonObjects, ClassName, Cell, NumberTypeLike, BoolTypeLike, AddressTypeLike, AddressListTypeLike, DictionaryTypeLike<any>>) => Cell;
|
|
629
|
+
declare const generateDecodeClass: <_TonObjects extends TonObjects>(_tonObjects: _TonObjects) => <ClassName extends TonObjectsKeys<_TonObjects>>(_className: ClassName, cell: Cell) => Fields<_TonObjects, ClassName, EnhancedCell<_TonObjects>, bigint, boolean, EnhancedAddress, EnhancedAddressList, LoadableDict<_TonObjects>>;
|
|
630
|
+
declare const baseEncodeClass: <ClassName extends TonObjectsKeys<{
|
|
631
|
+
readonly POOO: {
|
|
632
|
+
readonly '0': {
|
|
633
|
+
readonly fieldName: "POOO::nextEmpty";
|
|
634
|
+
readonly fieldType: "cl::t::uint64";
|
|
635
|
+
};
|
|
636
|
+
readonly '1': {
|
|
637
|
+
readonly fieldName: "POOO::bitmap";
|
|
638
|
+
readonly fieldType: "cl::t::cellRef";
|
|
639
|
+
};
|
|
640
|
+
readonly name: "POOO";
|
|
641
|
+
};
|
|
642
|
+
readonly BaseStorage: {
|
|
643
|
+
readonly '0': {
|
|
644
|
+
readonly fieldName: "BaseStorage::owner";
|
|
645
|
+
readonly fieldType: "cl::t::address";
|
|
646
|
+
};
|
|
647
|
+
readonly '1': {
|
|
648
|
+
readonly fieldName: "BaseStorage::authenticated";
|
|
649
|
+
readonly fieldType: "cl::t::bool";
|
|
650
|
+
};
|
|
651
|
+
readonly '2': {
|
|
652
|
+
readonly fieldName: "BaseStorage::initialized";
|
|
653
|
+
readonly fieldType: "cl::t::bool";
|
|
654
|
+
};
|
|
655
|
+
readonly '3': {
|
|
656
|
+
readonly fieldName: "BaseStorage::initialStorage";
|
|
657
|
+
readonly fieldType: "cl::t::cellRef";
|
|
658
|
+
};
|
|
659
|
+
readonly name: "baseStore";
|
|
660
|
+
};
|
|
661
|
+
readonly 'action::event': {
|
|
662
|
+
readonly '0': {
|
|
663
|
+
readonly fieldName: "action::event::topic";
|
|
664
|
+
readonly fieldType: "cl::t::uint256";
|
|
665
|
+
};
|
|
666
|
+
readonly '1': {
|
|
667
|
+
readonly fieldName: "action::event::body";
|
|
668
|
+
readonly fieldType: "cl::t::objRef";
|
|
669
|
+
};
|
|
670
|
+
readonly '2': {
|
|
671
|
+
readonly fieldName: "action::event::initialStorage";
|
|
672
|
+
readonly fieldType: "cl::t::objRef";
|
|
673
|
+
};
|
|
674
|
+
readonly name: "event";
|
|
675
|
+
};
|
|
676
|
+
}>>(_className: ClassName, fields: Fields<{
|
|
677
|
+
readonly POOO: {
|
|
678
|
+
readonly '0': {
|
|
679
|
+
readonly fieldName: "POOO::nextEmpty";
|
|
680
|
+
readonly fieldType: "cl::t::uint64";
|
|
681
|
+
};
|
|
682
|
+
readonly '1': {
|
|
683
|
+
readonly fieldName: "POOO::bitmap";
|
|
684
|
+
readonly fieldType: "cl::t::cellRef";
|
|
685
|
+
};
|
|
686
|
+
readonly name: "POOO";
|
|
687
|
+
};
|
|
688
|
+
readonly BaseStorage: {
|
|
689
|
+
readonly '0': {
|
|
690
|
+
readonly fieldName: "BaseStorage::owner";
|
|
691
|
+
readonly fieldType: "cl::t::address";
|
|
692
|
+
};
|
|
693
|
+
readonly '1': {
|
|
694
|
+
readonly fieldName: "BaseStorage::authenticated";
|
|
695
|
+
readonly fieldType: "cl::t::bool";
|
|
696
|
+
};
|
|
697
|
+
readonly '2': {
|
|
698
|
+
readonly fieldName: "BaseStorage::initialized";
|
|
699
|
+
readonly fieldType: "cl::t::bool";
|
|
700
|
+
};
|
|
701
|
+
readonly '3': {
|
|
702
|
+
readonly fieldName: "BaseStorage::initialStorage";
|
|
703
|
+
readonly fieldType: "cl::t::cellRef";
|
|
704
|
+
};
|
|
705
|
+
readonly name: "baseStore";
|
|
706
|
+
};
|
|
707
|
+
readonly 'action::event': {
|
|
708
|
+
readonly '0': {
|
|
709
|
+
readonly fieldName: "action::event::topic";
|
|
710
|
+
readonly fieldType: "cl::t::uint256";
|
|
711
|
+
};
|
|
712
|
+
readonly '1': {
|
|
713
|
+
readonly fieldName: "action::event::body";
|
|
714
|
+
readonly fieldType: "cl::t::objRef";
|
|
715
|
+
};
|
|
716
|
+
readonly '2': {
|
|
717
|
+
readonly fieldName: "action::event::initialStorage";
|
|
718
|
+
readonly fieldType: "cl::t::objRef";
|
|
719
|
+
};
|
|
720
|
+
readonly name: "event";
|
|
721
|
+
};
|
|
722
|
+
}, ClassName, Cell, NumberTypeLike, BoolTypeLike, AddressTypeLike, AddressListTypeLike, DictionaryTypeLike<any>>) => Cell;
|
|
723
|
+
declare const baseDecodeClass: <ClassName extends TonObjectsKeys<{
|
|
724
|
+
readonly POOO: {
|
|
725
|
+
readonly '0': {
|
|
726
|
+
readonly fieldName: "POOO::nextEmpty";
|
|
727
|
+
readonly fieldType: "cl::t::uint64";
|
|
728
|
+
};
|
|
729
|
+
readonly '1': {
|
|
730
|
+
readonly fieldName: "POOO::bitmap";
|
|
731
|
+
readonly fieldType: "cl::t::cellRef";
|
|
732
|
+
};
|
|
733
|
+
readonly name: "POOO";
|
|
734
|
+
};
|
|
735
|
+
readonly BaseStorage: {
|
|
736
|
+
readonly '0': {
|
|
737
|
+
readonly fieldName: "BaseStorage::owner";
|
|
738
|
+
readonly fieldType: "cl::t::address";
|
|
739
|
+
};
|
|
740
|
+
readonly '1': {
|
|
741
|
+
readonly fieldName: "BaseStorage::authenticated";
|
|
742
|
+
readonly fieldType: "cl::t::bool";
|
|
743
|
+
};
|
|
744
|
+
readonly '2': {
|
|
745
|
+
readonly fieldName: "BaseStorage::initialized";
|
|
746
|
+
readonly fieldType: "cl::t::bool";
|
|
747
|
+
};
|
|
748
|
+
readonly '3': {
|
|
749
|
+
readonly fieldName: "BaseStorage::initialStorage";
|
|
750
|
+
readonly fieldType: "cl::t::cellRef";
|
|
751
|
+
};
|
|
752
|
+
readonly name: "baseStore";
|
|
753
|
+
};
|
|
754
|
+
readonly 'action::event': {
|
|
755
|
+
readonly '0': {
|
|
756
|
+
readonly fieldName: "action::event::topic";
|
|
757
|
+
readonly fieldType: "cl::t::uint256";
|
|
758
|
+
};
|
|
759
|
+
readonly '1': {
|
|
760
|
+
readonly fieldName: "action::event::body";
|
|
761
|
+
readonly fieldType: "cl::t::objRef";
|
|
762
|
+
};
|
|
763
|
+
readonly '2': {
|
|
764
|
+
readonly fieldName: "action::event::initialStorage";
|
|
765
|
+
readonly fieldType: "cl::t::objRef";
|
|
766
|
+
};
|
|
767
|
+
readonly name: "event";
|
|
768
|
+
};
|
|
769
|
+
}>>(_className: ClassName, cell: Cell) => Fields<{
|
|
770
|
+
readonly POOO: {
|
|
771
|
+
readonly '0': {
|
|
772
|
+
readonly fieldName: "POOO::nextEmpty";
|
|
773
|
+
readonly fieldType: "cl::t::uint64";
|
|
774
|
+
};
|
|
775
|
+
readonly '1': {
|
|
776
|
+
readonly fieldName: "POOO::bitmap";
|
|
777
|
+
readonly fieldType: "cl::t::cellRef";
|
|
778
|
+
};
|
|
779
|
+
readonly name: "POOO";
|
|
780
|
+
};
|
|
781
|
+
readonly BaseStorage: {
|
|
782
|
+
readonly '0': {
|
|
783
|
+
readonly fieldName: "BaseStorage::owner";
|
|
784
|
+
readonly fieldType: "cl::t::address";
|
|
785
|
+
};
|
|
786
|
+
readonly '1': {
|
|
787
|
+
readonly fieldName: "BaseStorage::authenticated";
|
|
788
|
+
readonly fieldType: "cl::t::bool";
|
|
789
|
+
};
|
|
790
|
+
readonly '2': {
|
|
791
|
+
readonly fieldName: "BaseStorage::initialized";
|
|
792
|
+
readonly fieldType: "cl::t::bool";
|
|
793
|
+
};
|
|
794
|
+
readonly '3': {
|
|
795
|
+
readonly fieldName: "BaseStorage::initialStorage";
|
|
796
|
+
readonly fieldType: "cl::t::cellRef";
|
|
797
|
+
};
|
|
798
|
+
readonly name: "baseStore";
|
|
799
|
+
};
|
|
800
|
+
readonly 'action::event': {
|
|
801
|
+
readonly '0': {
|
|
802
|
+
readonly fieldName: "action::event::topic";
|
|
803
|
+
readonly fieldType: "cl::t::uint256";
|
|
804
|
+
};
|
|
805
|
+
readonly '1': {
|
|
806
|
+
readonly fieldName: "action::event::body";
|
|
807
|
+
readonly fieldType: "cl::t::objRef";
|
|
808
|
+
};
|
|
809
|
+
readonly '2': {
|
|
810
|
+
readonly fieldName: "action::event::initialStorage";
|
|
811
|
+
readonly fieldType: "cl::t::objRef";
|
|
812
|
+
};
|
|
813
|
+
readonly name: "event";
|
|
814
|
+
};
|
|
815
|
+
}, ClassName, EnhancedCell<{
|
|
816
|
+
readonly POOO: {
|
|
817
|
+
readonly '0': {
|
|
818
|
+
readonly fieldName: "POOO::nextEmpty";
|
|
819
|
+
readonly fieldType: "cl::t::uint64";
|
|
820
|
+
};
|
|
821
|
+
readonly '1': {
|
|
822
|
+
readonly fieldName: "POOO::bitmap";
|
|
823
|
+
readonly fieldType: "cl::t::cellRef";
|
|
824
|
+
};
|
|
825
|
+
readonly name: "POOO";
|
|
826
|
+
};
|
|
827
|
+
readonly BaseStorage: {
|
|
828
|
+
readonly '0': {
|
|
829
|
+
readonly fieldName: "BaseStorage::owner";
|
|
830
|
+
readonly fieldType: "cl::t::address";
|
|
831
|
+
};
|
|
832
|
+
readonly '1': {
|
|
833
|
+
readonly fieldName: "BaseStorage::authenticated";
|
|
834
|
+
readonly fieldType: "cl::t::bool";
|
|
835
|
+
};
|
|
836
|
+
readonly '2': {
|
|
837
|
+
readonly fieldName: "BaseStorage::initialized";
|
|
838
|
+
readonly fieldType: "cl::t::bool";
|
|
839
|
+
};
|
|
840
|
+
readonly '3': {
|
|
841
|
+
readonly fieldName: "BaseStorage::initialStorage";
|
|
842
|
+
readonly fieldType: "cl::t::cellRef";
|
|
843
|
+
};
|
|
844
|
+
readonly name: "baseStore";
|
|
845
|
+
};
|
|
846
|
+
readonly 'action::event': {
|
|
847
|
+
readonly '0': {
|
|
848
|
+
readonly fieldName: "action::event::topic";
|
|
849
|
+
readonly fieldType: "cl::t::uint256";
|
|
850
|
+
};
|
|
851
|
+
readonly '1': {
|
|
852
|
+
readonly fieldName: "action::event::body";
|
|
853
|
+
readonly fieldType: "cl::t::objRef";
|
|
854
|
+
};
|
|
855
|
+
readonly '2': {
|
|
856
|
+
readonly fieldName: "action::event::initialStorage";
|
|
857
|
+
readonly fieldType: "cl::t::objRef";
|
|
858
|
+
};
|
|
859
|
+
readonly name: "event";
|
|
860
|
+
};
|
|
861
|
+
}>, bigint, boolean, EnhancedAddress, EnhancedAddressList, LoadableDict<{
|
|
862
|
+
readonly POOO: {
|
|
863
|
+
readonly '0': {
|
|
864
|
+
readonly fieldName: "POOO::nextEmpty";
|
|
865
|
+
readonly fieldType: "cl::t::uint64";
|
|
866
|
+
};
|
|
867
|
+
readonly '1': {
|
|
868
|
+
readonly fieldName: "POOO::bitmap";
|
|
869
|
+
readonly fieldType: "cl::t::cellRef";
|
|
870
|
+
};
|
|
871
|
+
readonly name: "POOO";
|
|
872
|
+
};
|
|
873
|
+
readonly BaseStorage: {
|
|
874
|
+
readonly '0': {
|
|
875
|
+
readonly fieldName: "BaseStorage::owner";
|
|
876
|
+
readonly fieldType: "cl::t::address";
|
|
877
|
+
};
|
|
878
|
+
readonly '1': {
|
|
879
|
+
readonly fieldName: "BaseStorage::authenticated";
|
|
880
|
+
readonly fieldType: "cl::t::bool";
|
|
881
|
+
};
|
|
882
|
+
readonly '2': {
|
|
883
|
+
readonly fieldName: "BaseStorage::initialized";
|
|
884
|
+
readonly fieldType: "cl::t::bool";
|
|
885
|
+
};
|
|
886
|
+
readonly '3': {
|
|
887
|
+
readonly fieldName: "BaseStorage::initialStorage";
|
|
888
|
+
readonly fieldType: "cl::t::cellRef";
|
|
889
|
+
};
|
|
890
|
+
readonly name: "baseStore";
|
|
891
|
+
};
|
|
892
|
+
readonly 'action::event': {
|
|
893
|
+
readonly '0': {
|
|
894
|
+
readonly fieldName: "action::event::topic";
|
|
895
|
+
readonly fieldType: "cl::t::uint256";
|
|
896
|
+
};
|
|
897
|
+
readonly '1': {
|
|
898
|
+
readonly fieldName: "action::event::body";
|
|
899
|
+
readonly fieldType: "cl::t::objRef";
|
|
900
|
+
};
|
|
901
|
+
readonly '2': {
|
|
902
|
+
readonly fieldName: "action::event::initialStorage";
|
|
903
|
+
readonly fieldType: "cl::t::objRef";
|
|
904
|
+
};
|
|
905
|
+
readonly name: "event";
|
|
906
|
+
};
|
|
907
|
+
}>>;
|
|
908
|
+
|
|
909
|
+
declare const asciiStringToBigint: (target: string) => bigint;
|
|
910
|
+
declare const bigintToAsciiString: (target: bigint) => string;
|
|
911
|
+
declare const getCellNameNumber: (cell: Cell) => bigint;
|
|
912
|
+
declare const getCellName: (cell: Cell) => string;
|
|
913
|
+
declare const emptyCell: () => Cell;
|
|
914
|
+
declare const nullObject: () => Cell;
|
|
915
|
+
declare const emptyMap: () => Cell;
|
|
916
|
+
declare const emptyPOOO: () => Cell;
|
|
917
|
+
declare const initBaseStorage: (owner: AddressTypeLike) => Cell;
|
|
918
|
+
declare function serializeAddressList(addresses: AddressListTypeLike): Cell;
|
|
919
|
+
declare function deserializeAddressList(cell: Cell): bigint[];
|
|
920
|
+
declare function serializePayees(payeesInfo: {
|
|
921
|
+
address: AddressTypeLike;
|
|
922
|
+
amount: NumberTypeLike;
|
|
923
|
+
}[]): Cell;
|
|
924
|
+
declare function deserializePayees(serializedPayees: Cell): {
|
|
925
|
+
address: string;
|
|
926
|
+
amount: bigint;
|
|
927
|
+
}[];
|
|
928
|
+
|
|
929
|
+
type Primitive = string | number | bigint | any[] | boolean | object;
|
|
930
|
+
/**
|
|
931
|
+
* Recursively traverses a TON cell, deciding how to decode each node based on
|
|
932
|
+
* the class names stored in the cell.
|
|
933
|
+
* @param cell the root cell to begin decoding from.
|
|
934
|
+
* @param hashUndecodeable if TRUE, cells that can't be decoded will be hashed. if FALSE, they will be returned unchanged.
|
|
935
|
+
* This does not apply to primitive values.
|
|
936
|
+
* @returns an object whose fields are each the fields of the decoded cell, and whose (cell) fields are themselves decoded.
|
|
937
|
+
*/
|
|
938
|
+
declare const deepDecode: <Recurse extends {
|
|
939
|
+
[key: string]: Recurse;
|
|
940
|
+
}, ClassName extends "POOO", DecodeClass extends (name: ClassName, cell: Cell) => {
|
|
941
|
+
[key: string]: any;
|
|
942
|
+
}>(decodeClass: DecodeClass, cell: Cell | Primitive, hashUndecodeable?: boolean) => any;
|
|
943
|
+
declare const printDeepDecode: <Recurse extends {
|
|
944
|
+
[key: string]: Recurse;
|
|
945
|
+
}, ClassName extends "POOO", DecodeClass extends (name: ClassName, cell: Cell) => {
|
|
946
|
+
[key: string]: any;
|
|
947
|
+
}>(decodeClass: DecodeClass, cell: Cell | Primitive) => void;
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Deeply compare two TON cells.
|
|
951
|
+
* @param cellA
|
|
952
|
+
* @param cellB
|
|
953
|
+
* @returns an object with a list of all values that differ between the two cells. Each inequal value is {a, b, ancestry},
|
|
954
|
+
* where a and b are the values of cellA and cellB respectively, and ancestry is an array [p_0 ... p_n] s.t. p_i is the name
|
|
955
|
+
* of the field accessed at both cellA and cellB _i_ deep.
|
|
956
|
+
* This function returns _every_ difference between the two cells, except in the case where,
|
|
957
|
+
* e.g., cellA = {subObject: 'hello world'}, cellB = {sub: {a, b, c: {x, y, z}}}--inequalValues = {a: 'hello world', b: [Object object], ancestry: ['Cell', 'subObject'].
|
|
958
|
+
* I.e., it is unable to detect sub-failures after ancestry diverges.
|
|
959
|
+
*/
|
|
960
|
+
declare const deepDiff: <ClassName extends "POOO", DecodeClass extends (name: ClassName, cell: Cell) => {
|
|
961
|
+
[key: string]: any;
|
|
962
|
+
}>(decodeClass: DecodeClass, cellA: Cell, cellB: Cell) => {
|
|
963
|
+
isEqual: boolean;
|
|
964
|
+
inequalValues: {
|
|
965
|
+
a: any;
|
|
966
|
+
b: any;
|
|
967
|
+
ancestry: string[];
|
|
968
|
+
}[];
|
|
969
|
+
};
|
|
970
|
+
declare const printDeepDiff: <ClassName extends "POOO", DecodeClass extends (name: ClassName, cell: Cell) => {
|
|
971
|
+
[key: string]: any;
|
|
972
|
+
}>(decodeClass: DecodeClass, cellA: Cell, cellB: Cell) => void;
|
|
973
|
+
|
|
974
|
+
declare const hexToCells: (hex: string) => Cell;
|
|
975
|
+
declare const getTotalBits: (cell: Cell) => number;
|
|
976
|
+
declare const getClosestByteAlignedBits: (bits: number) => number;
|
|
977
|
+
declare const cellsToHex: (cell: Cell) => string;
|
|
978
|
+
declare const calculateCellConsumption: (cell: Cell) => {
|
|
979
|
+
numberOfCells: number;
|
|
980
|
+
bits: number;
|
|
981
|
+
};
|
|
982
|
+
declare const calculateCellConsumptionFromHex: (hex: string) => {
|
|
983
|
+
numberOfCells: number;
|
|
984
|
+
bits: number;
|
|
985
|
+
};
|
|
986
|
+
|
|
987
|
+
export { type Action, type AddressListTypeLike, type AddressTypeLike, type Attribute, BASE_CHAIN_ID, BaseWrapper, type BlueprintArtfiact, type BoolTypeLike, type ClDeclareCellField, type ClDeclareField, type ClDeclareNumericField, type ClassDefinition, type ClassTypeLike, ClasslibWrapper, type ConstructorArgs, type ConstructorCallGenerator, type DecodedAndRaw, type DictionaryTypeLike, type EnhancedAddress, type EnhancedAddressList, type EnhancedCell, Errors, type ExtendedContract, type FieldMap, type FieldTypeToValue, type FieldTypes, type Fields, type GasInfo, type GetIntFnNames, type InverseFieldMap, JettonMinter, type JettonMinterConfig, type JettonMinterContent, JettonWallet, type JettonWalletConfig, type LoadableDict, MASTER_CHAIN_ID, MASTER_CHAIN_SHARD, MAX_CELL_BITS, type Module, MultiSigErrors, MultiSigOpCodes, MultiSigParams, Multisig, type MultisigConfig, type MultisigData, NAME_WIDTH, type NumberTypeLike, Op, Order, type OrderFullConfig, type OrderInitConfig, PUBLIC_KEY_BYTE_LENGTH, type Profile, type SendInternalMessageAndExpectArgs, type SendMessageViaMultisigAndExpectArgs, type SendRequestOptions, type TonObject, type TonObjects, type TonObjectsDict, type TonObjectsKeys, type TonViewFunction, type TonViewFunctionsDict, type TransferRequest, Txiterator, type UpdateRequest, type ValueOf, _getTypeWidth, addressToBigInt, addressToHex, asciiStringToBigint, baseDecodeClass, baseEncodeClass, bigIntToHex, bigintToAddress, bigintToAsciiString, buildOnchainMetadata, calculateCellConsumption, calculateCellConsumptionFromHex, cellFromArtifact, cellsToHex, cl, clDeclare, clGetCellRef, clGetUint, compareAddresses, computedGeneric, createVerifierDictSet, deepDecode, deepDiff, deserializeAddressList, deserializePayees, differentAddress, emptyCell, emptyMap, emptyPOOO, executeFrom, executeTill, extractErrors, extractEvents, extractOpcodes, fieldTypes, findDeepestCell, findTransaction, formatCoinsPure, generateAllConstructorCodes, generateAllDeconstructorCodes, generateAllTonClassTypes, generateAllViewFunctions, generateCommonTestUtils, generateConstructorCode, generateDecodeClass, generateDeconstructorCode, generateEncodeClass, generateSmlTestUtils, generateTonClassType, generateUlnTestUtils, getBocStringFromMessage, getCellName, getCellNameNumber, getClosestByteAlignedBits, getMessageFromBocString, getMsgPrices, getOpcodeCRC, getRandom, getRandomInt, getSpecificFiles, getTonWalletFromMnemonic, getTonWalletFromMnemonicLegacy, getTotalBits, hexToCells, initBaseStorage, isClassName, jettonContentToCell, jettonMinterConfigToCell, jettonWalletConfigToCell, makeSnakeCell, mergeConstructorDicts, multisigConfigToCell, nullObject, numberTypeLikeToAbsBigInt, openAndDeployAllStoragesTemplate, orderConfigToCell, parseDirectory, parseTonAddress, printDeepDecode, printDeepDiff, printTransactionTrace, publicKeyToHash, saveAllTypes, saveBaseEventHandler, saveConstantsFile, saveEventsFile, saveLzEventHandler, saveLzGasTracker, saveObjectsAsTS, saveTonContractWrapper, saveTonObjectUnwrapper, saveViewFunctions, sendInternalMessageAndExpect, sendMessageViaMultisigAndExpect, serializeAddressList, serializePayees, setLzTonSdkSaveToJson, setLzTonSdkWriteToConsole, storageCollected, to32ByteBuffer, toHaveTransactions, toPathArray, trim0x };
|