@explorins/pers-sdk-react-native 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -33483,10 +33483,16 @@ class Web3Manager {
|
|
|
33483
33483
|
const ownedTokens = token.type === NativeTokenTypes.ERC721
|
|
33484
33484
|
? collection.tokens
|
|
33485
33485
|
: collection.tokens.filter(t => t.hasBalance);
|
|
33486
|
+
// Calculate total owned:
|
|
33487
|
+
// - ERC-1155: sum balances (can own multiple copies of same tokenId)
|
|
33488
|
+
// - ERC-721: count unique tokens (each token is unique, balance always 1)
|
|
33489
|
+
const totalOwned = token.type === NativeTokenTypes.ERC1155
|
|
33490
|
+
? ownedTokens.reduce((sum, t) => sum + (t.balance || 0), 0)
|
|
33491
|
+
: ownedTokens.length;
|
|
33486
33492
|
return {
|
|
33487
33493
|
token,
|
|
33488
33494
|
ownedTokens,
|
|
33489
|
-
totalOwned
|
|
33495
|
+
totalOwned
|
|
33490
33496
|
};
|
|
33491
33497
|
}
|
|
33492
33498
|
/**
|