Skip to content

Commit 2655fa0

Browse files
committed
Update the structs
1 parent 37c6cb7 commit 2655fa0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/snaps-sdk/src/types/handlers/assets-conversion.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
string,
66
optional,
77
record,
8+
nullable,
89
} from '@metamask/superstruct';
910
import { CaipAssetTypeStruct, type CaipAssetType } from '@metamask/utils';
1011

@@ -17,7 +18,7 @@ export const AssetConversionStruct = object({
1718
export const OnAssetsConversionResponseStruct = object({
1819
conversionRates: record(
1920
CaipAssetTypeStruct,
20-
record(CaipAssetTypeStruct, AssetConversionStruct),
21+
record(CaipAssetTypeStruct, nullable(AssetConversionStruct)),
2122
),
2223
});
2324

packages/snaps-sdk/src/types/handlers/assets-lookup.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
refine,
99
string,
1010
record,
11+
nullable,
1112
} from '@metamask/superstruct';
1213
import {
1314
assert,
@@ -46,7 +47,7 @@ export const FungibleAssetMetadataStruct = object({
4647
});
4748

4849
export const OnAssetsLookupResponseStruct = object({
49-
assets: record(CaipAssetTypeStruct, FungibleAssetMetadataStruct),
50+
assets: record(CaipAssetTypeStruct, nullable(FungibleAssetMetadataStruct)),
5051
});
5152

5253
export type FungibleAssetMetadata = Infer<typeof FungibleAssetMetadataStruct>;

0 commit comments

Comments
 (0)