File tree Expand file tree Collapse file tree 5 files changed +11
-9
lines changed
snaps-controllers/src/snaps
snaps-sdk/src/types/handlers Expand file tree Collapse file tree 5 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 77 "url" : " https://github.com/MetaMask/snaps.git"
88 },
99 "source" : {
10- "shasum" : " GI7+exBM57/V+zc9afQYloOJkf31QC4QQ4J/FCjTkp0 =" ,
10+ "shasum" : " h2/tYCy6l8S2zP9EdqxHKc0WSftxxnkP60i8d58vbno =" ,
1111 "location" : {
1212 "npm" : {
1313 "filePath" : " dist/bundle.js" ,
Original file line number Diff line number Diff line change 77 "url" : " https://github.com/MetaMask/snaps.git"
88 },
99 "source" : {
10- "shasum" : " kVPM+Ft1gxNWF59oCgW0MRN1DuA7kVyXwIdMbGec3aI =" ,
10+ "shasum" : " 5mzSECxLy9lFHEwzmvRpjs0xL2TG0kTR2QXIjjavRTo =" ,
1111 "location" : {
1212 "npm" : {
1313 "filePath" : " dist/bundle.js" ,
Original file line number Diff line number Diff line change @@ -3689,7 +3689,7 @@ export class SnapController extends BaseController<
36893689 const { assets : requestedAssets } = requestedParams ;
36903690
36913691 const filteredAssets = Object . keys ( assets ) . reduce <
3692- Record < CaipAssetType , FungibleAssetMetadata >
3692+ Record < CaipAssetType , FungibleAssetMetadata | null >
36933693 > ( ( accumulator , assetType ) => {
36943694 const castAssetType = assetType as CaipAssetType ;
36953695 const isValid =
Original file line number Diff line number Diff line change 55 string ,
66 optional ,
77 record ,
8+ nullable ,
89} from '@metamask/superstruct' ;
910import { CaipAssetTypeStruct , type CaipAssetType } from '@metamask/utils' ;
1011
@@ -17,7 +18,7 @@ export const AssetConversionStruct = object({
1718export const OnAssetsConversionResponseStruct = object ( {
1819 conversionRates : record (
1920 CaipAssetTypeStruct ,
20- record ( CaipAssetTypeStruct , AssetConversionStruct ) ,
21+ record ( CaipAssetTypeStruct , nullable ( AssetConversionStruct ) ) ,
2122 ) ,
2223} ) ;
2324
@@ -40,11 +41,11 @@ export type OnAssetsConversionHandler = (
4041/**
4142 * The response from the conversion query, containing rates about each requested asset pair.
4243 *
43- * @property conversionRates - A nested object with two CAIP-19 keys that contains a conversion rate between the two keys.
44+ * @property conversionRates - A nested object with two CAIP-19 keys that contains a conversion rate or null between the two keys.
4445 */
4546export type OnAssetsConversionResponse = {
4647 conversionRates : Record <
4748 CaipAssetType ,
48- Record < CaipAssetType , AssetConversion >
49+ Record < CaipAssetType , AssetConversion | null >
4950 > ;
5051} ;
Original file line number Diff line number Diff line change 88 refine ,
99 string ,
1010 record ,
11+ nullable ,
1112} from '@metamask/superstruct' ;
1213import {
1314 assert ,
@@ -46,7 +47,7 @@ export const FungibleAssetMetadataStruct = object({
4647} ) ;
4748
4849export const OnAssetsLookupResponseStruct = object ( {
49- assets : record ( CaipAssetTypeStruct , FungibleAssetMetadataStruct ) ,
50+ assets : record ( CaipAssetTypeStruct , nullable ( FungibleAssetMetadataStruct ) ) ,
5051} ) ;
5152
5253export type FungibleAssetMetadata = Infer < typeof FungibleAssetMetadataStruct > ;
@@ -68,8 +69,8 @@ export type OnAssetsLookupHandler = (
6869/**
6970 * The response from the query, containing metadata about each requested asset.
7071 *
71- * @property assets - An object containing a mapping between the CAIP-19 key and a metadata object.
72+ * @property assets - An object containing a mapping between the CAIP-19 key and a metadata object or null .
7273 */
7374export type OnAssetsLookupResponse = {
74- assets : Record < CaipAssetType , FungibleAssetMetadata > ;
75+ assets : Record < CaipAssetType , FungibleAssetMetadata | null > ;
7576} ;
You can’t perform that action at this time.
0 commit comments