@metamask/snaps-sdk 6.21.0 → 6.22.0

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.
Files changed (158) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/dist/error-wrappers.d.cts +192 -192
  3. package/dist/error-wrappers.d.mts +192 -192
  4. package/dist/images.d.cts +1 -1
  5. package/dist/images.d.mts +1 -1
  6. package/dist/index.cjs +2 -1
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.cts +1 -1
  9. package/dist/index.d.cts.map +1 -1
  10. package/dist/index.d.mts +1 -1
  11. package/dist/index.d.mts.map +1 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/internals/error-wrappers.d.cts +12 -12
  15. package/dist/internals/error-wrappers.d.mts +12 -12
  16. package/dist/internals/structs.cjs +29 -8
  17. package/dist/internals/structs.cjs.map +1 -1
  18. package/dist/internals/structs.d.cts +8 -0
  19. package/dist/internals/structs.d.cts.map +1 -1
  20. package/dist/internals/structs.d.mts +8 -0
  21. package/dist/internals/structs.d.mts.map +1 -1
  22. package/dist/internals/structs.mjs +29 -9
  23. package/dist/internals/structs.mjs.map +1 -1
  24. package/dist/jsx/validation.cjs +8 -5
  25. package/dist/jsx/validation.cjs.map +1 -1
  26. package/dist/jsx/validation.d.cts +15 -15
  27. package/dist/jsx/validation.d.cts.map +1 -1
  28. package/dist/jsx/validation.d.mts +15 -15
  29. package/dist/jsx/validation.d.mts.map +1 -1
  30. package/dist/jsx/validation.mjs +8 -5
  31. package/dist/jsx/validation.mjs.map +1 -1
  32. package/dist/types/handlers/asset-historical-price.cjs +3 -0
  33. package/dist/types/handlers/asset-historical-price.cjs.map +1 -0
  34. package/dist/types/handlers/asset-historical-price.d.cts +46 -0
  35. package/dist/types/handlers/asset-historical-price.d.cts.map +1 -0
  36. package/dist/types/handlers/asset-historical-price.d.mts +46 -0
  37. package/dist/types/handlers/asset-historical-price.d.mts.map +1 -0
  38. package/dist/types/handlers/asset-historical-price.mjs +2 -0
  39. package/dist/types/handlers/asset-historical-price.mjs.map +1 -0
  40. package/dist/types/handlers/assets-conversion.cjs +0 -11
  41. package/dist/types/handlers/assets-conversion.cjs.map +1 -1
  42. package/dist/types/handlers/assets-conversion.d.cts +43 -22
  43. package/dist/types/handlers/assets-conversion.d.cts.map +1 -1
  44. package/dist/types/handlers/assets-conversion.d.mts +43 -22
  45. package/dist/types/handlers/assets-conversion.d.mts.map +1 -1
  46. package/dist/types/handlers/assets-conversion.mjs +1 -10
  47. package/dist/types/handlers/assets-conversion.mjs.map +1 -1
  48. package/dist/types/handlers/assets-lookup.cjs +4 -4
  49. package/dist/types/handlers/assets-lookup.cjs.map +1 -1
  50. package/dist/types/handlers/assets-lookup.d.cts +24 -24
  51. package/dist/types/handlers/assets-lookup.d.cts.map +1 -1
  52. package/dist/types/handlers/assets-lookup.d.mts +24 -24
  53. package/dist/types/handlers/assets-lookup.d.mts.map +1 -1
  54. package/dist/types/handlers/assets-lookup.mjs +5 -5
  55. package/dist/types/handlers/assets-lookup.mjs.map +1 -1
  56. package/dist/types/handlers/index.cjs +0 -1
  57. package/dist/types/handlers/index.cjs.map +1 -1
  58. package/dist/types/handlers/index.d.cts +2 -1
  59. package/dist/types/handlers/index.d.cts.map +1 -1
  60. package/dist/types/handlers/index.d.mts +2 -1
  61. package/dist/types/handlers/index.d.mts.map +1 -1
  62. package/dist/types/handlers/index.mjs +0 -1
  63. package/dist/types/handlers/index.mjs.map +1 -1
  64. package/dist/types/handlers/user-input.d.cts +10 -10
  65. package/dist/types/handlers/user-input.d.mts +10 -10
  66. package/dist/types/interface.d.cts +21 -21
  67. package/dist/types/interface.d.mts +21 -21
  68. package/dist/ui/components/address.cjs +2 -1
  69. package/dist/ui/components/address.cjs.map +1 -1
  70. package/dist/ui/components/address.d.cts +4 -4
  71. package/dist/ui/components/address.d.cts.map +1 -1
  72. package/dist/ui/components/address.d.mts +4 -4
  73. package/dist/ui/components/address.d.mts.map +1 -1
  74. package/dist/ui/components/address.mjs +2 -1
  75. package/dist/ui/components/address.mjs.map +1 -1
  76. package/dist/ui/components/button.cjs +1 -1
  77. package/dist/ui/components/button.cjs.map +1 -1
  78. package/dist/ui/components/button.d.cts +7 -7
  79. package/dist/ui/components/button.d.cts.map +1 -1
  80. package/dist/ui/components/button.d.mts +7 -7
  81. package/dist/ui/components/button.d.mts.map +1 -1
  82. package/dist/ui/components/button.mjs +2 -2
  83. package/dist/ui/components/button.mjs.map +1 -1
  84. package/dist/ui/components/copyable.cjs +2 -1
  85. package/dist/ui/components/copyable.cjs.map +1 -1
  86. package/dist/ui/components/copyable.d.cts +4 -4
  87. package/dist/ui/components/copyable.d.mts +4 -4
  88. package/dist/ui/components/copyable.mjs +2 -1
  89. package/dist/ui/components/copyable.mjs.map +1 -1
  90. package/dist/ui/components/divider.cjs +2 -1
  91. package/dist/ui/components/divider.cjs.map +1 -1
  92. package/dist/ui/components/divider.d.cts +1 -1
  93. package/dist/ui/components/divider.d.cts.map +1 -1
  94. package/dist/ui/components/divider.d.mts +1 -1
  95. package/dist/ui/components/divider.d.mts.map +1 -1
  96. package/dist/ui/components/divider.mjs +2 -1
  97. package/dist/ui/components/divider.mjs.map +1 -1
  98. package/dist/ui/components/form.cjs +2 -1
  99. package/dist/ui/components/form.cjs.map +1 -1
  100. package/dist/ui/components/form.d.cts +39 -39
  101. package/dist/ui/components/form.d.cts.map +1 -1
  102. package/dist/ui/components/form.d.mts +39 -39
  103. package/dist/ui/components/form.d.mts.map +1 -1
  104. package/dist/ui/components/form.mjs +2 -1
  105. package/dist/ui/components/form.mjs.map +1 -1
  106. package/dist/ui/components/heading.cjs +2 -1
  107. package/dist/ui/components/heading.cjs.map +1 -1
  108. package/dist/ui/components/heading.d.cts +4 -4
  109. package/dist/ui/components/heading.d.cts.map +1 -1
  110. package/dist/ui/components/heading.d.mts +4 -4
  111. package/dist/ui/components/heading.d.mts.map +1 -1
  112. package/dist/ui/components/heading.mjs +2 -1
  113. package/dist/ui/components/heading.mjs.map +1 -1
  114. package/dist/ui/components/image.cjs +1 -1
  115. package/dist/ui/components/image.cjs.map +1 -1
  116. package/dist/ui/components/image.d.cts +4 -4
  117. package/dist/ui/components/image.d.mts +4 -4
  118. package/dist/ui/components/image.mjs +2 -2
  119. package/dist/ui/components/image.mjs.map +1 -1
  120. package/dist/ui/components/input.cjs +1 -1
  121. package/dist/ui/components/input.cjs.map +1 -1
  122. package/dist/ui/components/input.d.cts +10 -10
  123. package/dist/ui/components/input.d.cts.map +1 -1
  124. package/dist/ui/components/input.d.mts +10 -10
  125. package/dist/ui/components/input.d.mts.map +1 -1
  126. package/dist/ui/components/input.mjs +2 -2
  127. package/dist/ui/components/input.mjs.map +1 -1
  128. package/dist/ui/components/panel.cjs +1 -1
  129. package/dist/ui/components/panel.cjs.map +1 -1
  130. package/dist/ui/components/panel.d.cts +105 -105
  131. package/dist/ui/components/panel.d.mts +105 -105
  132. package/dist/ui/components/panel.mjs +2 -2
  133. package/dist/ui/components/panel.mjs.map +1 -1
  134. package/dist/ui/components/row.cjs +1 -1
  135. package/dist/ui/components/row.cjs.map +1 -1
  136. package/dist/ui/components/row.d.cts +23 -23
  137. package/dist/ui/components/row.d.cts.map +1 -1
  138. package/dist/ui/components/row.d.mts +23 -23
  139. package/dist/ui/components/row.d.mts.map +1 -1
  140. package/dist/ui/components/row.mjs +2 -2
  141. package/dist/ui/components/row.mjs.map +1 -1
  142. package/dist/ui/components/spinner.cjs +2 -1
  143. package/dist/ui/components/spinner.cjs.map +1 -1
  144. package/dist/ui/components/spinner.d.cts +1 -1
  145. package/dist/ui/components/spinner.d.cts.map +1 -1
  146. package/dist/ui/components/spinner.d.mts +1 -1
  147. package/dist/ui/components/spinner.d.mts.map +1 -1
  148. package/dist/ui/components/spinner.mjs +2 -1
  149. package/dist/ui/components/spinner.mjs.map +1 -1
  150. package/dist/ui/components/text.cjs +2 -1
  151. package/dist/ui/components/text.cjs.map +1 -1
  152. package/dist/ui/components/text.d.cts +4 -4
  153. package/dist/ui/components/text.d.mts +4 -4
  154. package/dist/ui/components/text.mjs +2 -1
  155. package/dist/ui/components/text.mjs.map +1 -1
  156. package/dist/ui/nodes.d.cts +1 -1
  157. package/dist/ui/nodes.d.mts +1 -1
  158. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"assets-lookup.cjs","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":";;;AACA,uDAU+B;AAC/B,2CAIyB;AAEZ,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IAC5C,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,MAAM,EAAE,IAAA,oBAAM,GAAE;IAChB,QAAQ,EAAE,IAAA,oBAAM,GAAE;CACnB,CAAC,CAAC;AAIU,QAAA,kBAAkB,GAAG,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;IACxE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,+EAA+E;QAC/E,IAAA,cAAM,EACJ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YACvB,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC,CACjD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,IAAI,EAAE,IAAA,oBAAM,GAAE;IACd,MAAM,EAAE,IAAA,oBAAM,GAAE;IAChB,QAAQ,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC;IACvB,OAAO,EAAE,0BAAkB;IAC3B,KAAK,EAAE,IAAA,kBAAI,EAAC,IAAA,mBAAK,EAAC,+BAAuB,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACzD,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC,2BAAmB,EAAE,IAAA,sBAAQ,EAAC,mCAA2B,CAAC,CAAC;CAC3E,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n size,\n literal,\n number,\n object,\n refine,\n string,\n record,\n nullable,\n} from '@metamask/superstruct';\nimport {\n assert,\n CaipAssetTypeStruct,\n type CaipAssetType,\n} from '@metamask/utils';\n\nexport const FungibleAssetUnitStruct = object({\n name: string(),\n symbol: string(),\n decimals: number(),\n});\n\nexport type FungibleAssetUnit = Infer<typeof FungibleAssetUnitStruct>;\n\nexport const AssetIconUrlStruct = refine(string(), 'Asset URL', (value) => {\n try {\n const url = new URL(value);\n // For now, we require asset URLs to either be base64 SVGs or remote HTTPS URLs\n assert(\n url.protocol === 'https:' ||\n value.startsWith('data:image/svg+xml;base64,'),\n );\n return true;\n } catch {\n return 'Invalid URL';\n }\n});\n\nexport const FungibleAssetMetadataStruct = object({\n name: string(),\n symbol: string(),\n fungible: literal(true),\n iconUrl: AssetIconUrlStruct,\n units: size(array(FungibleAssetUnitStruct), 1, Infinity),\n});\n\nexport const OnAssetsLookupResponseStruct = object({\n assets: record(CaipAssetTypeStruct, nullable(FungibleAssetMetadataStruct)),\n});\n\nexport type FungibleAssetMetadata = Infer<typeof FungibleAssetMetadataStruct>;\n\nexport type OnAssetsLookupArguments = {\n assets: CaipAssetType[];\n};\n\n/**\n * The `onAssetsLookup` handler. This is called by MetaMask when querying about specific assets on specific chains.\n *\n * @returns The metadata about each asset. See\n * {@link OnAssetsLookupResponse}.\n */\nexport type OnAssetsLookupHandler = (\n args: OnAssetsLookupArguments,\n) => Promise<OnAssetsLookupResponse>;\n\n/**\n * The response from the query, containing metadata about each requested asset.\n *\n * @property assets - An object containing a mapping between the CAIP-19 key and a metadata object or null.\n */\nexport type OnAssetsLookupResponse = {\n assets: Record<CaipAssetType, FungibleAssetMetadata | null>;\n};\n"]}
1
+ {"version":3,"file":"assets-lookup.cjs","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":";;;AACA,uDAW+B;AAC/B,2CAIyB;AAEZ,QAAA,uBAAuB,GAAG,IAAA,oBAAM,EAAC;IAC5C,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IACxB,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC1B,QAAQ,EAAE,IAAA,oBAAM,GAAE;CACnB,CAAC,CAAC;AAIU,QAAA,kBAAkB,GAAG,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;IACxE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,+EAA+E;QAC/E,IAAA,cAAM,EACJ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YACvB,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC,CACjD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,oBAAM,EAAC;IAChD,IAAI,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IACxB,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC1B,QAAQ,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC;IACvB,OAAO,EAAE,0BAAkB;IAC3B,KAAK,EAAE,IAAA,kBAAI,EAAC,IAAA,mBAAK,EAAC,+BAAuB,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACzD,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC,2BAAmB,EAAE,IAAA,sBAAQ,EAAC,mCAA2B,CAAC,CAAC;CAC3E,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n size,\n literal,\n number,\n object,\n refine,\n string,\n record,\n nullable,\n optional,\n} from '@metamask/superstruct';\nimport {\n assert,\n CaipAssetTypeStruct,\n type CaipAssetType,\n} from '@metamask/utils';\n\nexport const FungibleAssetUnitStruct = object({\n name: optional(string()),\n symbol: optional(string()),\n decimals: number(),\n});\n\nexport type FungibleAssetUnit = Infer<typeof FungibleAssetUnitStruct>;\n\nexport const AssetIconUrlStruct = refine(string(), 'Asset URL', (value) => {\n try {\n const url = new URL(value);\n // For now, we require asset URLs to either be base64 SVGs or remote HTTPS URLs\n assert(\n url.protocol === 'https:' ||\n value.startsWith('data:image/svg+xml;base64,'),\n );\n return true;\n } catch {\n return 'Invalid URL';\n }\n});\n\nexport const FungibleAssetMetadataStruct = object({\n name: optional(string()),\n symbol: optional(string()),\n fungible: literal(true),\n iconUrl: AssetIconUrlStruct,\n units: size(array(FungibleAssetUnitStruct), 1, Infinity),\n});\n\nexport const OnAssetsLookupResponseStruct = object({\n assets: record(CaipAssetTypeStruct, nullable(FungibleAssetMetadataStruct)),\n});\n\nexport type FungibleAssetMetadata = Infer<typeof FungibleAssetMetadataStruct>;\n\nexport type OnAssetsLookupArguments = {\n assets: CaipAssetType[];\n};\n\n/**\n * The `onAssetsLookup` handler. This is called by MetaMask when querying about specific assets on specific chains.\n *\n * @returns The metadata about each asset. See\n * {@link OnAssetsLookupResponse}.\n */\nexport type OnAssetsLookupHandler = (\n args: OnAssetsLookupArguments,\n) => Promise<OnAssetsLookupResponse>;\n\n/**\n * The response from the query, containing metadata about each requested asset.\n *\n * @property assets - An object containing a mapping between the CAIP-19 key and a metadata object or null.\n */\nexport type OnAssetsLookupResponse = {\n assets: Record<CaipAssetType, FungibleAssetMetadata | null>;\n};\n"]}
@@ -1,68 +1,68 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  import { type CaipAssetType } from "@metamask/utils";
3
3
  export declare const FungibleAssetUnitStruct: import("@metamask/superstruct").Struct<{
4
- symbol: string;
5
- name: string;
6
4
  decimals: number;
5
+ symbol?: string | undefined;
6
+ name?: string | undefined;
7
7
  }, {
8
- name: import("@metamask/superstruct").Struct<string, null>;
9
- symbol: import("@metamask/superstruct").Struct<string, null>;
8
+ name: import("@metamask/superstruct").Struct<string | undefined, null>;
9
+ symbol: import("@metamask/superstruct").Struct<string | undefined, null>;
10
10
  decimals: import("@metamask/superstruct").Struct<number, null>;
11
11
  }>;
12
12
  export type FungibleAssetUnit = Infer<typeof FungibleAssetUnitStruct>;
13
13
  export declare const AssetIconUrlStruct: import("@metamask/superstruct").Struct<string, null>;
14
14
  export declare const FungibleAssetMetadataStruct: import("@metamask/superstruct").Struct<{
15
- symbol: string;
16
- name: string;
17
15
  fungible: true;
18
16
  iconUrl: string;
19
17
  units: {
20
- symbol: string;
21
- name: string;
22
18
  decimals: number;
19
+ symbol?: string | undefined;
20
+ name?: string | undefined;
23
21
  }[];
22
+ symbol?: string | undefined;
23
+ name?: string | undefined;
24
24
  }, {
25
- name: import("@metamask/superstruct").Struct<string, null>;
26
- symbol: import("@metamask/superstruct").Struct<string, null>;
25
+ name: import("@metamask/superstruct").Struct<string | undefined, null>;
26
+ symbol: import("@metamask/superstruct").Struct<string | undefined, null>;
27
27
  fungible: import("@metamask/superstruct").Struct<true, true>;
28
28
  iconUrl: import("@metamask/superstruct").Struct<string, null>;
29
29
  units: import("@metamask/superstruct").Struct<{
30
- symbol: string;
31
- name: string;
32
30
  decimals: number;
31
+ symbol?: string | undefined;
32
+ name?: string | undefined;
33
33
  }[], import("@metamask/superstruct").Struct<{
34
- symbol: string;
35
- name: string;
36
34
  decimals: number;
35
+ symbol?: string | undefined;
36
+ name?: string | undefined;
37
37
  }, {
38
- name: import("@metamask/superstruct").Struct<string, null>;
39
- symbol: import("@metamask/superstruct").Struct<string, null>;
38
+ name: import("@metamask/superstruct").Struct<string | undefined, null>;
39
+ symbol: import("@metamask/superstruct").Struct<string | undefined, null>;
40
40
  decimals: import("@metamask/superstruct").Struct<number, null>;
41
41
  }>>;
42
42
  }>;
43
43
  export declare const OnAssetsLookupResponseStruct: import("@metamask/superstruct").Struct<{
44
44
  assets: Record<`${string}:${string}/${string}:${string}`, {
45
- symbol: string;
46
- name: string;
47
45
  fungible: true;
48
46
  iconUrl: string;
49
47
  units: {
50
- symbol: string;
51
- name: string;
52
48
  decimals: number;
49
+ symbol?: string | undefined;
50
+ name?: string | undefined;
53
51
  }[];
52
+ symbol?: string | undefined;
53
+ name?: string | undefined;
54
54
  } | null>;
55
55
  }, {
56
56
  assets: import("@metamask/superstruct").Struct<Record<`${string}:${string}/${string}:${string}`, {
57
- symbol: string;
58
- name: string;
59
57
  fungible: true;
60
58
  iconUrl: string;
61
59
  units: {
62
- symbol: string;
63
- name: string;
64
60
  decimals: number;
61
+ symbol?: string | undefined;
62
+ name?: string | undefined;
65
63
  }[];
64
+ symbol?: string | undefined;
65
+ name?: string | undefined;
66
66
  } | null>, null>;
67
67
  }>;
68
68
  export type FungibleAssetMetadata = Infer<typeof FungibleAssetMetadataStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"assets-lookup.d.cts","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAYnD,OAAO,EAGL,KAAK,aAAa,EACnB,wBAAwB;AAEzB,eAAO,MAAM,uBAAuB;;;;;;;;EAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,sDAY7B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE,uBAAuB,KAC1B,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC7D,CAAC"}
1
+ {"version":3,"file":"assets-lookup.d.cts","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAanD,OAAO,EAGL,KAAK,aAAa,EACnB,wBAAwB;AAEzB,eAAO,MAAM,uBAAuB;;;;;;;;EAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,sDAY7B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE,uBAAuB,KAC1B,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC7D,CAAC"}
@@ -1,68 +1,68 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
2
  import { type CaipAssetType } from "@metamask/utils";
3
3
  export declare const FungibleAssetUnitStruct: import("@metamask/superstruct").Struct<{
4
- symbol: string;
5
- name: string;
6
4
  decimals: number;
5
+ symbol?: string | undefined;
6
+ name?: string | undefined;
7
7
  }, {
8
- name: import("@metamask/superstruct").Struct<string, null>;
9
- symbol: import("@metamask/superstruct").Struct<string, null>;
8
+ name: import("@metamask/superstruct").Struct<string | undefined, null>;
9
+ symbol: import("@metamask/superstruct").Struct<string | undefined, null>;
10
10
  decimals: import("@metamask/superstruct").Struct<number, null>;
11
11
  }>;
12
12
  export type FungibleAssetUnit = Infer<typeof FungibleAssetUnitStruct>;
13
13
  export declare const AssetIconUrlStruct: import("@metamask/superstruct").Struct<string, null>;
14
14
  export declare const FungibleAssetMetadataStruct: import("@metamask/superstruct").Struct<{
15
- symbol: string;
16
- name: string;
17
15
  fungible: true;
18
16
  iconUrl: string;
19
17
  units: {
20
- symbol: string;
21
- name: string;
22
18
  decimals: number;
19
+ symbol?: string | undefined;
20
+ name?: string | undefined;
23
21
  }[];
22
+ symbol?: string | undefined;
23
+ name?: string | undefined;
24
24
  }, {
25
- name: import("@metamask/superstruct").Struct<string, null>;
26
- symbol: import("@metamask/superstruct").Struct<string, null>;
25
+ name: import("@metamask/superstruct").Struct<string | undefined, null>;
26
+ symbol: import("@metamask/superstruct").Struct<string | undefined, null>;
27
27
  fungible: import("@metamask/superstruct").Struct<true, true>;
28
28
  iconUrl: import("@metamask/superstruct").Struct<string, null>;
29
29
  units: import("@metamask/superstruct").Struct<{
30
- symbol: string;
31
- name: string;
32
30
  decimals: number;
31
+ symbol?: string | undefined;
32
+ name?: string | undefined;
33
33
  }[], import("@metamask/superstruct").Struct<{
34
- symbol: string;
35
- name: string;
36
34
  decimals: number;
35
+ symbol?: string | undefined;
36
+ name?: string | undefined;
37
37
  }, {
38
- name: import("@metamask/superstruct").Struct<string, null>;
39
- symbol: import("@metamask/superstruct").Struct<string, null>;
38
+ name: import("@metamask/superstruct").Struct<string | undefined, null>;
39
+ symbol: import("@metamask/superstruct").Struct<string | undefined, null>;
40
40
  decimals: import("@metamask/superstruct").Struct<number, null>;
41
41
  }>>;
42
42
  }>;
43
43
  export declare const OnAssetsLookupResponseStruct: import("@metamask/superstruct").Struct<{
44
44
  assets: Record<`${string}:${string}/${string}:${string}`, {
45
- symbol: string;
46
- name: string;
47
45
  fungible: true;
48
46
  iconUrl: string;
49
47
  units: {
50
- symbol: string;
51
- name: string;
52
48
  decimals: number;
49
+ symbol?: string | undefined;
50
+ name?: string | undefined;
53
51
  }[];
52
+ symbol?: string | undefined;
53
+ name?: string | undefined;
54
54
  } | null>;
55
55
  }, {
56
56
  assets: import("@metamask/superstruct").Struct<Record<`${string}:${string}/${string}:${string}`, {
57
- symbol: string;
58
- name: string;
59
57
  fungible: true;
60
58
  iconUrl: string;
61
59
  units: {
62
- symbol: string;
63
- name: string;
64
60
  decimals: number;
61
+ symbol?: string | undefined;
62
+ name?: string | undefined;
65
63
  }[];
64
+ symbol?: string | undefined;
65
+ name?: string | undefined;
66
66
  } | null>, null>;
67
67
  }>;
68
68
  export type FungibleAssetMetadata = Infer<typeof FungibleAssetMetadataStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"assets-lookup.d.mts","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAYnD,OAAO,EAGL,KAAK,aAAa,EACnB,wBAAwB;AAEzB,eAAO,MAAM,uBAAuB;;;;;;;;EAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,sDAY7B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE,uBAAuB,KAC1B,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC7D,CAAC"}
1
+ {"version":3,"file":"assets-lookup.d.mts","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAanD,OAAO,EAGL,KAAK,aAAa,EACnB,wBAAwB;AAEzB,eAAO,MAAM,uBAAuB;;;;;;;;EAIlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,sDAY7B,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;EAEvC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,aAAa,EAAE,CAAC;CACzB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,IAAI,EAAE,uBAAuB,KAC1B,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC7D,CAAC"}
@@ -1,8 +1,8 @@
1
- import { array, size, literal, number, object, refine, string, record, nullable } from "@metamask/superstruct";
1
+ import { array, size, literal, number, object, refine, string, record, nullable, optional } from "@metamask/superstruct";
2
2
  import { assert, CaipAssetTypeStruct } from "@metamask/utils";
3
3
  export const FungibleAssetUnitStruct = object({
4
- name: string(),
5
- symbol: string(),
4
+ name: optional(string()),
5
+ symbol: optional(string()),
6
6
  decimals: number(),
7
7
  });
8
8
  export const AssetIconUrlStruct = refine(string(), 'Asset URL', (value) => {
@@ -18,8 +18,8 @@ export const AssetIconUrlStruct = refine(string(), 'Asset URL', (value) => {
18
18
  }
19
19
  });
20
20
  export const FungibleAssetMetadataStruct = object({
21
- name: string(),
22
- symbol: string(),
21
+ name: optional(string()),
22
+ symbol: optional(string()),
23
23
  fungible: literal(true),
24
24
  iconUrl: AssetIconUrlStruct,
25
25
  units: size(array(FungibleAssetUnitStruct), 1, Infinity),
@@ -1 +1 @@
1
- {"version":3,"file":"assets-lookup.mjs","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACT,8BAA8B;AAC/B,OAAO,EACL,MAAM,EACN,mBAAmB,EAEpB,wBAAwB;AAEzB,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;IAC5C,IAAI,EAAE,MAAM,EAAE;IACd,MAAM,EAAE,MAAM,EAAE;IAChB,QAAQ,EAAE,MAAM,EAAE;CACnB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;IACxE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,+EAA+E;QAC/E,MAAM,CACJ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YACvB,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC,CACjD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,IAAI,EAAE,MAAM,EAAE;IACd,MAAM,EAAE,MAAM,EAAE;IAChB,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;IACvB,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC,mBAAmB,EAAE,QAAQ,CAAC,2BAA2B,CAAC,CAAC;CAC3E,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n size,\n literal,\n number,\n object,\n refine,\n string,\n record,\n nullable,\n} from '@metamask/superstruct';\nimport {\n assert,\n CaipAssetTypeStruct,\n type CaipAssetType,\n} from '@metamask/utils';\n\nexport const FungibleAssetUnitStruct = object({\n name: string(),\n symbol: string(),\n decimals: number(),\n});\n\nexport type FungibleAssetUnit = Infer<typeof FungibleAssetUnitStruct>;\n\nexport const AssetIconUrlStruct = refine(string(), 'Asset URL', (value) => {\n try {\n const url = new URL(value);\n // For now, we require asset URLs to either be base64 SVGs or remote HTTPS URLs\n assert(\n url.protocol === 'https:' ||\n value.startsWith('data:image/svg+xml;base64,'),\n );\n return true;\n } catch {\n return 'Invalid URL';\n }\n});\n\nexport const FungibleAssetMetadataStruct = object({\n name: string(),\n symbol: string(),\n fungible: literal(true),\n iconUrl: AssetIconUrlStruct,\n units: size(array(FungibleAssetUnitStruct), 1, Infinity),\n});\n\nexport const OnAssetsLookupResponseStruct = object({\n assets: record(CaipAssetTypeStruct, nullable(FungibleAssetMetadataStruct)),\n});\n\nexport type FungibleAssetMetadata = Infer<typeof FungibleAssetMetadataStruct>;\n\nexport type OnAssetsLookupArguments = {\n assets: CaipAssetType[];\n};\n\n/**\n * The `onAssetsLookup` handler. This is called by MetaMask when querying about specific assets on specific chains.\n *\n * @returns The metadata about each asset. See\n * {@link OnAssetsLookupResponse}.\n */\nexport type OnAssetsLookupHandler = (\n args: OnAssetsLookupArguments,\n) => Promise<OnAssetsLookupResponse>;\n\n/**\n * The response from the query, containing metadata about each requested asset.\n *\n * @property assets - An object containing a mapping between the CAIP-19 key and a metadata object or null.\n */\nexport type OnAssetsLookupResponse = {\n assets: Record<CaipAssetType, FungibleAssetMetadata | null>;\n};\n"]}
1
+ {"version":3,"file":"assets-lookup.mjs","sourceRoot":"","sources":["../../../src/types/handlers/assets-lookup.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,QAAQ,EACT,8BAA8B;AAC/B,OAAO,EACL,MAAM,EACN,mBAAmB,EAEpB,wBAAwB;AAEzB,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC;IAC5C,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE;CACnB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;IACxE,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,+EAA+E;QAC/E,MAAM,CACJ,GAAG,CAAC,QAAQ,KAAK,QAAQ;YACvB,KAAK,CAAC,UAAU,CAAC,4BAA4B,CAAC,CACjD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,aAAa,CAAC;IACvB,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC;IACvB,OAAO,EAAE,kBAAkB;IAC3B,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC,mBAAmB,EAAE,QAAQ,CAAC,2BAA2B,CAAC,CAAC;CAC3E,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport {\n array,\n size,\n literal,\n number,\n object,\n refine,\n string,\n record,\n nullable,\n optional,\n} from '@metamask/superstruct';\nimport {\n assert,\n CaipAssetTypeStruct,\n type CaipAssetType,\n} from '@metamask/utils';\n\nexport const FungibleAssetUnitStruct = object({\n name: optional(string()),\n symbol: optional(string()),\n decimals: number(),\n});\n\nexport type FungibleAssetUnit = Infer<typeof FungibleAssetUnitStruct>;\n\nexport const AssetIconUrlStruct = refine(string(), 'Asset URL', (value) => {\n try {\n const url = new URL(value);\n // For now, we require asset URLs to either be base64 SVGs or remote HTTPS URLs\n assert(\n url.protocol === 'https:' ||\n value.startsWith('data:image/svg+xml;base64,'),\n );\n return true;\n } catch {\n return 'Invalid URL';\n }\n});\n\nexport const FungibleAssetMetadataStruct = object({\n name: optional(string()),\n symbol: optional(string()),\n fungible: literal(true),\n iconUrl: AssetIconUrlStruct,\n units: size(array(FungibleAssetUnitStruct), 1, Infinity),\n});\n\nexport const OnAssetsLookupResponseStruct = object({\n assets: record(CaipAssetTypeStruct, nullable(FungibleAssetMetadataStruct)),\n});\n\nexport type FungibleAssetMetadata = Infer<typeof FungibleAssetMetadataStruct>;\n\nexport type OnAssetsLookupArguments = {\n assets: CaipAssetType[];\n};\n\n/**\n * The `onAssetsLookup` handler. This is called by MetaMask when querying about specific assets on specific chains.\n *\n * @returns The metadata about each asset. See\n * {@link OnAssetsLookupResponse}.\n */\nexport type OnAssetsLookupHandler = (\n args: OnAssetsLookupArguments,\n) => Promise<OnAssetsLookupResponse>;\n\n/**\n * The response from the query, containing metadata about each requested asset.\n *\n * @property assets - An object containing a mapping between the CAIP-19 key and a metadata object or null.\n */\nexport type OnAssetsLookupResponse = {\n assets: Record<CaipAssetType, FungibleAssetMetadata | null>;\n};\n"]}
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./assets-conversion.cjs"), exports);
18
17
  __exportStar(require("./assets-lookup.cjs"), exports);
19
18
  __exportStar(require("./transaction.cjs"), exports);
20
19
  __exportStar(require("./user-input.cjs"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAoC;AACpC,sDAAgC;AAQhC,oDAA8B;AAE9B,mDAA6B","sourcesContent":["export * from './assets-conversion';\nexport * from './assets-lookup';\nexport type * from './cronjob';\nexport type * from './home-page';\nexport type * from './keyring';\nexport type * from './lifecycle';\nexport type * from './name-lookup';\nexport type * from './protocol';\nexport type * from './rpc-request';\nexport * from './transaction';\nexport type * from './signature';\nexport * from './user-input';\nexport type * from './settings-page';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,sDAAgC;AAQhC,oDAA8B;AAE9B,mDAA6B","sourcesContent":["export type * from './asset-historical-price';\nexport type * from './assets-conversion';\nexport * from './assets-lookup';\nexport type * from './cronjob';\nexport type * from './home-page';\nexport type * from './keyring';\nexport type * from './lifecycle';\nexport type * from './name-lookup';\nexport type * from './protocol';\nexport type * from './rpc-request';\nexport * from './transaction';\nexport type * from './signature';\nexport * from './user-input';\nexport type * from './settings-page';\n"]}
@@ -1,4 +1,5 @@
1
- export * from "./assets-conversion.cjs";
1
+ export type * from "./asset-historical-price.cjs";
2
+ export type * from "./assets-conversion.cjs";
2
3
  export * from "./assets-lookup.cjs";
3
4
  export type * from "./cronjob.cjs";
4
5
  export type * from "./home-page.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":"AAAA,wCAAoC;AACpC,oCAAgC;AAChC,mCAA+B;AAC/B,qCAAiC;AACjC,mCAA+B;AAC/B,qCAAiC;AACjC,uCAAmC;AACnC,oCAAgC;AAChC,uCAAmC;AACnC,kCAA8B;AAC9B,qCAAiC;AACjC,iCAA6B;AAC7B,yCAAqC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":"AAAA,kDAA8C;AAC9C,6CAAyC;AACzC,oCAAgC;AAChC,mCAA+B;AAC/B,qCAAiC;AACjC,mCAA+B;AAC/B,qCAAiC;AACjC,uCAAmC;AACnC,oCAAgC;AAChC,uCAAmC;AACnC,kCAA8B;AAC9B,qCAAiC;AACjC,iCAA6B;AAC7B,yCAAqC"}
@@ -1,4 +1,5 @@
1
- export * from "./assets-conversion.mjs";
1
+ export type * from "./asset-historical-price.mjs";
2
+ export type * from "./assets-conversion.mjs";
2
3
  export * from "./assets-lookup.mjs";
3
4
  export type * from "./cronjob.mjs";
4
5
  export type * from "./home-page.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":"AAAA,wCAAoC;AACpC,oCAAgC;AAChC,mCAA+B;AAC/B,qCAAiC;AACjC,mCAA+B;AAC/B,qCAAiC;AACjC,uCAAmC;AACnC,oCAAgC;AAChC,uCAAmC;AACnC,kCAA8B;AAC9B,qCAAiC;AACjC,iCAA6B;AAC7B,yCAAqC"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":"AAAA,kDAA8C;AAC9C,6CAAyC;AACzC,oCAAgC;AAChC,mCAA+B;AAC/B,qCAAiC;AACjC,mCAA+B;AAC/B,qCAAiC;AACjC,uCAAmC;AACnC,oCAAgC;AAChC,uCAAmC;AACnC,kCAA8B;AAC9B,qCAAiC;AACjC,iCAA6B;AAC7B,yCAAqC"}
@@ -1,4 +1,3 @@
1
- export * from "./assets-conversion.mjs";
2
1
  export * from "./assets-lookup.mjs";
3
2
  export * from "./transaction.mjs";
4
3
  export * from "./user-input.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":"AAAA,wCAAoC;AACpC,oCAAgC;AAQhC,kCAA8B;AAE9B,iCAA6B","sourcesContent":["export * from './assets-conversion';\nexport * from './assets-lookup';\nexport type * from './cronjob';\nexport type * from './home-page';\nexport type * from './keyring';\nexport type * from './lifecycle';\nexport type * from './name-lookup';\nexport type * from './protocol';\nexport type * from './rpc-request';\nexport * from './transaction';\nexport type * from './signature';\nexport * from './user-input';\nexport type * from './settings-page';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/types/handlers/index.ts"],"names":[],"mappings":"AAEA,oCAAgC;AAQhC,kCAA8B;AAE9B,iCAA6B","sourcesContent":["export type * from './asset-historical-price';\nexport type * from './assets-conversion';\nexport * from './assets-lookup';\nexport type * from './cronjob';\nexport type * from './home-page';\nexport type * from './keyring';\nexport type * from './lifecycle';\nexport type * from './name-lookup';\nexport type * from './protocol';\nexport type * from './rpc-request';\nexport * from './transaction';\nexport type * from './signature';\nexport * from './user-input';\nexport type * from './settings-page';\n"]}
@@ -77,8 +77,6 @@ export declare const AssetSelectorStateStruct: import("@metamask/superstruct").S
77
77
  */
78
78
  export type AssetSelectorState = Infer<typeof AssetSelectorStateStruct>;
79
79
  export declare const FormSubmitEventStruct: import("@metamask/superstruct").Struct<{
80
- type: UserInputEventType.FormSubmitEvent;
81
- name: string;
82
80
  value: Record<string, string | boolean | {
83
81
  name: string;
84
82
  size: number;
@@ -89,6 +87,8 @@ export declare const FormSubmitEventStruct: import("@metamask/superstruct").Stru
89
87
  name: string;
90
88
  asset: `${string}:${string}/${string}:${string}`;
91
89
  } | null>;
90
+ name: string;
91
+ type: UserInputEventType.FormSubmitEvent;
92
92
  }, {
93
93
  type: import("@metamask/superstruct").Struct<UserInputEventType.FormSubmitEvent, UserInputEventType.FormSubmitEvent>;
94
94
  value: import("@metamask/superstruct").Struct<Record<string, string | boolean | {
@@ -118,13 +118,13 @@ export declare const FormSubmitEventStruct: import("@metamask/superstruct").Stru
118
118
  */
119
119
  export type FormSubmitEvent = Infer<typeof FormSubmitEventStruct>;
120
120
  export declare const InputChangeEventStruct: import("@metamask/superstruct").Struct<{
121
- type: UserInputEventType.InputChangeEvent;
122
- name: string;
123
121
  value: string | boolean | {
124
122
  symbol: string;
125
123
  name: string;
126
124
  asset: `${string}:${string}/${string}:${string}`;
127
125
  };
126
+ name: string;
127
+ type: UserInputEventType.InputChangeEvent;
128
128
  }, {
129
129
  type: import("@metamask/superstruct").Struct<UserInputEventType.InputChangeEvent, UserInputEventType.InputChangeEvent>;
130
130
  name: import("@metamask/superstruct").Struct<string, null>;
@@ -144,6 +144,7 @@ export declare const InputChangeEventStruct: import("@metamask/superstruct").Str
144
144
  */
145
145
  export type InputChangeEvent = Infer<typeof InputChangeEventStruct>;
146
146
  export declare const FileUploadEventStruct: import("@metamask/superstruct").Struct<{
147
+ name: string;
147
148
  type: UserInputEventType.FileUploadEvent;
148
149
  file: {
149
150
  name: string;
@@ -151,7 +152,6 @@ export declare const FileUploadEventStruct: import("@metamask/superstruct").Stru
151
152
  contentType: string;
152
153
  contents: string;
153
154
  } | null;
154
- name: string;
155
155
  }, {
156
156
  type: import("@metamask/superstruct").Struct<UserInputEventType.FileUploadEvent, UserInputEventType.FileUploadEvent>;
157
157
  name: import("@metamask/superstruct").Struct<string, null>;
@@ -182,8 +182,6 @@ export declare const UserInputEventStruct: import("@metamask/superstruct").Struc
182
182
  type: UserInputEventType.ButtonClickEvent;
183
183
  name?: string | undefined;
184
184
  } | {
185
- type: UserInputEventType.FormSubmitEvent;
186
- name: string;
187
185
  value: Record<string, string | boolean | {
188
186
  name: string;
189
187
  size: number;
@@ -194,15 +192,18 @@ export declare const UserInputEventStruct: import("@metamask/superstruct").Struc
194
192
  name: string;
195
193
  asset: `${string}:${string}/${string}:${string}`;
196
194
  } | null>;
197
- } | {
198
- type: UserInputEventType.InputChangeEvent;
199
195
  name: string;
196
+ type: UserInputEventType.FormSubmitEvent;
197
+ } | {
200
198
  value: string | boolean | {
201
199
  symbol: string;
202
200
  name: string;
203
201
  asset: `${string}:${string}/${string}:${string}`;
204
202
  };
203
+ name: string;
204
+ type: UserInputEventType.InputChangeEvent;
205
205
  } | {
206
+ name: string;
206
207
  type: UserInputEventType.FileUploadEvent;
207
208
  file: {
208
209
  name: string;
@@ -210,7 +211,6 @@ export declare const UserInputEventStruct: import("@metamask/superstruct").Struc
210
211
  contentType: string;
211
212
  contents: string;
212
213
  } | null;
213
- name: string;
214
214
  }, null>;
215
215
  /**
216
216
  * A user input event fired in the UI. This is passed to the params of the `onUserInput` handler.
@@ -77,8 +77,6 @@ export declare const AssetSelectorStateStruct: import("@metamask/superstruct").S
77
77
  */
78
78
  export type AssetSelectorState = Infer<typeof AssetSelectorStateStruct>;
79
79
  export declare const FormSubmitEventStruct: import("@metamask/superstruct").Struct<{
80
- type: UserInputEventType.FormSubmitEvent;
81
- name: string;
82
80
  value: Record<string, string | boolean | {
83
81
  name: string;
84
82
  size: number;
@@ -89,6 +87,8 @@ export declare const FormSubmitEventStruct: import("@metamask/superstruct").Stru
89
87
  name: string;
90
88
  asset: `${string}:${string}/${string}:${string}`;
91
89
  } | null>;
90
+ name: string;
91
+ type: UserInputEventType.FormSubmitEvent;
92
92
  }, {
93
93
  type: import("@metamask/superstruct").Struct<UserInputEventType.FormSubmitEvent, UserInputEventType.FormSubmitEvent>;
94
94
  value: import("@metamask/superstruct").Struct<Record<string, string | boolean | {
@@ -118,13 +118,13 @@ export declare const FormSubmitEventStruct: import("@metamask/superstruct").Stru
118
118
  */
119
119
  export type FormSubmitEvent = Infer<typeof FormSubmitEventStruct>;
120
120
  export declare const InputChangeEventStruct: import("@metamask/superstruct").Struct<{
121
- type: UserInputEventType.InputChangeEvent;
122
- name: string;
123
121
  value: string | boolean | {
124
122
  symbol: string;
125
123
  name: string;
126
124
  asset: `${string}:${string}/${string}:${string}`;
127
125
  };
126
+ name: string;
127
+ type: UserInputEventType.InputChangeEvent;
128
128
  }, {
129
129
  type: import("@metamask/superstruct").Struct<UserInputEventType.InputChangeEvent, UserInputEventType.InputChangeEvent>;
130
130
  name: import("@metamask/superstruct").Struct<string, null>;
@@ -144,6 +144,7 @@ export declare const InputChangeEventStruct: import("@metamask/superstruct").Str
144
144
  */
145
145
  export type InputChangeEvent = Infer<typeof InputChangeEventStruct>;
146
146
  export declare const FileUploadEventStruct: import("@metamask/superstruct").Struct<{
147
+ name: string;
147
148
  type: UserInputEventType.FileUploadEvent;
148
149
  file: {
149
150
  name: string;
@@ -151,7 +152,6 @@ export declare const FileUploadEventStruct: import("@metamask/superstruct").Stru
151
152
  contentType: string;
152
153
  contents: string;
153
154
  } | null;
154
- name: string;
155
155
  }, {
156
156
  type: import("@metamask/superstruct").Struct<UserInputEventType.FileUploadEvent, UserInputEventType.FileUploadEvent>;
157
157
  name: import("@metamask/superstruct").Struct<string, null>;
@@ -182,8 +182,6 @@ export declare const UserInputEventStruct: import("@metamask/superstruct").Struc
182
182
  type: UserInputEventType.ButtonClickEvent;
183
183
  name?: string | undefined;
184
184
  } | {
185
- type: UserInputEventType.FormSubmitEvent;
186
- name: string;
187
185
  value: Record<string, string | boolean | {
188
186
  name: string;
189
187
  size: number;
@@ -194,15 +192,18 @@ export declare const UserInputEventStruct: import("@metamask/superstruct").Struc
194
192
  name: string;
195
193
  asset: `${string}:${string}/${string}:${string}`;
196
194
  } | null>;
197
- } | {
198
- type: UserInputEventType.InputChangeEvent;
199
195
  name: string;
196
+ type: UserInputEventType.FormSubmitEvent;
197
+ } | {
200
198
  value: string | boolean | {
201
199
  symbol: string;
202
200
  name: string;
203
201
  asset: `${string}:${string}/${string}:${string}`;
204
202
  };
203
+ name: string;
204
+ type: UserInputEventType.InputChangeEvent;
205
205
  } | {
206
+ name: string;
206
207
  type: UserInputEventType.FileUploadEvent;
207
208
  file: {
208
209
  name: string;
@@ -210,7 +211,6 @@ export declare const UserInputEventStruct: import("@metamask/superstruct").Struc
210
211
  contentType: string;
211
212
  contents: string;
212
213
  } | null;
213
- name: string;
214
214
  }, null>;
215
215
  /**
216
216
  * A user input event fired in the UI. This is passed to the params of the `onUserInput` handler.
@@ -51,71 +51,71 @@ export type FormState = Infer<typeof FormStateStruct>;
51
51
  export type InterfaceState = Infer<typeof InterfaceStateStruct>;
52
52
  export type ComponentOrElement = Component | JSXElement;
53
53
  export declare const ComponentOrElementStruct: import("@metamask/superstruct").Struct<{
54
- type: import("../ui/index.cjs").NodeType.Copyable;
55
54
  value: string;
55
+ type: import("../ui/index.cjs").NodeType.Copyable;
56
56
  sensitive?: boolean | undefined;
57
57
  } | {
58
58
  type: import("../ui/index.cjs").NodeType.Divider;
59
59
  } | {
60
- type: import("../ui/index.cjs").NodeType.Heading;
61
60
  value: string;
61
+ type: import("../ui/index.cjs").NodeType.Heading;
62
62
  } | {
63
- type: import("../ui/index.cjs").NodeType.Image;
64
63
  value: string;
64
+ type: import("../ui/index.cjs").NodeType.Image;
65
65
  } | import("../ui/index.cjs").Panel | {
66
66
  type: import("../ui/index.cjs").NodeType.Spinner;
67
67
  } | {
68
- type: import("../ui/index.cjs").NodeType.Text;
69
68
  value: string;
69
+ type: import("../ui/index.cjs").NodeType.Text;
70
70
  markdown?: boolean | undefined;
71
71
  } | {
72
- type: import("../ui/index.cjs").NodeType.Address;
73
72
  value: `0x${string}`;
73
+ type: import("../ui/index.cjs").NodeType.Address;
74
74
  } | {
75
- type: import("../ui/index.cjs").NodeType.Row;
76
75
  value: {
77
- type: import("../ui/index.cjs").NodeType.Image;
78
76
  value: string;
77
+ type: import("../ui/index.cjs").NodeType.Image;
79
78
  } | {
80
- type: import("../ui/index.cjs").NodeType.Text;
81
79
  value: string;
80
+ type: import("../ui/index.cjs").NodeType.Text;
82
81
  markdown?: boolean | undefined;
83
82
  } | {
84
- type: import("../ui/index.cjs").NodeType.Address;
85
83
  value: `0x${string}`;
84
+ type: import("../ui/index.cjs").NodeType.Address;
86
85
  };
86
+ type: import("../ui/index.cjs").NodeType.Row;
87
87
  label: string;
88
- variant?: "default" | "warning" | "critical" | undefined;
88
+ variant?: "default" | "critical" | "warning" | undefined;
89
89
  } | {
90
- type: import("../ui/index.cjs").NodeType.Input;
91
90
  name: string;
92
- error?: string | undefined;
93
- inputType?: "number" | "text" | "password" | undefined;
91
+ type: import("../ui/index.cjs").NodeType.Input;
94
92
  value?: string | undefined;
95
93
  label?: string | undefined;
94
+ inputType?: "number" | "text" | "password" | undefined;
96
95
  placeholder?: string | undefined;
96
+ error?: string | undefined;
97
97
  } | {
98
- type: import("../ui/index.cjs").NodeType.Button;
99
98
  value: string;
100
- variant?: "primary" | "secondary" | undefined;
99
+ type: import("../ui/index.cjs").NodeType.Button;
101
100
  name?: string | undefined;
101
+ variant?: "primary" | "secondary" | undefined;
102
102
  buttonType?: "button" | "submit" | undefined;
103
103
  } | {
104
- type: import("../ui/index.cjs").NodeType.Form;
105
104
  name: string;
105
+ type: import("../ui/index.cjs").NodeType.Form;
106
106
  children: ({
107
- type: import("../ui/index.cjs").NodeType.Input;
108
107
  name: string;
109
- error?: string | undefined;
110
- inputType?: "number" | "text" | "password" | undefined;
108
+ type: import("../ui/index.cjs").NodeType.Input;
111
109
  value?: string | undefined;
112
110
  label?: string | undefined;
111
+ inputType?: "number" | "text" | "password" | undefined;
113
112
  placeholder?: string | undefined;
113
+ error?: string | undefined;
114
114
  } | {
115
- type: import("../ui/index.cjs").NodeType.Button;
116
115
  value: string;
117
- variant?: "primary" | "secondary" | undefined;
116
+ type: import("../ui/index.cjs").NodeType.Button;
118
117
  name?: string | undefined;
118
+ variant?: "primary" | "secondary" | undefined;
119
119
  buttonType?: "button" | "submit" | undefined;
120
120
  })[];
121
121
  } | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").AssetSelectorProps, "AssetSelector"> | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").AddressInputProps, "AddressInput"> | import("../jsx/index.cjs").SnapElement<import("../jsx/index.cjs").IconProps, "Icon"> | import("../jsx/index.cjs").SnapElement<{