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: fix near-contract-standards event emission #374

Closed
wants to merge 1 commit into from

Conversation

nujabes403
Copy link
Contributor

Pre-flight checklist

  • [V] I have read the Contributing Guidelines on pull requests.
  • [V] 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

fungible token, non fungible token contracts in near-contract-standards folder doesn't emit nep141 & nep171 event.
image

It seems that the code found in the near-contract-standards folder attempts to directly convert near-sdk-rs contracts to TypeScript. However, since it disregards Rust's serde tags and related annotations, there is an issue when emitting events through this contract code, as it doesn't properly track them as nep141 or nep171 events.

Test Plan

Related issues/PRs

@@ -16,17 +16,22 @@
import { AccountId } from "near-sdk-js";
import { NearEvent } from "../event";
import { TokenId } from "./token";
import { toSnakeCase } from "../util";

export type Nep171EventKind = NftMint[] | NftTransfer[] | NftBurn[];
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also add the event typf of ContractMetadataUpdate: https://nomicon.io/Standards/Tokens/NonFungibleToken/Event#interface

@fospring
Copy link
Contributor

@nujabes403 ci task failed, pls update it if you have time

@fospring
Copy link
Contributor

Hi @nujabes403, I create a MR which contains your commits: #384

@fospring
Copy link
Contributor

the related MR merged, so I will close this MR

@fospring fospring closed this Mar 18, 2024
@nujabes403
Copy link
Contributor Author

the related MR merged, so I will close this MR

Great, thanks!

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.

2 participants