Skip to content

Conversation

Karkarmath
Copy link
Contributor

Closes #218

@Karkarmath Karkarmath self-assigned this Oct 6, 2025
@Karkarmath Karkarmath requested a review from a team as a code owner October 6, 2025 18:22
Copy link

github-actions bot commented Oct 6, 2025

To fix the formatting issues:

  1. Install necessary dependencies: npm ci
  2. Then, run this command:
npx remark -o --quiet --silently-ignore standard/tokens/jettons/how-to-get-wallet-data.mdx 

Copy link

github-actions bot commented Oct 6, 2025

Thanks for the updates in the jetton wallet docs area. A few high‑severity items need fixes to meet the style guide and keep examples copy‑pasteable and links canonical.

Findings (3)

High (3)

[HIGH] Placeholder is not in <ANGLE_CASE> and undefined

Location:

const walletAddress = "wallet of interest in any format";

Description:
The example uses a free‑form literal string ("wallet of interest in any format") instead of a <ANGLE_CASE> placeholder, and it is not defined on first use. This creates a copy/paste hazard and violates the placeholder rules for examples. The style guide flags undefined placeholders and copy/paste hazards as [HIGH] (https://github.com/tact-lang/mintlify-ton-docs/blob/main/contribute/style-guide-extended.mdx?plain=1#L31-L31) and requires placeholders in <ANGLE_CASE> defined on first use (https://github.com/tact-lang/mintlify-ton-docs/blob/main/contribute/style-guide-extended.mdx?plain=1#L395-L400).

Suggestion:
Replace the string with a proper placeholder and define it immediately after the snippet.

-const walletAddress = "wallet of interest in any format";
+const walletAddress = "<WALLET_ADDR>";

Define placeholders (first use):
<WALLET_ADDR> — address of the target jetton wallet in any supported format.

[HIGH] JS snippet is not copy‑pasteable; missing proper placeholders

Location:

```javascript
import TonWeb from "tonweb";
const tonweb = new TonWeb();
const walletAddress = "wallet of interest in any format";
const jettonWallet = new TonWeb.token.jetton.JettonWallet(tonweb.provider,{address: walletAddress});
const data = await jettonWallet.getData();
console.log('jetton balance:', data.balance.toString());
console.log('jetton owner address:', data.ownerAddress.toString(true, true, true));
// It is important to verify that the jetton master recognizes the wallet
const JettonMinter = new TonWeb.token.jetton.JettonMinter(tonweb.provider, {address: data.JettonMinterAddress.toString(false)});
const expectedjettonWalletAddress = await JettonMinter.getJettonWalletAddress(data.ownerAddress.toString(false));
if (expectedjettonWalletAddress.toString(false) !== new TonWeb.utils.Address(walletAddress).toString(false)) {
throw new Error('jetton minter does not recognize the wallet');
}
console.log('jetton master address:', data.JettonMinterAddress.toString(true, true, true));
```

Description:
The example uses top‑level await without an async context (e.g., await jettonWallet.getData() on L24 and further awaits on L30), which fails in plain JS when copy‑pasted directly. It also hard‑codes an implicit placeholder string ("wallet of interest in any format") instead of an angle‑case placeholder defined on first use, violating the docs’ copy/paste and placeholder conventions. See contribute/style-guide-extended.mdx for the copy‑pasteable examples and placeholder rules.

Suggestion:
Wrap the calls in an async IIFE and use a defined <JETTON_WALLET_ADDR> placeholder.

 ```javascript
 import TonWeb from "tonweb";
 const tonweb = new TonWeb();
-const walletAddress = "wallet of interest in any format";
-const jettonWallet = new TonWeb.token.jetton.JettonWallet(tonweb.provider,{address: walletAddress});
-const data = await jettonWallet.getData();
-console.log('jetton balance:', data.balance.toString());
-console.log('jetton owner address:', data.ownerAddress.toString(true, true, true));
-
-// It is important to verify that the jetton master recognizes the wallet
-const JettonMinter = new TonWeb.token.jetton.JettonMinter(tonweb.provider, {address: data.JettonMinterAddress.toString(false)});
-const expectedjettonWalletAddress = await JettonMinter.getJettonWalletAddress(data.ownerAddress.toString(false));
-if (expectedjettonWalletAddress.toString(false) !== new TonWeb.utils.Address(walletAddress).toString(false)) {
-  throw new Error('jetton minter does not recognize the wallet');
-}
-
-console.log('jetton master address:', data.JettonMinterAddress.toString(true, true, true));
+const walletAddress = "<JETTON_WALLET_ADDR>";
+const jettonWallet = new TonWeb.token.jetton.JettonWallet(tonweb.provider, { address: walletAddress });
+(async () => {
+  const data = await jettonWallet.getData();
+  console.log('jetton balance:', data.balance.toString());
+  console.log('jetton owner address:', data.ownerAddress.toString(true, true, true));
+  // It is important to verify that the jetton master recognizes the wallet
+  const JettonMinter = new TonWeb.token.jetton.JettonMinter(tonweb.provider, { address: data.JettonMinterAddress.toString(false) });
+  const expectedjettonWalletAddress = await JettonMinter.getJettonWalletAddress(data.ownerAddress.toString(false));
+  if (expectedjettonWalletAddress.toString(false) !== new TonWeb.utils.Address(walletAddress).toString(false)) {
+    throw new Error('jetton minter does not recognize the wallet');
+  }
+  console.log('jetton master address:', data.JettonMinterAddress.toString(true, true, true));
+})();

Define placeholders (first use): <JETTON_WALLET_ADDR> — the jetton wallet address in any supported format.

[HIGH] Unofficial external API link instead of canonical internal reference

Location:

Finally, you can get this information using the [API](https://companyname-a7d5b98e.mintlify.app/api-reference/jettons/get-jetton-wallets).

Description:
The link points to a Mintlify app domain (https://companyname-a7d5b98e.mintlify.app/...), which is an external/unofficial location when a canonical internal docs link should be used. This violates link policy requiring stable internal references when available.

Suggestion:
Replace with a stable internal relative link to the API reference.

-Finally, you can get this information using the [API](https://companyname-a7d5b98e.mintlify.app/api-reference/jettons/get-jetton-wallets).
+Finally, you can get this information using the [API](/api-reference/jettons/get-jetton-wallets).

Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's also fix the relevant AI comments

This comment was marked as resolved.

novusnota
novusnota previously approved these changes Oct 7, 2025
Copy link
Member

@novusnota novusnota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Shvandre
Shvandre previously approved these changes Oct 7, 2025
Copy link
Collaborator

@Shvandre Shvandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a formatter for our code snippets, but let's do that in separate PR

Copy link

To fix the formatting issues:

  1. Install necessary dependencies: npm ci
  2. Then, run this command:
npx remark -o --silent --silently-ignore standard/tokens/jettons/how-to-get-wallet-data.mdx standard/tokens/jettons/mintless/how-to-deploy.mdx 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Jetton > How to: get wallet data]
5 participants