-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(nft): db implementation (wasm target) #1877
Conversation
Can you clarify this problem? Is it fixed? What's the actual problem behind it, primary key conflicts? |
Its not the problem, I just added the case when user sends erc721 token to themself in |
@ozkanonur @borngraced do you have any more comments/reviews regarding this PR? If not, I guess I can merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the previous fixes.
Some more notes and questions from my side
mm2src/coins/nft.rs
Outdated
let tx_meta = TxMeta { | ||
token_address: nft_db.token_address, | ||
token_id: nft_db.token_id, | ||
token_uri: nft_db.token_uri, | ||
collection_name: nft_db.collection_name, | ||
image_url: nft_db.uri_meta.image_url, | ||
token_name: nft_db.uri_meta.token_name, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this block is duplicated frequently, implementing From
trait on this would be useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
1ed555e
to
3defed0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
#900
IndexedDb support
db tests
handle the ipfs moralis links with bafy hash:
check_moralis_ipfs_bafy
function. it checks for ipfs moralis links whose hash starts withbafy
. If it does, then we need to use a different gateway (e.g.ipfs.io
) to handle those links. Iftoken_uri
,image
oranimation_url
contain such link, then we change it tohttps://ipfs.io/ipfs/
(related to)get
UriMeta
fromtoken_uri
and frommetadata
:get_uri_meta
function. it tries to geturi meta
fromtoken_uri
, then tries to geturi meta
frommetadata
field, then merges it intouri meta
fromtoken_uri
. As a result it is more likely thatimage
link will be not null. We use the resulting UriMeta for both NFT and history (related to)protect_from_spam
feature.If
protect_from_spam
param istrue
inget_nft_list
,get_nft_metadata
,get_nft_transfers
reqs, then we will search urls in fields likecollection_name
,token_name
,symbol
. if they have it, then the text in these parameters will be replaced byURL redacted for user protection
, andpossible_spam
inNft
orNftTransferHistory
structures will betrue
Dependencies added
regex = "1" in mm2src/coins/Cargo.toml