File tree Expand file tree Collapse file tree 2 files changed +2
-15
lines changed
snaps-sdk/src/types/handlers Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ import {
1717 CaipAccountIdStruct ,
1818 CaipAssetTypeOrIdStruct ,
1919 assert ,
20- hasProperty ,
2120 isObject ,
2221} from '@metamask/utils' ;
2322import type { CaipAssetTypeOrId } from '@metamask/utils' ;
@@ -80,11 +79,7 @@ export const NonFungibleAssetMetadataStruct = object({
8079} ) ;
8180
8281export const AssetMetadataStruct = selectiveUnion ( ( metadata ) => {
83- if ( ! isObject ( metadata ) || ! hasProperty ( metadata , 'fungible' ) ) {
84- return union ( [ FungibleAssetMetadataStruct , NonFungibleAssetMetadataStruct ] ) ;
85- }
86-
87- if ( metadata . fungible ) {
82+ if ( isObject ( metadata ) && metadata . fungible ) {
8883 return FungibleAssetMetadataStruct ;
8984 }
9085
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import {
1212import {
1313 CaipAssetTypeOrIdStruct ,
1414 CaipAssetTypeStruct ,
15- hasProperty ,
1615 isObject ,
1716} from '@metamask/utils' ;
1817
@@ -72,14 +71,7 @@ export const NonFungibleAssetMarketDataStruct = object({
7271 * A struct representing the market data for an asset, which can be either fungible or non-fungible.
7372 */
7473export const AssetMarketDataStruct = selectiveUnion ( ( marketData ) => {
75- if ( ! isObject ( marketData ) || ! hasProperty ( marketData , 'fungible' ) ) {
76- return union ( [
77- FungibleAssetMarketDataStruct ,
78- NonFungibleAssetMarketDataStruct ,
79- ] ) ;
80- }
81-
82- if ( marketData . fungible ) {
74+ if ( isObject ( marketData ) && marketData . fungible ) {
8375 return FungibleAssetMarketDataStruct ;
8476 }
8577
You can’t perform that action at this time.
0 commit comments