You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Computes 'index' value for NFT with specified name.
15
+
/// Tries to normalize domain name to form used by Collection.
14
16
/// </summary>
15
-
/// <param name="domainName">Domain name to resolve, with or without '.ton' suffix.</param>
16
-
/// <returns><b>byte[8]</b> with required value (<i>cell_hash(domain)</i>, according to <see href="https://github.com/ton-blockchain/dns-contract/blob/main/func/nft-collection.fc#L133">contract source</see>).</returns>
17
+
/// <param name="name">Domain name to normalize.</param>
18
+
/// <param name="normalizedName">Normalized domain name, if possible.</param>
19
+
/// <returns>Returns <b>true</b> when name had been successfully normalized, and <b>false</b> otherwise.</returns>
17
20
/// <remarks>
18
-
/// <para>Only second-level .ton domains are allowed, with or without '.ton' suffix <br/>
21
+
/// <para>Only second-level .ton domains are "valid", with or without '.ton' suffix <br/>
19
22
/// <i>(e.g. 'alice.ton.', 'alice.ton' and 'alice' are allowed, but 'alice.t.me' or 'thisis.alice.ton' is not)</i>.</para>
20
23
/// </remarks>
21
24
/// <exception cref="ArgumentNullException">Requested <paramref name="domainName"/> null or empty.</exception>
22
-
/// <exception cref="ArgumentOutOfRangeException">Requested <paramref name="domainName"/> is not second-level one, or not from '.t.me' namespace, or too long.</exception>
thrownewArgumentOutOfRangeException(nameof(domainName),"Only '.ton' domains (e.g. 'alice.ton') are supported.");
43
+
returnfalse;
44
+
}
45
+
46
+
normalizedName=parts[0];
47
+
returntrue;
48
+
}
49
+
50
+
/// <summary>
51
+
/// Computes 'index' value for NFT with specified name.
52
+
/// </summary>
53
+
/// <param name="domainName">Domain name to resolve, with or without '.ton' suffix.</param>
54
+
/// <returns><b>byte[8]</b> with required value (<i>cell_hash(domain)</i>, according to <see href="https://github.com/ton-blockchain/dns-contract/blob/main/func/nft-collection.fc#L133">contract source</see>).</returns>
55
+
/// <remarks>
56
+
/// <para>Check overriden <see cref="TryNormalizeName">TryNormalizeName</see> docs for 'valid' vs 'invalid' names description.</para>
57
+
/// </remarks>
58
+
/// <exception cref="ArgumentNullException">Requested <paramref name="domainName"/> null or empty.</exception>
59
+
/// <exception cref="ArgumentOutOfRangeException">Requested <paramref name="domainName"/> is too long.</exception>
/// <para>DNS Item contract must be deployed and active (to execute get-method).</para>
298
323
/// <para>⚠ Will work only for <see href="https://github.com/ton-blockchain/dns-contract/blob/main/func/nft-item.fc">DNS Item smartcontract</see>. May fail if future version will change stored data layout.</para>
299
-
/// <para>Only second-level .ton domains are allowed, with or without '.ton' suffix <br/>
300
-
/// <i>(e.g. 'alice.ton.', 'alice.ton' and 'alice' are allowed, but 'alice.t.me' or 'thisis.alice.ton' is not)</i>.</para>
324
+
/// <para>Check overriden <see cref="TryNormalizeName">TryNormalizeName</see> docs for 'valid' vs 'invalid' names description.</para>
301
325
/// </remarks>
302
-
/// <exception cref="ArgumentOutOfRangeException">Requested <paramref name="domainName"/> is not second-level one, or not from '.ton' namespace.</exception>
303
-
/// <exception cref="ArgumentNullException">Requested <paramref name="domainName"/> null or white-space only.</exception>
<PackageReleaseNotes>`TonRecipes.Telemint` replaced with two (`TonRecipes.TelegramUsernames` and `TonRecipes.TelegramNumbers`) to work with both .t.me domains and +888 anonymous numbers.</PackageReleaseNotes>
21
21
<Description>TonLib (tonlibjson) wrapper for accessing Telegram Open Network lite servers (nodes) via ADNL protocol.</Description>
0 commit comments