Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance API Reference - Documentation improvements #410

Merged
merged 6 commits into from
Oct 1, 2024

Conversation

gtsonevv
Copy link
Collaborator

@gtsonevv gtsonevv commented Sep 27, 2024

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Test Plan

Related issues/PRs

Copy link
Contributor

@frol frol left a comment

Choose a reason for hiding this comment

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

@@ -123,7 +123,7 @@ export class FungibleToken implements FungibleTokenCore, StorageManagement, Fung
// Get the unused amount from the `ft_on_transfer` call result.
let unused_amount: Balance;
try {
const promise_result = near.promiseResult(0).replace(/"*/g, ''); //TODO: why promiseResult returnes result with brackets?
const promise_result = near.promiseResult(0).replace(/"*/g, ''); //TODO: why promiseResult returns result with brackets?
Copy link
Contributor

Choose a reason for hiding this comment

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

FT standard defined the encoding for the input/outputs as JSON. Since JSON does not support big integers, the FT standard uses a string type to pass the unused_amount. It would be cleaner to use JSON.parse() instead of manually "parsing" quotes out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@frol, this is out of this PR's scope, would be better in a separate PR

Comment on lines 21 to 29
* @call({})
* ft_on_transfer({ sender_id, amount, msg }: {
sender_id: AccountId;
amount: number;
msg: String;
}): PromiseOrValue<number> {
return this.token.ft_on_transfer({ sender_id, amount, msg });
};
* }
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting is broken here, and in a few other places in the doc string examples. Please, fix them

Comment on lines 10 to 14
* import {
FungibleTokenCore,
FungibleTokenResolver,
FungibleToken,
* } from "near-contract-standards/lib"
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting issue

@gtsonevv gtsonevv requested a review from frol October 1, 2024 07:29
Copy link
Contributor

@frol frol left a comment

Choose a reason for hiding this comment

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

@race-of-sloths score 5

@frol frol merged commit 1ec6634 into near:develop Oct 1, 2024
2 checks passed
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.

3 participants