Releases: justdmitry/TonLib.NET
v0.22
New features and fixes:
- Additional overloads for
SmcRunGetMethod
for less boilerplate code; - Drop support unsupported anymore
net7
, updateSystem.Text.Json
to 8.0.4; StoreAddressIntStd
now accepts nulls and empty strings (and writes two zero bits);- New
CreateTransferCell
andCreateBurnCell
methods inTep74Jettons
recipe (to create cells instead of messages); - New
TryParseJettonTransferNotification
inTep74Jettons
recipe to work with incoming jetton transfers; - Remove obsolete
ISerializable
support fromTonClientException
; - Add CancellationTokens to
ITonClient
params (fix #8).
v0.21.3: Deep Tx parsing and other useful helpers
Transaction data can be parsed now (according to block.tlb) to obtain some "internal" fields from phases, like fees or success flag(s). See TransactionTests.cs for more details;
Improvements to existing classes:
- Boc: new
ParseFromHex
andTryParseFromHex
(in addition to ...FromBase64); - Slice:
LoadAndParseDict
,TryLoadAndParseDict
andParseDict
now accept optionalIEqualityComparer<TKey>
; - Slice: new
SkipRef
so you don't need to read it to temporary variable; - Slice/Cell: new
ParseDictRef
,LoadAndParseDictRef
andTryLoadAndParseDictRef
to work with Cell-as-value dicts; - AddressUtils: new
TrySetBounceable
to validate address string and convert it to required bounceable mode in one call; - ITonClient: new
SyncStateCurrentSeqno
property return current (synced to) masterchain height; - ITonClient: new
Deinit
method to "forget" LiteServer currently connected to, and initiate new connection on nextInitIfNeeded
- for example if you detect that current LiteServer is not synced; - TonOptions: new
ConfigPathLocalTestnet
andConfigPathLocalMainnet
properties, so you can use locally saved config instead of downloading it every time;
v0.20: A lot of new stuff
- New
TonRecipes.NFTs
added to work with TEP-62 NFTs:GetCollectionData
,GetNftAddressByIndex
,GetNftData
,GetNftContent
,CreateTransferMessage
; - New extension methods
ToBoc()
forStackEntry
,StackEntryCell
,StackEntrySlice
,Cell
andSlice
, so you can write shorter code with lessToTvmCell()
and similar chained conversions; - New extension methods
ToInt()
,ToLong()
,ToBigInteger()
andToBigIntegerBytes()
forStackEntry
, so you can writeresult.Stack[0].ToInt()
instead ofint.Parse(result.Stack[0].ToTvmNumberDecimal(), CultureInfo.InvariantCulture)
; - Additional constructors for types that expect
List<ofSomething>
: now they also accepts arrays withparams
modifier; - New
TonUtils.KeyUtils
to work with keys, particularlyParseEd25519PublicKey
to convert public key from internal tonlib representation to bytes; - New requests:
GetConfigAll
andGetConfigParam
to get blockchain configuration data; - Additional
Slice
numeric methods:PreloadUShort
,PreloadShort
,PreloadUInt
,PreloadInt
,PreloadULong
,PreloadLong
; - Additional
Slice
andCellBuilder
string methods:LoadString
andStoreString
(as utf-8 bytes); - Additional
Slice
andCellBuilder
long-string methods:LoadStringSnake
andStoreStringSnake
,LoadStringChunked
andStoreStringChunked
; - Support for wallet-v4:
V4AccountState
andV4InitialAccountState
; - New framework net8.0 added to list of target frameworks
v0.19: TonRecipes for Jettons
- Use
TonRecipes.Jettons
to transfer or burn jettons, to get general Jetton data or JettonWallet data
⚠ But wait for resolution of ton-blockchain/ton#709 first! ⚠ - Framework
net7.0
added (now supports bothnet6.0
andnet7.0
)
v0.18: TonRecipes for anonymous numbers
TonRecipes.Telemint
replaced with two: TonRecipes.TelegramUsernames
(for *.t.me names) and TonRecipes.TelegramNumbers
(for +888 anonymous numbers).
v0.17: TonRecipes
New TonRecipes
static class with read-to-use one-liners, e.g.:
TonRecipes.RootDns.GetNftAddress
to get DNS NFT Contract address fromsomething.ton
domain name;TonRecipes.RootDns.GetOwner
to get owner of DNS NFT by it's address;TonRecipes.RootDns.GetAllInfo
to load all information from DNS NFT smartcontract data and parse to separate ready-to-use fields;- Other RootDns methods;
- Similar
TonRecipes.Telemint
class to work with*.t.me
NFTs;
v0.16: TonUtils
Static TonUtils
class with useful functions:
Address.IsValid (string address, out byte workchainId, out bool bounceable, out bool testnetOnly)
Address.SetBounceable (string address, bool bounceable)
Coins.FromNano (long nano)
Coins.ToNano (decimal ton)
Text.EncodeAsBase64 (string? source)
Text.TryDecodeBase64 (string? source, out string? result)
Adnl.Encode (ReadOnlySpan<byte> adnl)
Adnl.Decode (string adnl)
More helpers may be added in future releases.
v0.15: HashmapE / Dictionary
Now you can read/write dictionaries (HashmapE) from/to cells:
- Use
LoadDict
andTryLoadDict
to load Cell with dict data (or something that has been stored as dict data) from Slice, then callParseDict
to load actual dict data from that Cell. - Use
LoadAndParseDict
,TryLoadAndParseDict
to load and immediately parse dictionary. - Use
StoreDict
overloads to store Cell with serialized dict data or serialize-and-store dict.
Check DictTests.cs for some samples.
v0.14: CellBuilder changes and useful extensions
CellBuilder
changed in storing coins:StoreGrams
andLoadGrams
removed- Added
LoadCoins
(to long),LoadCoinsToULong
andLoadCoinsToBigInt
- Several
StoreCoins
added (accept long, ulong and BigInteger)
By default, you can safely work with TON (nanoTON) in Int64 (long) - check https://t.me/tondev/122940 for details. ULong and BigInteger were added for advanced scenarios.
- Some syntactic sugar extensions were added for easier reading TVM data (for parsing
SmcRunGetMethod
responses for example):
now you can write
var boc = runResult.Stack[0].ToTvmCell().ToBoc();
instead of
Boc.TryParseFromBase64(((StackEntryCell)runResult.Stack[0]).Cell.Bytes, out var boc)
v0.13: Cells & BOCs
New in v0.13:
BOC
to parse Cells from TON Blockchain and to serialize Cells to send;- Convert
Cell
toSlice
and read data from cells; - Use
CellBuilder
to fill Cell with your data;
Minor updates:
- tonlibjson library names were updated to match v2023.04 release
- Demo project restructures for easier understanding