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

fix: Fixed cli command for memo parameter #446

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

FroVolod
Copy link
Collaborator

@FroVolod FroVolod commented Feb 8, 2025

This fixed the command:

near tokens volodymyr.testnet send-ft usdn.testnet fro_volod.testnet amount-ft '10 usn' prepaid-gas '100.0 Tgas' attached-deposit '1 yoctoNEAR' network-config testnet

to:

near tokens fro_volod.testnet send-ft usdn.testnet volodymyr.testnet '1 usn' memo Mem network-config testnet sign-with-legacy-keychain send

or

near tokens fro_volod.testnet send-ft usdn.testnet volodymyr.testnet '1 usn' memo '' --prepaid-gas '300.0 Tgas' --attached-deposit '1 yoctoNEAR' network-config testnet sign-with-legacy-keychain send

@FroVolod FroVolod marked this pull request as ready for review February 10, 2025 08:33
Copy link
Collaborator

@akorchyn akorchyn 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

hey, few comments

@@ -61,14 +57,6 @@ impl AmountFtContext {
ft_contract_account_id: previous_context.ft_contract_account_id,
receiver_account_id: previous_context.receiver_account_id,
ft_transfer_amount,
memo: scope.memo.as_ref().and_then(|s| {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer this to be honest, over custom type that is not needed yet in the end.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,41 @@
#[derive(Debug, Default, Clone)]
Copy link
Collaborator

@akorchyn akorchyn Feb 11, 2025

Choose a reason for hiding this comment

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

Do we really need this type? I think, it's a bit weird

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Deleted

@race-of-sloths
Copy link

race-of-sloths commented Feb 11, 2025

@FroVolod Thank you for your contribution! Your pull request is now a part of the Race of Sloths!
Do you want to apply for monthly streak? Get 8+ score for a single PR this month and receive boost for race-of-sloths!

Shows inviting banner with latest news.

Shows profile picture for the author of the PR

Current status: waiting for merge
Reviewer Score
@akorchyn 5

Your contribution is much appreciated with a final score of 5!
You have received 50 Sloth points for this contribution

@akorchyn received 25 Sloth Points for reviewing and scoring this pull request.

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths and receive a reward
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@FroVolod FroVolod marked this pull request as draft February 12, 2025 08:02
@FroVolod FroVolod marked this pull request as ready for review February 12, 2025 09:23
deposit: &crate::types::near_token::NearToken,
gas: &crate::common::NearGas,
) -> color_eyre::eyre::Result<crate::commands::PrepopulatedTransaction> {
let mut transfer_args = serde_json::Map::new();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you can just
serde_json::json! {
receiver_id: receiver_account_id,
memo: memo.and(...)
amount: ...
}

Would be easier to read

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@FroVolod FroVolod marked this pull request as draft February 14, 2025 19:07
@FroVolod FroVolod marked this pull request as ready for review February 14, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: NEW❗
Development

Successfully merging this pull request may close these issues.

3 participants