Skip to content

Commit 4581180

Browse files
authored
Merge pull request #26 from getsafle/feature-return-nft-standard
2 parents 92b5856 + 5ada678 commit 4581180

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@
4141

4242
### 2.2.3 (2023-01-30)
4343

44-
* The response structure for `detectNFTs()` function has been updated for nftport API response.
44+
* The response structure for `detectNFTs()` function has been updated for nftport API response.
45+
46+
### 2.2.4 (2023-05-02)
47+
48+
* Returned flag `isERC721` in the response

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@getsafle/nft-controller",
3-
"version": "2.2.3",
3+
"version": "2.2.4",
44
"description": "Library to enable detection of Non Fungible Tokens (NFT) for any public address across the supported chains.",
55
"main": "src/index.js",
66
"scripts": {
@@ -11,7 +11,7 @@
1111
"url": "https://github.com/getsafle/nft-controller/"
1212
},
1313
"author": "",
14-
"license": "ISC",
14+
"license": "MIT",
1515
"homepage": "https://github.com/getsafle/nft-controller#readme",
1616
"dependencies": {
1717
"axios": "^0.21.1"

src/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,13 @@ class NftController {
5454
asset.contractAddress || asset.tokenAddress || asset.contract_address || asset.token_address : asset.contract?.contractAddress || asset.contract?.tokenAddress || asset.contract?.contract_address || asset.contract?.token_address
5555
obj.metadata = asset.metadata ? asset.metadata : asset.contract?.metadata;
5656
obj.chainId = asset.chainId ? asset.chainId : asset.contract?.chainId;
57-
58-
array.push(obj);
57+
if(asset.isErc721!=null || asset.isErc721!= undefined){
58+
obj.isErc721 = asset.isErc721;
59+
}
60+
else{
61+
obj.isErc721 = asset.contract?.isErc721;
62+
}
63+
array.push(obj)
5964
}
6065
};
6166

0 commit comments

Comments
 (0)