Socket
Socket
Sign inDemoInstall

@metamask/snaps-sdk

Package Overview
Dependencies
Maintainers
11
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@metamask/snaps-sdk - npm Package Compare versions

Comparing version 6.1.1 to 6.2.0

dist/types/jsx/components/form/Radio.d.ts

10

CHANGELOG.md

@@ -9,2 +9,7 @@ # Changelog

## [6.2.0]
### Added
- Add `snap_getPreferences` ([#2607](https://github.com/MetaMask/snaps/pull/2607))
- Add `RadioButton` component ([#2592](https://github.com/MetaMask/snaps/pull/2592))
## [6.1.1]

@@ -17,3 +22,3 @@ ### Changed

- Add non-restricted RPC method `snap_resolveInterface` ([#2509](https://github.com/metamask/snaps/pull/2509))
- This method allows a Snap to resolve a given user interface bound to a `snap_dialog` with a custom value.
- This method allows a Snap to resolve a given user interface bound to a `snap_dialog` with a custom value.
- Add new types `ResolveInterfaceParams`, `ResolveInterfaceResult`.

@@ -211,3 +216,4 @@ - Add `Card` component ([#2480](https://github.com/metamask/snaps/pull/2480))

[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.1.1...HEAD
[Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.2.0...HEAD
[6.2.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.1.1...@metamask/snaps-sdk@6.2.0
[6.1.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.1.0...@metamask/snaps-sdk@6.1.1

@@ -214,0 +220,0 @@ [6.1.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-sdk@6.0.0...@metamask/snaps-sdk@6.1.0

@@ -908,2 +908,14 @@ "use strict";

});
var RadioStruct = element("Radio", {
value: (0, import_superstruct18.string)(),
children: (0, import_superstruct18.string)()
});
var RadioGroupStruct = element(
"RadioGroup",
{
name: (0, import_superstruct18.string)(),
value: (0, import_superstruct18.optional)((0, import_superstruct18.string)()),
children: children([RadioStruct])
}
);
var FileInputStruct = element(

@@ -921,2 +933,3 @@ "FileInput",

DropdownStruct,
RadioGroupStruct,
FileInputStruct,

@@ -1070,2 +1083,3 @@ CheckboxStruct

DropdownStruct,
RadioGroupStruct,
FileInputStruct,

@@ -1109,2 +1123,4 @@ FormStruct2,

OptionStruct,
RadioGroupStruct,
RadioStruct,
ValueStruct,

@@ -1111,0 +1127,0 @@ TooltipStruct,

112

dist/jsx/index.js

@@ -47,2 +47,4 @@ "use strict";

Option: () => Option,
Radio: () => Radio,
RadioGroup: () => RadioGroup,
RootJSXElementStruct: () => RootJSXElementStruct,

@@ -97,85 +99,95 @@ Row: () => Row,

// src/jsx/components/form/Radio.ts
var TYPE5 = "Radio";
var Radio = createSnapComponent(TYPE5);
// src/jsx/components/form/RadioGroup.ts
var TYPE6 = "RadioGroup";
var RadioGroup = createSnapComponent(
TYPE6
);
// src/jsx/components/form/Field.ts
var TYPE5 = "Field";
var Field = createSnapComponent(TYPE5);
var TYPE7 = "Field";
var Field = createSnapComponent(TYPE7);
// src/jsx/components/form/FileInput.ts
var TYPE6 = "FileInput";
var FileInput = createSnapComponent(TYPE6);
var TYPE8 = "FileInput";
var FileInput = createSnapComponent(TYPE8);
// src/jsx/components/form/Form.ts
var TYPE7 = "Form";
var Form = createSnapComponent(TYPE7);
var TYPE9 = "Form";
var Form = createSnapComponent(TYPE9);
// src/jsx/components/form/Input.ts
var TYPE8 = "Input";
var Input = createSnapComponent(TYPE8);
var TYPE10 = "Input";
var Input = createSnapComponent(TYPE10);
// src/jsx/components/formatting/Bold.ts
var TYPE9 = "Bold";
var Bold = createSnapComponent(TYPE9);
var TYPE11 = "Bold";
var Bold = createSnapComponent(TYPE11);
// src/jsx/components/formatting/Italic.ts
var TYPE10 = "Italic";
var Italic = createSnapComponent(TYPE10);
var TYPE12 = "Italic";
var Italic = createSnapComponent(TYPE12);
// src/jsx/components/Address.ts
var TYPE11 = "Address";
var Address = createSnapComponent(TYPE11);
var TYPE13 = "Address";
var Address = createSnapComponent(TYPE13);
// src/jsx/components/Box.ts
var TYPE12 = "Box";
var Box = createSnapComponent(TYPE12);
var TYPE14 = "Box";
var Box = createSnapComponent(TYPE14);
// src/jsx/components/Card.ts
var TYPE13 = "Card";
var Card = createSnapComponent(TYPE13);
var TYPE15 = "Card";
var Card = createSnapComponent(TYPE15);
// src/jsx/components/Copyable.ts
var TYPE14 = "Copyable";
var Copyable = createSnapComponent(TYPE14);
var TYPE16 = "Copyable";
var Copyable = createSnapComponent(TYPE16);
// src/jsx/components/Divider.ts
var TYPE15 = "Divider";
var Divider = createSnapComponent(TYPE15);
var TYPE17 = "Divider";
var Divider = createSnapComponent(TYPE17);
// src/jsx/components/Value.ts
var TYPE16 = "Value";
var Value = createSnapComponent(TYPE16);
var TYPE18 = "Value";
var Value = createSnapComponent(TYPE18);
// src/jsx/components/Heading.ts
var TYPE17 = "Heading";
var Heading = createSnapComponent(TYPE17);
var TYPE19 = "Heading";
var Heading = createSnapComponent(TYPE19);
// src/jsx/components/Image.ts
var TYPE18 = "Image";
var Image = createSnapComponent(TYPE18);
var TYPE20 = "Image";
var Image = createSnapComponent(TYPE20);
// src/jsx/components/Link.ts
var TYPE19 = "Link";
var Link = createSnapComponent(TYPE19);
var TYPE21 = "Link";
var Link = createSnapComponent(TYPE21);
// src/jsx/components/Row.ts
var TYPE20 = "Row";
var Row = createSnapComponent(TYPE20);
var TYPE22 = "Row";
var Row = createSnapComponent(TYPE22);
// src/jsx/components/Spinner.ts
var TYPE21 = "Spinner";
var Spinner = createSnapComponent(TYPE21);
var TYPE23 = "Spinner";
var Spinner = createSnapComponent(TYPE23);
// src/jsx/components/Text.ts
var TYPE22 = "Text";
var Text = createSnapComponent(TYPE22);
var TYPE24 = "Text";
var Text = createSnapComponent(TYPE24);
// src/jsx/components/Tooltip.ts
var TYPE23 = "Tooltip";
var Tooltip = createSnapComponent(TYPE23);
var TYPE25 = "Tooltip";
var Tooltip = createSnapComponent(TYPE25);
// src/jsx/components/Footer.ts
var TYPE24 = "Footer";
var Footer = createSnapComponent(TYPE24);
var TYPE26 = "Footer";
var Footer = createSnapComponent(TYPE26);
// src/jsx/components/Container.ts
var TYPE25 = "Container";
var Container = createSnapComponent(TYPE25);
var TYPE27 = "Container";
var Container = createSnapComponent(TYPE27);

@@ -334,2 +346,14 @@ // src/jsx/jsx-runtime.ts

});
var RadioStruct = element("Radio", {
value: (0, import_superstruct3.string)(),
children: (0, import_superstruct3.string)()
});
var RadioGroupStruct = element(
"RadioGroup",
{
name: (0, import_superstruct3.string)(),
value: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
children: children([RadioStruct])
}
);
var FileInputStruct = element(

@@ -347,2 +371,3 @@ "FileInput",

DropdownStruct,
RadioGroupStruct,
FileInputStruct,

@@ -496,2 +521,3 @@ CheckboxStruct

DropdownStruct,
RadioGroupStruct,
FileInputStruct,

@@ -535,2 +561,4 @@ FormStruct,

OptionStruct,
RadioGroupStruct,
RadioStruct,
ValueStruct,

@@ -537,0 +565,0 @@ TooltipStruct,

@@ -176,2 +176,14 @@ "use strict";

});
var RadioStruct = element("Radio", {
value: (0, import_superstruct3.string)(),
children: (0, import_superstruct3.string)()
});
var RadioGroupStruct = element(
"RadioGroup",
{
name: (0, import_superstruct3.string)(),
value: (0, import_superstruct3.optional)((0, import_superstruct3.string)()),
children: children([RadioStruct])
}
);
var FileInputStruct = element(

@@ -189,2 +201,3 @@ "FileInput",

DropdownStruct,
RadioGroupStruct,
FileInputStruct,

@@ -338,2 +351,3 @@ CheckboxStruct

DropdownStruct,
RadioGroupStruct,
FileInputStruct,

@@ -377,2 +391,4 @@ FormStruct,

OptionStruct,
RadioGroupStruct,
RadioStruct,
ValueStruct,

@@ -379,0 +395,0 @@ TooltipStruct,

@@ -80,3 +80,3 @@ import type { Json, JsonRpcError } from '@metamask/utils';

*/
export declare type SerializedSnapError = {
export type SerializedSnapError = {
code: typeof SNAP_ERROR_CODE;

@@ -83,0 +83,0 @@ message: typeof SNAP_ERROR_MESSAGE;

@@ -33,3 +33,3 @@ /**

*/
export declare type ImageOptions = {
export type ImageOptions = {
width: number;

@@ -36,0 +36,0 @@ height?: number;

/// <reference types="node" />
import type { rpcErrors } from '@metamask/rpc-errors';
import type { Json } from '@metamask/utils';
export declare type JsonRpcErrorFunction = typeof rpcErrors.parse;
export type JsonRpcErrorFunction = typeof rpcErrors.parse;
/**

@@ -6,0 +6,0 @@ * Create a `SnapError` class from an error function from

@@ -21,3 +21,3 @@ import type { JsonRpcParams, JsonRpcRequest } from '@metamask/utils';

*/
export declare type EnumToUnion<Type extends string> = `${Type}`;
export type EnumToUnion<Type extends string> = `${Type}`;
/**

@@ -32,3 +32,3 @@ * Get a JSON-RPC method with the given name and parameters. If params extends

*/
export declare type Method<MethodName extends string, Params extends JsonRpcParams> = Partial<JsonRpcRequest> & Params extends never ? {
export type Method<MethodName extends string, Params extends JsonRpcParams> = Partial<JsonRpcRequest> & Params extends never ? {
method: MethodName;

@@ -35,0 +35,0 @@ } : {

@@ -7,3 +7,3 @@ import type { AnyStruct, EnumSchema, Infer, InferStructTuple, IsExactMatch, IsMatch, IsRecord, IsTuple, Struct, UnionToIntersection } from '@metamask/superstruct';

*/
declare type IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;
type IsUnion<Type> = [Type] extends [UnionToIntersection<Type>] ? false : true;
/**

@@ -15,3 +15,3 @@ * Get a struct schema for a type.

*/
declare type StructSchema<Type> = IsUnion<Type> extends true ? null : [Type] extends [EmptyObject] ? EmptyObject : [Type] extends [string | undefined | null] ? [Type] extends [`0x${string}`] ? null : [Type] extends [IsMatch<Type, string | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [number | undefined | null] ? [Type] extends [IsMatch<Type, number | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [boolean] ? [Type] extends [IsExactMatch<Type, boolean>] ? null : Type : Type extends bigint | symbol | undefined | null | Function | Date | Error | RegExp | Map<any, any> | WeakMap<any, any> | Set<any> | WeakSet<any> | Promise<any> ? null : Type extends (infer E)[] ? Type extends IsTuple<Type> ? null : Struct<E> : Type extends object ? Type extends IsRecord<Type> ? null : {
type StructSchema<Type> = IsUnion<Type> extends true ? null : [Type] extends [EmptyObject] ? EmptyObject : [Type] extends [string | undefined | null] ? [Type] extends [`0x${string}`] ? null : [Type] extends [IsMatch<Type, string | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [number | undefined | null] ? [Type] extends [IsMatch<Type, number | undefined | null>] ? null : [Type] extends [IsUnion<Type>] ? EnumSchema<Type> : Type : [Type] extends [boolean] ? [Type] extends [IsExactMatch<Type, boolean>] ? null : Type : Type extends bigint | symbol | undefined | null | Function | Date | Error | RegExp | Map<any, any> | WeakMap<any, any> | Set<any> | WeakSet<any> | Promise<any> ? null : Type extends (infer E)[] ? Type extends IsTuple<Type> ? null : Struct<E> : Type extends object ? Type extends IsRecord<Type> ? null : {
[InnerKey in keyof Type]: Describe<Type[InnerKey]>;

@@ -22,3 +22,3 @@ } : null;

*/
export declare type Describe<Type> = Struct<Type, StructSchema<Type>>;
export type Describe<Type> = Struct<Type, StructSchema<Type>>;
/**

@@ -25,0 +25,0 @@ * Create a union struct that uses `null` for the schema type, for better

@@ -5,7 +5,7 @@ import type { Json } from '@metamask/utils';

*/
export declare type Key = string | number;
export type Key = string | number;
/**
* A JSON object.
*/
export declare type JsonObject = Record<string, Json>;
export type JsonObject = Record<string, Json>;
/**

@@ -18,3 +18,3 @@ * A generic JSX element.

*/
export declare type GenericSnapElement = {
export type GenericSnapElement = {
type: string;

@@ -31,3 +31,3 @@ props: JsonObject;

*/
export declare type SnapElement<Props extends JsonObject = Record<string, never>, Type extends string = string> = {
export type SnapElement<Props extends JsonObject = Record<string, never>, Type extends string = string> = {
type: Type;

@@ -46,3 +46,3 @@ props: Props;

*/
export declare type Nestable<Type> = Type | Nestable<Type>[];
export type Nestable<Type> = Type | Nestable<Type>[];
/**

@@ -53,7 +53,7 @@ * A type that can be a single value or an array of values, a boolean, or null.

*/
export declare type SnapsChildren<Type> = Nestable<Type | boolean | null>;
export type SnapsChildren<Type> = Nestable<Type | boolean | null>;
/**
* A JSX node, which can be an element, a string, null, or an array of nodes.
*/
export declare type SnapNode = SnapsChildren<GenericSnapElement | string>;
export type SnapNode = SnapsChildren<GenericSnapElement | string>;
/**

@@ -63,7 +63,7 @@ * A JSX string element, which can be a string or an array of strings, or

*/
export declare type StringElement = SnapsChildren<string>;
export type StringElement = SnapsChildren<string>;
/**
* A JSX component.
*/
export declare type SnapComponent<Props extends JsonObject = Record<string, never>, Type extends string = string> = (props: Props & {
export type SnapComponent<Props extends JsonObject = Record<string, never>, Type extends string = string> = (props: Props & {
key?: Key | null;

@@ -70,0 +70,0 @@ }) => SnapElement<Props, Type>;

@@ -7,3 +7,3 @@ /**

*/
export declare type AddressProps = {
export type AddressProps = {
address: `0x${string}`;

@@ -29,2 +29,2 @@ };

*/
export declare type AddressElement = ReturnType<typeof Address>;
export type AddressElement = ReturnType<typeof Address>;

@@ -9,3 +9,3 @@ import type { GenericSnapElement, SnapsChildren } from '../component';

*/
export declare type BoxProps = {
export type BoxProps = {
children: SnapsChildren<GenericSnapElement>;

@@ -32,2 +32,2 @@ direction?: 'vertical' | 'horizontal' | undefined;

*/
export declare type BoxElement = ReturnType<typeof Box>;
export type BoxElement = ReturnType<typeof Box>;

@@ -10,3 +10,3 @@ /**

*/
export declare type CardProps = {
export type CardProps = {
image?: string | undefined;

@@ -37,2 +37,2 @@ title: string;

*/
export declare type CardElement = ReturnType<typeof Card>;
export type CardElement = ReturnType<typeof Card>;

@@ -8,3 +8,3 @@ import type { BoxElement } from './Box';

*/
export declare type ContainerProps = {
export type ContainerProps = {
children: [BoxElement, FooterElement] | BoxElement;

@@ -35,2 +35,2 @@ };

*/
export declare type ContainerElement = ReturnType<typeof Container>;
export type ContainerElement = ReturnType<typeof Container>;

@@ -9,3 +9,3 @@ /**

*/
export declare type CopyableProps = {
export type CopyableProps = {
value: string;

@@ -33,2 +33,2 @@ sensitive?: boolean | undefined;

*/
export declare type CopyableElement = ReturnType<typeof Copyable>;
export type CopyableElement = ReturnType<typeof Copyable>;

@@ -17,2 +17,2 @@ /**

*/
export declare type DividerElement = ReturnType<typeof Divider>;
export type DividerElement = ReturnType<typeof Divider>;

@@ -7,3 +7,3 @@ import type { ButtonElement } from './form';

*/
export declare type FooterProps = {
export type FooterProps = {
children: ButtonElement | [ButtonElement, ButtonElement];

@@ -29,2 +29,2 @@ };

*/
export declare type FooterElement = ReturnType<typeof Footer>;
export type FooterElement = ReturnType<typeof Footer>;

@@ -14,3 +14,3 @@ import type { StringElement } from '../../component';

*/
export declare type ButtonProps = {
export type ButtonProps = {
children: StringElement;

@@ -38,2 +38,2 @@ name?: string | undefined;

*/
export declare type ButtonElement = ReturnType<typeof Button>;
export type ButtonElement = ReturnType<typeof Button>;

@@ -10,3 +10,3 @@ /**

*/
export declare type CheckboxProps = {
export type CheckboxProps = {
name: string;

@@ -36,2 +36,2 @@ checked?: boolean | undefined;

*/
export declare type CheckboxElement = ReturnType<typeof Checkbox>;
export type CheckboxElement = ReturnType<typeof Checkbox>;

@@ -11,3 +11,3 @@ import type { SnapsChildren } from '../../component';

*/
export declare type DropdownProps = {
export type DropdownProps = {
name: string;

@@ -39,2 +39,2 @@ value?: string | undefined;

*/
export declare type DropdownElement = ReturnType<typeof Dropdown>;
export type DropdownElement = ReturnType<typeof Dropdown>;

@@ -6,2 +6,3 @@ import type { ButtonElement } from './Button';

import type { InputElement } from './Input';
import type { RadioGroupElement } from './RadioGroup';
/**

@@ -14,6 +15,6 @@ * The props of the {@link Field} component.

*/
export declare type FieldProps = {
export type FieldProps = {
label?: string | undefined;
error?: string | undefined;
children: [InputElement, ButtonElement] | DropdownElement | FileInputElement | InputElement | CheckboxElement;
children: [InputElement, ButtonElement] | DropdownElement | RadioGroupElement | FileInputElement | InputElement | CheckboxElement;
};

@@ -45,2 +46,2 @@ /**

*/
export declare type FieldElement = ReturnType<typeof Field>;
export type FieldElement = ReturnType<typeof Field>;

@@ -12,3 +12,3 @@ /**

*/
export declare type FileInputProps = {
export type FileInputProps = {
name: string;

@@ -48,2 +48,2 @@ accept?: string[] | undefined;

*/
export declare type FileInputElement = ReturnType<typeof FileInput>;
export type FileInputElement = ReturnType<typeof FileInput>;

@@ -9,3 +9,3 @@ import type { GenericSnapElement, SnapsChildren } from '../../component';

*/
export declare type FormProps = {
export type FormProps = {
children: SnapsChildren<GenericSnapElement>;

@@ -37,2 +37,2 @@ name: string;

*/
export declare type FormElement = ReturnType<typeof Form>;
export type FormElement = ReturnType<typeof Form>;

@@ -9,2 +9,4 @@ import type { ButtonElement } from './Button';

import type { OptionElement } from './Option';
import type { RadioElement } from './Radio';
import type { RadioGroupElement } from './RadioGroup';
export * from './Button';

@@ -14,2 +16,4 @@ export * from './Checkbox';

export * from './Option';
export * from './Radio';
export * from './RadioGroup';
export * from './Field';

@@ -19,2 +23,2 @@ export * from './FileInput';

export * from './Input';
export declare type StandardFormElement = ButtonElement | CheckboxElement | FormElement | FieldElement | FileInputElement | InputElement | DropdownElement | OptionElement;
export type StandardFormElement = ButtonElement | CheckboxElement | FormElement | FieldElement | FileInputElement | InputElement | DropdownElement | OptionElement | RadioElement | RadioGroupElement;

@@ -10,3 +10,3 @@ /**

*/
export declare type InputProps = {
export type InputProps = {
name: string;

@@ -36,2 +36,2 @@ type?: 'text' | 'password' | 'number' | undefined;

*/
export declare type InputElement = ReturnType<typeof Input>;
export type InputElement = ReturnType<typeof Input>;

@@ -8,3 +8,3 @@ /**

*/
declare type OptionProps = {
type OptionProps = {
value: string;

@@ -35,3 +35,3 @@ children: string;

*/
export declare type OptionElement = ReturnType<typeof Option>;
export type OptionElement = ReturnType<typeof Option>;
export {};

@@ -5,3 +5,3 @@ import type { JsonObject, SnapElement, SnapsChildren } from '../../component';

*/
export declare type BoldChildren = SnapsChildren<string | SnapElement<JsonObject, 'Italic'>>;
export type BoldChildren = SnapsChildren<string | SnapElement<JsonObject, 'Italic'>>;
/**

@@ -12,3 +12,3 @@ * The props of the {@link Bold} component.

*/
export declare type BoldProps = {
export type BoldProps = {
children: BoldChildren;

@@ -34,2 +34,2 @@ };

*/
export declare type BoldElement = ReturnType<typeof Bold>;
export type BoldElement = ReturnType<typeof Bold>;

@@ -5,2 +5,2 @@ import type { BoldElement } from './Bold';

export * from './Italic';
export declare type StandardFormattingElement = BoldElement | ItalicElement;
export type StandardFormattingElement = BoldElement | ItalicElement;

@@ -5,3 +5,3 @@ import type { JsonObject, SnapElement, SnapsChildren } from '../../component';

*/
export declare type ItalicChildren = SnapsChildren<string | SnapElement<JsonObject, 'Bold'>>;
export type ItalicChildren = SnapsChildren<string | SnapElement<JsonObject, 'Bold'>>;
/**

@@ -13,3 +13,3 @@ * The props of the {@link Italic} component.

*/
export declare type ItalicProps = {
export type ItalicProps = {
children: ItalicChildren;

@@ -36,2 +36,2 @@ };

*/
export declare type ItalicElement = ReturnType<typeof Italic>;
export type ItalicElement = ReturnType<typeof Italic>;

@@ -7,3 +7,3 @@ import type { StringElement } from '../component';

*/
declare type HeadingProps = {
type HeadingProps = {
children: StringElement;

@@ -26,3 +26,3 @@ };

*/
export declare type HeadingElement = ReturnType<typeof Heading>;
export type HeadingElement = ReturnType<typeof Heading>;
export {};

@@ -10,3 +10,3 @@ /**

*/
declare type ImageProps = {
type ImageProps = {
src: string;

@@ -36,3 +36,3 @@ alt?: string | undefined;

*/
export declare type ImageElement = ReturnType<typeof Image>;
export type ImageElement = ReturnType<typeof Image>;
export {};

@@ -38,2 +38,2 @@ import type { AddressElement } from './Address';

*/
export declare type JSXElement = StandardFormElement | StandardFormattingElement | AddressElement | BoxElement | CardElement | ContainerElement | CopyableElement | DividerElement | FooterElement | ValueElement | HeadingElement | ImageElement | LinkElement | RowElement | SpinnerElement | TextElement | TooltipElement;
export type JSXElement = StandardFormElement | StandardFormattingElement | AddressElement | BoxElement | CardElement | ContainerElement | CopyableElement | DividerElement | FooterElement | ValueElement | HeadingElement | ImageElement | LinkElement | RowElement | SpinnerElement | TextElement | TooltipElement;

@@ -6,3 +6,3 @@ import type { SnapsChildren } from '../component';

*/
export declare type LinkChildren = SnapsChildren<string | StandardFormattingElement>;
export type LinkChildren = SnapsChildren<string | StandardFormattingElement>;
/**

@@ -15,3 +15,3 @@ * The props of the {@link Link} component.

*/
export declare type LinkProps = {
export type LinkProps = {
children: LinkChildren;

@@ -37,2 +37,2 @@ href: string;

*/
export declare type LinkElement = ReturnType<typeof Link>;
export type LinkElement = ReturnType<typeof Link>;

@@ -8,3 +8,3 @@ import type { AddressElement } from './Address';

*/
export declare type RowChildren = AddressElement | ImageElement | TextElement | ValueElement;
export type RowChildren = AddressElement | ImageElement | TextElement | ValueElement;
/**

@@ -19,3 +19,3 @@ * The props of the {@link Row} component.

*/
export declare type RowProps = {
export type RowProps = {
label: string;

@@ -47,2 +47,2 @@ children: RowChildren;

*/
export declare type RowElement = ReturnType<typeof Row>;
export type RowElement = ReturnType<typeof Row>;

@@ -17,2 +17,2 @@ /**

*/
export declare type SpinnerElement = ReturnType<typeof Spinner>;
export type SpinnerElement = ReturnType<typeof Spinner>;

@@ -7,3 +7,3 @@ import type { SnapsChildren } from '../component';

*/
export declare type TextChildren = SnapsChildren<string | StandardFormattingElement | LinkElement>;
export type TextChildren = SnapsChildren<string | StandardFormattingElement | LinkElement>;
/**

@@ -14,3 +14,3 @@ * The props of the {@link Text} component.

*/
export declare type TextProps = {
export type TextProps = {
children: TextChildren;

@@ -40,2 +40,2 @@ alignment?: 'start' | 'center' | 'end' | undefined;

*/
export declare type TextElement = ReturnType<typeof Text>;
export type TextElement = ReturnType<typeof Text>;

@@ -5,3 +5,3 @@ import type { StandardFormattingElement } from './formatting';

import type { TextElement } from './Text';
export declare type TooltipChildren = TextElement | StandardFormattingElement | LinkElement | ImageElement | boolean | null;
export type TooltipChildren = TextElement | StandardFormattingElement | LinkElement | ImageElement | boolean | null;
/**

@@ -13,3 +13,3 @@ * The props of the {@link Tooltip} component.

*/
export declare type TooltipProps = {
export type TooltipProps = {
children: TooltipChildren;

@@ -40,2 +40,2 @@ content: TextElement | StandardFormattingElement | LinkElement | string;

*/
export declare type TooltipElement = ReturnType<typeof Tooltip>;
export type TooltipElement = ReturnType<typeof Tooltip>;

@@ -7,3 +7,3 @@ /**

*/
export declare type ValueProps = {
export type ValueProps = {
value: string;

@@ -32,2 +32,2 @@ extra: string;

*/
export declare type ValueElement = ReturnType<typeof Value>;
export type ValueElement = ReturnType<typeof Value>;
import type { Struct } from '@metamask/superstruct';
import type { Describe } from '../internals';
import type { GenericSnapElement, Key, SnapElement, SnapsChildren, StringElement } from './component';
import type { AddressElement, BoldElement, BoxElement, ButtonElement, CheckboxElement, CardElement, CopyableElement, DividerElement, DropdownElement, OptionElement, FieldElement, FormElement, HeadingElement, ImageElement, InputElement, ItalicElement, JSXElement, LinkElement, RowElement, SpinnerElement, StandardFormattingElement, TextElement, TooltipElement, ValueElement, FileInputElement, ContainerElement, FooterElement } from './components';
import type { AddressElement, BoldElement, BoxElement, ButtonElement, CheckboxElement, CardElement, CopyableElement, DividerElement, DropdownElement, OptionElement, RadioElement, RadioGroupElement, FieldElement, FormElement, HeadingElement, ImageElement, InputElement, ItalicElement, JSXElement, LinkElement, RowElement, SpinnerElement, StandardFormattingElement, TextElement, TooltipElement, ValueElement, FileInputElement, ContainerElement, FooterElement } from './components';
/**

@@ -38,2 +38,10 @@ * A struct for the {@link Key} type.

/**
* A struct for the {@link RadioElement} type.
*/
export declare const RadioStruct: Describe<RadioElement>;
/**
* A struct for the {@link RadioGroupElement} type.
*/
export declare const RadioGroupStruct: Describe<RadioGroupElement>;
/**
* A struct for the {@link FileInputElement} type.

@@ -46,3 +54,10 @@ */

*/
export declare const FieldChildUnionStruct: Struct<SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<import("./components").FileInputProps, "FileInput">, null>;
export declare const FieldChildUnionStruct: Struct<SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
name: string;
value?: string | undefined;
children: SnapsChildren<SnapElement<{
value: string;
children: string;
}, "Radio">>;
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput">, null>;
/**

@@ -158,3 +173,10 @@ * A struct for the {@link FieldElement} type.

*/
export declare const BoxChildStruct: Struct<SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
export declare const BoxChildStruct: Struct<SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
name: string;
value?: string | undefined;
children: SnapsChildren<SnapElement<{
value: string;
children: string;
}, "Radio">>;
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
children: StringElement;

@@ -169,3 +191,10 @@ }, "Heading"> | SnapElement<{

*/
export declare const RootJSXElementStruct: Struct<SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").ContainerProps, "Container"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
export declare const RootJSXElementStruct: Struct<SnapElement<import("./components").ButtonProps, "Button"> | SnapElement<import("./components").CheckboxProps, "Checkbox"> | SnapElement<import("./components").FormProps, "Form"> | SnapElement<import("./components").InputProps, "Input"> | SnapElement<import("./components").DropdownProps, "Dropdown"> | SnapElement<{
name: string;
value?: string | undefined;
children: SnapsChildren<SnapElement<{
value: string;
children: string;
}, "Radio">>;
}, "RadioGroup"> | SnapElement<import("./components").FileInputProps, "FileInput"> | SnapElement<import("./components").BoldProps, "Bold"> | SnapElement<import("./components").ItalicProps, "Italic"> | SnapElement<import("./components").AddressProps, "Address"> | SnapElement<import("./components").BoxProps, "Box"> | SnapElement<import("./components").CardProps, "Card"> | SnapElement<import("./components").ContainerProps, "Container"> | SnapElement<import("./components").CopyableProps, "Copyable"> | SnapElement<Record<string, never>, "Divider"> | SnapElement<{
children: StringElement;

@@ -172,0 +201,0 @@ }, "Heading"> | SnapElement<{

@@ -6,3 +6,3 @@ /**

*/
export declare type ChainId = `${string}:${string}`;
export type ChainId = `${string}:${string}`;
/**

@@ -13,2 +13,2 @@ * A CAIP-10 account ID, i.e., a chain ID and an account address.

*/
export declare type AccountId = `${ChainId}:${string}`;
export type AccountId = `${ChainId}:${string}`;

@@ -12,4 +12,4 @@ import type { JsonRpcParams, JsonRpcRequest } from '@metamask/utils';

*/
export declare type OnCronjobHandler<Params extends JsonRpcParams = JsonRpcParams> = (args: {
export type OnCronjobHandler<Params extends JsonRpcParams = JsonRpcParams> = (args: {
request: JsonRpcRequest<Params>;
}) => Promise<unknown>;

@@ -11,3 +11,3 @@ import type { ComponentOrElement } from '..';

*/
export declare type OnHomePageHandler = () => Promise<OnHomePageResponse>;
export type OnHomePageHandler = () => Promise<OnHomePageResponse>;
/**

@@ -19,3 +19,3 @@ * The content to display on the home page.

*/
export declare type OnHomePageResponse = {
export type OnHomePageResponse = {
content: ComponentOrElement;

@@ -22,0 +22,0 @@ } | {

@@ -17,5 +17,5 @@ import type { Json, JsonRpcParams, JsonRpcRequest } from '@metamask/utils';

*/
export declare type OnKeyringRequestHandler<Params extends JsonRpcParams = JsonRpcParams> = (args: {
export type OnKeyringRequestHandler<Params extends JsonRpcParams = JsonRpcParams> = (args: {
origin: string;
request: JsonRpcRequest<Params>;
}) => Promise<Json>;

@@ -11,3 +11,3 @@ /**

*/
export declare type LifecycleEventHandler = (args: {
export type LifecycleEventHandler = (args: {
origin: string;

@@ -26,3 +26,3 @@ }) => Promise<unknown>;

*/
export declare type OnInstallHandler = LifecycleEventHandler;
export type OnInstallHandler = LifecycleEventHandler;
/**

@@ -39,2 +39,2 @@ * The `onUpdate` handler. This is called after the Snap is updated.

*/
export declare type OnUpdateHandler = LifecycleEventHandler;
export type OnUpdateHandler = LifecycleEventHandler;
import type { NonEmptyArray } from '@metamask/utils';
import type { ChainId } from '../caip';
declare type BaseOnNameLookupArgs = {
type BaseOnNameLookupArgs = {
chainId: ChainId;

@@ -11,3 +11,3 @@ };

*/
export declare type DomainLookupArgs = BaseOnNameLookupArgs & {
export type DomainLookupArgs = BaseOnNameLookupArgs & {
domain: string;

@@ -21,3 +21,3 @@ address?: never;

*/
export declare type AddressLookupArgs = BaseOnNameLookupArgs & {
export type AddressLookupArgs = BaseOnNameLookupArgs & {
address: string;

@@ -32,3 +32,3 @@ domain?: never;

*/
export declare type AddressResolution = {
export type AddressResolution = {
protocol: string;

@@ -44,3 +44,3 @@ resolvedAddress: string;

*/
export declare type DomainResolution = {
export type DomainResolution = {
protocol: string;

@@ -54,3 +54,3 @@ resolvedDomain: string;

*/
export declare type DomainLookupResult = {
export type DomainLookupResult = {
resolvedAddresses: NonEmptyArray<AddressResolution>;

@@ -64,3 +64,3 @@ resolvedDomains?: never;

*/
export declare type AddressLookupResult = {
export type AddressLookupResult = {
resolvedDomains: NonEmptyArray<DomainResolution>;

@@ -86,3 +86,3 @@ resolvedAddresses?: never;

*/
export declare type OnNameLookupHandler = (args: AddressLookupArgs | DomainLookupArgs) => Promise<AddressLookupResult | DomainLookupResult | null>;
export type OnNameLookupHandler = (args: AddressLookupArgs | DomainLookupArgs) => Promise<AddressLookupResult | DomainLookupResult | null>;
export {};

@@ -18,5 +18,5 @@ import type { Json, JsonRpcParams, JsonRpcRequest } from '@metamask/utils';

*/
export declare type OnRpcRequestHandler<Params extends JsonRpcParams = JsonRpcParams> = (args: {
export type OnRpcRequestHandler<Params extends JsonRpcParams = JsonRpcParams> = (args: {
origin: string;
request: JsonRpcRequest<Params>;
}) => Promise<Json>;

@@ -11,3 +11,3 @@ import type { EnumToUnion } from '../../internals';

*/
export declare type EthSignature = {
export type EthSignature = {
from: string;

@@ -24,3 +24,3 @@ data: string;

*/
export declare type PersonalSignature = {
export type PersonalSignature = {
from: string;

@@ -37,3 +37,3 @@ data: string;

*/
export declare type SignTypedDataSignature = {
export type SignTypedDataSignature = {
from: string;

@@ -50,3 +50,3 @@ data: Record<string, any>[];

*/
export declare type SignTypedDataV3Signature = {
export type SignTypedDataV3Signature = {
from: string;

@@ -63,3 +63,3 @@ data: Record<string, any>;

*/
export declare type SignTypedDataV4Signature = {
export type SignTypedDataV4Signature = {
from: string;

@@ -78,3 +78,3 @@ data: Record<string, any>;

*/
export declare type Signature = EthSignature | PersonalSignature | SignTypedDataSignature | SignTypedDataV3Signature | SignTypedDataV4Signature;
export type Signature = EthSignature | PersonalSignature | SignTypedDataSignature | SignTypedDataV3Signature | SignTypedDataV4Signature;
/**

@@ -99,3 +99,3 @@ * The `onSignature` handler. This is called whenever a signature is

*/
export declare type OnSignatureHandler = (args: {
export type OnSignatureHandler = (args: {
signature: Signature;

@@ -112,3 +112,3 @@ signatureOrigin?: string;

*/
export declare type OnSignatureResponse = {
export type OnSignatureResponse = {
content: Component;

@@ -115,0 +115,0 @@ severity?: EnumToUnion<SeverityLevel>;

@@ -30,3 +30,3 @@ import type { ComponentOrElement } from '..';

*/
export declare type EIP1559Transaction = {
export type EIP1559Transaction = {
from: string;

@@ -56,3 +56,3 @@ to: string;

*/
export declare type LegacyTransaction = {
export type LegacyTransaction = {
from: string;

@@ -75,3 +75,3 @@ to: string;

*/
export declare type Transaction = EIP1559Transaction | LegacyTransaction;
export type Transaction = EIP1559Transaction | LegacyTransaction;
/**

@@ -98,3 +98,3 @@ * The `onTransaction` handler. This is called whenever a transaction is

*/
export declare type OnTransactionHandler = (args: {
export type OnTransactionHandler = (args: {
transaction: Transaction;

@@ -112,3 +112,3 @@ chainId: ChainId;

*/
export declare type OnTransactionResponse = {
export type OnTransactionResponse = {
content: ComponentOrElement;

@@ -115,0 +115,0 @@ severity?: EnumToUnion<SeverityLevel>;

@@ -40,3 +40,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type ButtonClickEvent = Infer<typeof ButtonClickEventStruct>;
export type ButtonClickEvent = Infer<typeof ButtonClickEventStruct>;
export declare const FileStruct: import("@metamask/superstruct").Struct<{

@@ -62,3 +62,3 @@ name: string;

*/
export declare type File = Infer<typeof FileStruct>;
export type File = Infer<typeof FileStruct>;
export declare const FormSubmitEventStruct: import("@metamask/superstruct").Struct<{

@@ -96,3 +96,3 @@ value: Record<string, string | boolean | {

*/
export declare type FormSubmitEvent = Infer<typeof FormSubmitEventStruct>;
export type FormSubmitEvent = Infer<typeof FormSubmitEventStruct>;
export declare const InputChangeEventStruct: import("@metamask/superstruct").Struct<{

@@ -115,3 +115,3 @@ value: string | boolean;

*/
export declare type InputChangeEvent = Infer<typeof InputChangeEventStruct>;
export type InputChangeEvent = Infer<typeof InputChangeEventStruct>;
export declare const FileUploadEventStruct: import("@metamask/superstruct").Struct<{

@@ -151,3 +151,3 @@ type: UserInputEventType.FileUploadEvent;

*/
export declare type FileUploadEvent = Infer<typeof FileUploadEventStruct>;
export type FileUploadEvent = Infer<typeof FileUploadEventStruct>;
export declare const UserInputEventStruct: import("@metamask/superstruct").Struct<{

@@ -188,3 +188,3 @@ type: UserInputEventType.ButtonClickEvent;

*/
export declare type UserInputEvent = ButtonClickEvent | FormSubmitEvent | InputChangeEvent | FileUploadEvent;
export type UserInputEvent = ButtonClickEvent | FormSubmitEvent | InputChangeEvent | FileUploadEvent;
/**

@@ -197,3 +197,3 @@ * The `onUserInput` handler. This is called when an user input event is fired in the UI.

*/
export declare type OnUserInputHandler = (args: {
export type OnUserInputHandler = (args: {
id: string;

@@ -200,0 +200,0 @@ event: UserInputEvent;

@@ -33,6 +33,6 @@ import type { Infer } from '@metamask/superstruct';

} | null> | null>, null>;
export declare type State = Infer<typeof StateStruct>;
export declare type FormState = Infer<typeof FormStateStruct>;
export declare type InterfaceState = Infer<typeof InterfaceStateStruct>;
export declare type ComponentOrElement = Component | JSXElement;
export type State = Infer<typeof StateStruct>;
export type FormState = Infer<typeof FormStateStruct>;
export type InterfaceState = Infer<typeof InterfaceStateStruct>;
export type ComponentOrElement = Component | JSXElement;
export declare const ComponentOrElementStruct: import("@metamask/superstruct").Struct<{

@@ -106,3 +106,10 @@ value: string;

})[];
} | import("../jsx").SnapElement<import("../jsx").ButtonProps, "Button"> | import("../jsx").SnapElement<import("../jsx").CheckboxProps, "Checkbox"> | import("../jsx").SnapElement<import("../jsx").FormProps, "Form"> | import("../jsx").SnapElement<import("../jsx").InputProps, "Input"> | import("../jsx").SnapElement<import("../jsx").DropdownProps, "Dropdown"> | import("../jsx").SnapElement<import("../jsx").FileInputProps, "FileInput"> | import("../jsx").SnapElement<import("../jsx").BoldProps, "Bold"> | import("../jsx").SnapElement<import("../jsx").ItalicProps, "Italic"> | import("../jsx").SnapElement<import("../jsx").AddressProps, "Address"> | import("../jsx").SnapElement<import("../jsx").BoxProps, "Box"> | import("../jsx").SnapElement<import("../jsx").CardProps, "Card"> | import("../jsx").SnapElement<import("../jsx").ContainerProps, "Container"> | import("../jsx").SnapElement<import("../jsx").CopyableProps, "Copyable"> | import("../jsx").SnapElement<Record<string, never>, "Divider"> | import("../jsx").SnapElement<{
} | import("../jsx").SnapElement<import("../jsx").ButtonProps, "Button"> | import("../jsx").SnapElement<import("../jsx").CheckboxProps, "Checkbox"> | import("../jsx").SnapElement<import("../jsx").FormProps, "Form"> | import("../jsx").SnapElement<import("../jsx").InputProps, "Input"> | import("../jsx").SnapElement<import("../jsx").DropdownProps, "Dropdown"> | import("../jsx").SnapElement<{
name: string;
value?: string | undefined;
children: import("../jsx").SnapsChildren<import("../jsx").SnapElement<{
value: string;
children: string;
}, "Radio">>;
}, "RadioGroup"> | import("../jsx").SnapElement<import("../jsx").FileInputProps, "FileInput"> | import("../jsx").SnapElement<import("../jsx").BoldProps, "Bold"> | import("../jsx").SnapElement<import("../jsx").ItalicProps, "Italic"> | import("../jsx").SnapElement<import("../jsx").AddressProps, "Address"> | import("../jsx").SnapElement<import("../jsx").BoxProps, "Box"> | import("../jsx").SnapElement<import("../jsx").CardProps, "Card"> | import("../jsx").SnapElement<import("../jsx").ContainerProps, "Container"> | import("../jsx").SnapElement<import("../jsx").CopyableProps, "Copyable"> | import("../jsx").SnapElement<Record<string, never>, "Divider"> | import("../jsx").SnapElement<{
children: import("../jsx").StringElement;

@@ -114,2 +121,2 @@ }, "Heading"> | import("../jsx").SnapElement<{

export declare const InterfaceContextStruct: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
export declare type InterfaceContext = Infer<typeof InterfaceContextStruct>;
export type InterfaceContext = Infer<typeof InterfaceContextStruct>;

@@ -7,3 +7,3 @@ import type { ComponentOrElement, InterfaceContext } from '..';

*/
export declare type CreateInterfaceParams = {
export type CreateInterfaceParams = {
ui: ComponentOrElement;

@@ -15,2 +15,2 @@ context?: InterfaceContext;

*/
export declare type CreateInterfaceResult = string;
export type CreateInterfaceResult = string;

@@ -17,3 +17,3 @@ import type { Json } from '@metamask/utils';

}
export declare type DefaultDialog = {
export type DefaultDialog = {
id: string;

@@ -30,3 +30,3 @@ } | {

*/
export declare type AlertDialog = {
export type AlertDialog = {
type: EnumToUnion<DialogType.Alert>;

@@ -45,3 +45,3 @@ content: ComponentOrElement;

*/
export declare type ConfirmationDialog = {
export type ConfirmationDialog = {
type: EnumToUnion<DialogType.Confirmation>;

@@ -62,3 +62,3 @@ content: ComponentOrElement;

*/
export declare type PromptDialog = {
export type PromptDialog = {
type: EnumToUnion<DialogType.Prompt>;

@@ -81,3 +81,3 @@ content: ComponentOrElement;

*/
export declare type DialogParams = AlertDialog | ConfirmationDialog | PromptDialog | DefaultDialog;
export type DialogParams = AlertDialog | ConfirmationDialog | PromptDialog | DefaultDialog;
/**

@@ -92,2 +92,2 @@ * The result returned by the `snap_dialog` method.

*/
export declare type DialogResult = null | boolean | string | Json;
export type DialogResult = null | boolean | string | Json;

@@ -9,3 +9,3 @@ import type { JsonSLIP10Node } from '@metamask/key-tree';

*/
export declare type GetBip32EntropyParams = Bip32Entropy;
export type GetBip32EntropyParams = Bip32Entropy;
/**

@@ -16,2 +16,2 @@ * The result returned by the `snap_getBip32Entropy` method.

*/
export declare type GetBip32EntropyResult = JsonSLIP10Node;
export type GetBip32EntropyResult = JsonSLIP10Node;

@@ -10,3 +10,3 @@ import type { Bip32Entropy } from '../permissions';

*/
export declare type GetBip32PublicKeyParams = Bip32Entropy & {
export type GetBip32PublicKeyParams = Bip32Entropy & {
compressed?: boolean;

@@ -20,2 +20,2 @@ };

*/
export declare type GetBip32PublicKeyResult = string;
export type GetBip32PublicKeyResult = string;

@@ -8,3 +8,3 @@ import type { JsonBIP44CoinTypeNode } from '@metamask/key-tree';

*/
export declare type GetBip44EntropyParams = Bip44Entropy;
export type GetBip44EntropyParams = Bip44Entropy;
/**

@@ -15,2 +15,2 @@ * The result returned by the `snap_getBip44Entropy` method.

*/
export declare type GetBip44EntropyResult = JsonBIP44CoinTypeNode;
export type GetBip44EntropyResult = JsonBIP44CoinTypeNode;

@@ -6,3 +6,3 @@ /**

*/
export declare type GetClientStatusParams = never;
export type GetClientStatusParams = never;
/**

@@ -13,4 +13,4 @@ * The result returned by the `snap_getClientStatus` method.

*/
export declare type GetClientStatusResult = {
export type GetClientStatusResult = {
locked: boolean;
};

@@ -9,3 +9,3 @@ import type { Hex } from '@metamask/utils';

*/
export declare type GetEntropyParams = {
export type GetEntropyParams = {
version: 1;

@@ -17,2 +17,2 @@ salt?: string;

*/
export declare type GetEntropyResult = Hex;
export type GetEntropyResult = Hex;

@@ -16,3 +16,3 @@ import type { EnumToUnion } from '../../internals';

*/
export declare type GetFileParams = {
export type GetFileParams = {
path: string;

@@ -24,2 +24,2 @@ encoding?: EnumToUnion<AuxiliaryFileEncoding>;

*/
export declare type GetFileResult = string;
export type GetFileResult = string;

@@ -7,3 +7,3 @@ import type { InterfaceState } from '../interface';

*/
export declare type GetInterfaceStateParams = {
export type GetInterfaceStateParams = {
id: string;

@@ -14,2 +14,2 @@ };

*/
export declare type GetInterfaceStateResult = InterfaceState;
export type GetInterfaceStateResult = InterfaceState;

@@ -6,3 +6,3 @@ /**

*/
export declare type GetLocaleParams = never;
export type GetLocaleParams = never;
/**

@@ -13,2 +13,2 @@ * The result returned by the `snap_getLocale` method.

*/
export declare type GetLocaleResult = string;
export type GetLocaleResult = string;

@@ -8,3 +8,3 @@ import type { JsonRpcError } from '@metamask/utils';

*/
export declare type GetSnapsParams = never;
export type GetSnapsParams = never;
/**

@@ -15,4 +15,4 @@ * The result returned by the `wallet_getSnaps` method.

*/
export declare type GetSnapsResult = Record<SnapId, {
export type GetSnapsResult = Record<SnapId, {
error: JsonRpcError;
} | Snap>;

@@ -11,2 +11,3 @@ export * from './create-interface';

export * from './get-locale';
export * from './get-preferences';
export * from './get-snaps';

@@ -13,0 +14,0 @@ export * from './invoke-keyring';

@@ -9,3 +9,3 @@ import type { Json } from '@metamask/utils';

*/
export declare type InvokeKeyringParams = InvokeSnapParams;
export type InvokeKeyringParams = InvokeSnapParams;
/**

@@ -15,2 +15,2 @@ * The result returned by the `wallet_invokeKeyring` method, which is the result

*/
export declare type InvokeKeyringResult = Json;
export type InvokeKeyringResult = Json;

@@ -8,3 +8,3 @@ import type { Json } from '@metamask/utils';

*/
export declare type InvokeSnapParams = {
export type InvokeSnapParams = {
snapId: string;

@@ -17,2 +17,2 @@ request: Record<string, Json>;

*/
export declare type InvokeSnapResult = Json;
export type InvokeSnapResult = Json;

@@ -8,3 +8,3 @@ import type { Json } from '@metamask/utils';

*/
export declare type ManageAccountsParams = {
export type ManageAccountsParams = {
method: string;

@@ -19,2 +19,2 @@ } | {

*/
export declare type ManageAccountsResult = Json;
export type ManageAccountsResult = Json;

@@ -20,3 +20,3 @@ import type { Json } from '@metamask/utils';

*/
export declare type ClearStateOperation = {
export type ClearStateOperation = {
operation: EnumToUnion<ManageStateOperation.ClearState>;

@@ -34,3 +34,3 @@ encrypted?: boolean;

*/
export declare type GetStateOperation = {
export type GetStateOperation = {
operation: EnumToUnion<ManageStateOperation.GetState>;

@@ -50,3 +50,3 @@ encrypted?: boolean;

*/
export declare type UpdateStateOperation = {
export type UpdateStateOperation = {
operation: EnumToUnion<ManageStateOperation.UpdateState>;

@@ -65,3 +65,3 @@ encrypted?: boolean;

*/
export declare type ManageStateParams = ClearStateOperation | GetStateOperation | UpdateStateOperation;
export type ManageStateParams = ClearStateOperation | GetStateOperation | UpdateStateOperation;
/**

@@ -73,2 +73,2 @@ * The result returned by the `snap_manageState` method.

*/
export declare type ManageStateResult = Record<string, Json> | null;
export type ManageStateResult = Record<string, Json> | null;

@@ -12,2 +12,3 @@ import type { Method } from '../../internals';

import type { GetLocaleParams, GetLocaleResult } from './get-locale';
import type { GetPreferencesParams, GetPreferencesResult } from './get-preferences';
import type { GetSnapsParams, GetSnapsResult } from './get-snaps';

@@ -26,3 +27,3 @@ import type { InvokeKeyringParams, InvokeKeyringResult } from './invoke-keyring';

*/
export declare type SnapMethods = {
export type SnapMethods = {
snap_dialog: [DialogParams, DialogResult];

@@ -36,2 +37,3 @@ snap_getBip32Entropy: [GetBip32EntropyParams, GetBip32EntropyResult];

snap_getLocale: [GetLocaleParams, GetLocaleResult];
snap_getPreferences: [GetPreferencesParams, GetPreferencesResult];
snap_manageAccounts: [ManageAccountsParams, ManageAccountsResult];

@@ -75,2 +77,2 @@ snap_manageState: [ManageStateParams, ManageStateResult];

*/
export declare type RequestFunction = <MethodName extends keyof SnapMethods>(request: Method<MethodName, SnapMethods[MethodName][0]>) => Promise<SnapMethods[MethodName][1]>;
export type RequestFunction = <MethodName extends keyof SnapMethods>(request: Method<MethodName, SnapMethods[MethodName][0]>) => Promise<SnapMethods[MethodName][1]>;

@@ -18,3 +18,3 @@ import type { EnumToUnion } from '../../internals';

*/
export declare type NotifyParams = {
export type NotifyParams = {
type: EnumToUnion<NotificationType>;

@@ -28,2 +28,2 @@ message: string;

*/
export declare type NotifyResult = null;
export type NotifyResult = null;

@@ -8,3 +8,3 @@ import type { JsonRpcError } from '@metamask/utils';

*/
export declare type RequestSnapsParams = Record<string, {
export type RequestSnapsParams = Record<string, {
version?: string;

@@ -17,4 +17,4 @@ }>;

*/
export declare type RequestSnapsResult = Record<string, {
export type RequestSnapsResult = Record<string, {
error: JsonRpcError;
} | Snap>;

@@ -8,3 +8,3 @@ import type { Json } from '@metamask/utils';

*/
export declare type ResolveInterfaceParams = {
export type ResolveInterfaceParams = {
id: string;

@@ -16,2 +16,2 @@ value: Json;

*/
export declare type ResolveInterfaceResult = null;
export type ResolveInterfaceResult = null;

@@ -8,3 +8,3 @@ import type { ComponentOrElement } from '..';

*/
export declare type UpdateInterfaceParams = {
export type UpdateInterfaceParams = {
id: string;

@@ -16,2 +16,2 @@ ui: ComponentOrElement;

*/
export declare type UpdateInterfaceResult = null;
export type UpdateInterfaceResult = null;
import type { SupportedCurve } from '@metamask/key-tree';
import type { JsonRpcRequest } from '@metamask/utils';
import type { ChainId } from './caip';
export declare type EmptyObject = Record<string, never>;
export declare type Cronjob = {
export type EmptyObject = Record<string, never>;
export type Cronjob = {
expression: string;
request: Omit<JsonRpcRequest, 'jsonrpc' | 'id'>;
};
export declare type NameLookupMatchers = {
export type NameLookupMatchers = {
tlds: string[];

@@ -17,13 +17,13 @@ } | {

};
export declare type Bip32Entropy = {
export type Bip32Entropy = {
curve: SupportedCurve;
path: string[];
};
export declare type Bip44Entropy = {
export type Bip44Entropy = {
coinType: number;
};
export declare type RequestedSnap = {
export type RequestedSnap = {
version?: string;
};
export declare type InitialPermissions = Partial<{
export type InitialPermissions = Partial<{
'endowment:cronjob': {

@@ -30,0 +30,0 @@ jobs: Cronjob[];

import type { BaseProvider } from '@metamask/providers';
import type { RequestFunction } from './methods';
declare type BaseProviderInstance = InstanceType<typeof BaseProvider>;
type BaseProviderInstance = InstanceType<typeof BaseProvider>;
/**
* The `window.ethereum` provider for Snaps.
*/
export declare type SnapsEthereumProvider = Pick<BaseProviderInstance, 'request'>;
export type SnapsEthereumProvider = Pick<BaseProviderInstance, 'request'>;
/**
* The `window.snap` provider.
*/
export declare type SnapsProvider = {
export type SnapsProvider = {
request: RequestFunction;
};
export {};
import type { SemVerVersion, Opaque } from '@metamask/utils';
import type { InitialPermissions } from './permissions';
export declare type SnapId = Opaque<string, typeof snapIdSymbol>;
export type SnapId = Opaque<string, typeof snapIdSymbol>;
declare const snapIdSymbol: unique symbol;
export declare type Snap = {
export type Snap = {
id: SnapId;

@@ -7,0 +7,0 @@ initialPermissions: InitialPermissions;

@@ -10,3 +10,3 @@ import type { Struct } from '@metamask/superstruct';

*/
declare type NodeBuilder<Node extends Component, Keys extends (keyof Node)[]> = Omit<Node, 'type'> extends Record<string, never> ? (...args: []) => Node : (...args: [Omit<Node, 'type'>] | NodeArrayType<Node, Keys>) => Node;
type NodeBuilder<Node extends Component, Keys extends (keyof Node)[]> = Omit<Node, 'type'> extends Record<string, never> ? (...args: []) => Node : (...args: [Omit<Node, 'type'>] | NodeArrayType<Node, Keys>) => Node;
/**

@@ -22,3 +22,3 @@ * Map from an array of node keys to the corresponding array type.

*/
declare type NodeArrayType<Node extends Component, Keys extends (keyof Node)[]> = {
type NodeArrayType<Node extends Component, Keys extends (keyof Node)[]> = {
[Key in keyof Keys]: Node[Keys[Key]];

@@ -25,0 +25,0 @@ };

@@ -16,3 +16,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Address = Infer<typeof AddressStruct>;
export type Address = Infer<typeof AddressStruct>;
/**

@@ -19,0 +19,0 @@ * Create an {@link Address} node.

@@ -33,3 +33,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Button = Infer<typeof ButtonStruct>;
export type Button = Infer<typeof ButtonStruct>;
/**

@@ -36,0 +36,0 @@ * Create a {@link Button} node.

@@ -23,3 +23,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Copyable = Infer<typeof CopyableStruct>;
export type Copyable = Infer<typeof CopyableStruct>;
/**

@@ -26,0 +26,0 @@ * Create a {@link Copyable} component.

@@ -11,3 +11,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Divider = Infer<typeof DividerStruct>;
export type Divider = Infer<typeof DividerStruct>;
/**

@@ -14,0 +14,0 @@ * Create a {@link Divider} node.

@@ -21,3 +21,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type FormComponent = Infer<typeof FormComponentStruct>;
export type FormComponent = Infer<typeof FormComponentStruct>;
export declare const FormStruct: import("@metamask/superstruct").Struct<{

@@ -81,3 +81,3 @@ type: NodeType.Form;

*/
export declare type Form = Infer<typeof FormStruct>;
export type Form = Infer<typeof FormStruct>;
/**

@@ -84,0 +84,0 @@ * Create a {@link Form} node.

@@ -18,3 +18,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Heading = Infer<typeof HeadingStruct>;
export type Heading = Infer<typeof HeadingStruct>;
/**

@@ -21,0 +21,0 @@ * Create a {@link Heading} node.

@@ -16,3 +16,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Image = Infer<typeof ImageStruct>;
export type Image = Infer<typeof ImageStruct>;
/**

@@ -19,0 +19,0 @@ * Create an {@link Image} node.

@@ -40,3 +40,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Input = Infer<typeof InputStruct>;
export type Input = Infer<typeof InputStruct>;
/**

@@ -43,0 +43,0 @@ * Create a {@link Input} node.

@@ -225,3 +225,3 @@ import type { Infer, Struct } from '@metamask/superstruct';

*/
export declare type Parent = Infer<typeof ParentStruct>;
export type Parent = Infer<typeof ParentStruct>;
/**

@@ -238,3 +238,3 @@ * @internal

*/
export declare type Panel = {
export type Panel = {
type: NodeType.Panel;

@@ -407,2 +407,2 @@ children: Component[];

*/
export declare type Component = Infer<typeof ComponentStruct>;
export type Component = Infer<typeof ComponentStruct>;

@@ -48,3 +48,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Row = Infer<typeof RowStruct>;
export type Row = Infer<typeof RowStruct>;
/**

@@ -51,0 +51,0 @@ * Create a {@link Row} node.

@@ -12,3 +12,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Spinner = Infer<typeof SpinnerStruct>;
export type Spinner = Infer<typeof SpinnerStruct>;
/**

@@ -15,0 +15,0 @@ * Create a {@link Spinner} node.

@@ -21,3 +21,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Text = Infer<typeof TextStruct>;
export type Text = Infer<typeof TextStruct>;
/**

@@ -24,0 +24,0 @@ * Create a {@link Text} node.

@@ -36,3 +36,3 @@ import type { Infer } from '@metamask/superstruct';

*/
export declare type Node = Infer<typeof NodeStruct>;
export type Node = Infer<typeof NodeStruct>;
/**

@@ -57,2 +57,2 @@ * @internal

*/
export declare type Literal = Infer<typeof LiteralStruct>;
export type Literal = Infer<typeof LiteralStruct>;
{
"name": "@metamask/snaps-sdk",
"version": "6.1.1",
"version": "6.2.0",
"repository": {

@@ -98,3 +98,3 @@ "type": "git",

"tsup": "^8.0.1",
"typescript": "~4.8.4"
"typescript": "~5.0.4"
},

@@ -101,0 +101,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc