@metamask/snaps-utils 7.8.1 → 8.0.1
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.
- package/CHANGELOG.md +13 -1
- package/dist/array.js +1 -1
- package/dist/array.mjs +1 -1
- package/dist/auxiliary-files.js +1 -1
- package/dist/auxiliary-files.mjs +1 -1
- package/dist/base64.js +1 -1
- package/dist/base64.mjs +1 -1
- package/dist/bytes.js +1 -1
- package/dist/bytes.mjs +1 -1
- package/dist/caveats.js +1 -1
- package/dist/caveats.mjs +1 -1
- package/dist/checksum.js +1 -1
- package/dist/checksum.mjs +1 -1
- package/dist/{chunk-5I5WPAVD.js → chunk-37EUH3KZ.js} +13 -13
- package/dist/{chunk-FLSK6ISS.mjs → chunk-3N27GIUS.mjs} +4 -1
- package/dist/chunk-3N27GIUS.mjs.map +1 -0
- package/dist/{chunk-SB43G2RI.js → chunk-3OXW5H4F.js} +5 -5
- package/dist/{chunk-K6BCBPXF.js → chunk-3RFGTBEP.js} +11 -11
- package/dist/{chunk-JMDSN227.mjs → chunk-3RUWAMJT.mjs} +7 -1
- package/dist/chunk-4BGZ2CHC.mjs +22 -0
- package/dist/chunk-4BGZ2CHC.mjs.map +1 -0
- package/dist/chunk-4RYTYEUQ.mjs +33 -0
- package/dist/chunk-4RYTYEUQ.mjs.map +1 -0
- package/dist/{chunk-VOPTAKVG.js → chunk-53QXTM77.js} +4 -1
- package/dist/chunk-53QXTM77.js.map +1 -0
- package/dist/chunk-5FTBWYCW.mjs +27 -0
- package/dist/chunk-5FTBWYCW.mjs.map +1 -0
- package/dist/chunk-5MABKEV7.mjs +66 -0
- package/dist/chunk-5MABKEV7.mjs.map +1 -0
- package/dist/chunk-5UAPBOKO.js +37 -0
- package/dist/chunk-5UAPBOKO.js.map +1 -0
- package/dist/chunk-6YJWU77L.js +19 -0
- package/dist/chunk-6YJWU77L.js.map +1 -0
- package/dist/chunk-7T7FYH77.mjs +37 -0
- package/dist/chunk-7T7FYH77.mjs.map +1 -0
- package/dist/chunk-BPK5BH7K.js +27 -0
- package/dist/chunk-BPK5BH7K.js.map +1 -0
- package/dist/chunk-CPG2UGAA.js +25 -0
- package/dist/chunk-CPG2UGAA.js.map +1 -0
- package/dist/chunk-DKO64Y4H.mjs +27 -0
- package/dist/chunk-DKO64Y4H.mjs.map +1 -0
- package/dist/chunk-EYWMVDCD.mjs +25 -0
- package/dist/chunk-EYWMVDCD.mjs.map +1 -0
- package/dist/chunk-FA4QIZH6.js +1 -0
- package/dist/chunk-GIVJAZ2Q.mjs +248 -0
- package/dist/chunk-GIVJAZ2Q.mjs.map +1 -0
- package/dist/chunk-GJAVOB7B.js +24 -0
- package/dist/chunk-GJAVOB7B.js.map +1 -0
- package/dist/{chunk-ZXHR322P.mjs → chunk-GXSTPU7D.mjs} +4 -4
- package/dist/chunk-HY4W6BUH.mjs +24 -0
- package/dist/chunk-HY4W6BUH.mjs.map +1 -0
- package/dist/{chunk-YNOZU43P.mjs → chunk-IPUL74MZ.mjs} +3 -3
- package/dist/chunk-IVDERT5W.js +22 -0
- package/dist/chunk-IVDERT5W.js.map +1 -0
- package/dist/chunk-JETPRED3.js +248 -0
- package/dist/chunk-JETPRED3.js.map +1 -0
- package/dist/chunk-L2DHOOBX.js +33 -0
- package/dist/chunk-L2DHOOBX.js.map +1 -0
- package/dist/chunk-LQSEBGOX.js +34 -0
- package/dist/chunk-LQSEBGOX.js.map +1 -0
- package/dist/chunk-MDOG3S4V.mjs +34 -0
- package/dist/chunk-MDOG3S4V.mjs.map +1 -0
- package/dist/chunk-MFGLB75H.mjs +22 -0
- package/dist/chunk-MFGLB75H.mjs.map +1 -0
- package/dist/chunk-MQURBEO4.mjs +16 -0
- package/dist/chunk-MQURBEO4.mjs.map +1 -0
- package/dist/{chunk-PZNIU23I.js → chunk-MWAZGSRO.js} +2 -22
- package/dist/chunk-MWAZGSRO.js.map +1 -0
- package/dist/{chunk-AJNKQYKP.mjs → chunk-N2JAYIUP.mjs} +2 -22
- package/dist/chunk-N2JAYIUP.mjs.map +1 -0
- package/dist/chunk-N4MA537G.js +22 -0
- package/dist/chunk-N4MA537G.js.map +1 -0
- package/dist/chunk-NNYGTNHP.mjs +1 -0
- package/dist/{chunk-H35ZUVQT.mjs → chunk-NSVVZNSD.mjs} +3 -13
- package/dist/chunk-NSVVZNSD.mjs.map +1 -0
- package/dist/chunk-PAOTMYIM.mjs +69 -0
- package/dist/chunk-PAOTMYIM.mjs.map +1 -0
- package/dist/chunk-PO5BBHHX.mjs +22 -0
- package/dist/chunk-PO5BBHHX.mjs.map +1 -0
- package/dist/{chunk-VWGXNUMD.mjs → chunk-PZF4KWU2.mjs} +2 -2
- package/dist/chunk-QD3LTING.js +34 -0
- package/dist/chunk-QD3LTING.js.map +1 -0
- package/dist/chunk-RNMJQSVQ.js +69 -0
- package/dist/chunk-RNMJQSVQ.js.map +1 -0
- package/dist/chunk-RRFKK45V.mjs +15 -0
- package/dist/chunk-RRFKK45V.mjs.map +1 -0
- package/dist/{chunk-PHUTP7NB.js → chunk-S3BWTUTZ.js} +9 -3
- package/dist/chunk-SKKANJ45.mjs +19 -0
- package/dist/chunk-SKKANJ45.mjs.map +1 -0
- package/dist/chunk-SYYDKPK3.js +15 -0
- package/dist/chunk-SYYDKPK3.js.map +1 -0
- package/dist/chunk-T5ZOOZ46.js +22 -0
- package/dist/chunk-T5ZOOZ46.js.map +1 -0
- package/dist/{chunk-RD6BN2TQ.js → chunk-TAMKWZ4E.js} +8 -18
- package/dist/chunk-TAMKWZ4E.js.map +1 -0
- package/dist/chunk-TYWGZIOF.mjs +34 -0
- package/dist/chunk-TYWGZIOF.mjs.map +1 -0
- package/dist/chunk-VBYSWMSU.js +66 -0
- package/dist/chunk-VBYSWMSU.js.map +1 -0
- package/dist/chunk-VEPYH26P.js +27 -0
- package/dist/chunk-VEPYH26P.js.map +1 -0
- package/dist/chunk-VWLBM7XM.js +1 -0
- package/dist/chunk-W7A3BYUP.mjs +1 -0
- package/dist/chunk-YL2EHYAA.js +16 -0
- package/dist/chunk-YL2EHYAA.js.map +1 -0
- package/dist/constants.js +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/cronjob.js +1 -1
- package/dist/cronjob.mjs +1 -1
- package/dist/deep-clone.js +1 -1
- package/dist/deep-clone.mjs +1 -1
- package/dist/default-endowments.js +1 -1
- package/dist/default-endowments.mjs +1 -1
- package/dist/derivation-paths.js +1 -1
- package/dist/derivation-paths.mjs +1 -1
- package/dist/entropy.js +1 -1
- package/dist/entropy.mjs +1 -1
- package/dist/errors.js +3 -3
- package/dist/errors.mjs +2 -2
- package/dist/eval-worker.js +1 -1
- package/dist/eval-worker.mjs +1 -1
- package/dist/eval.js +1 -1
- package/dist/eval.mjs +1 -1
- package/dist/fs.js +1 -1
- package/dist/fs.mjs +1 -1
- package/dist/handler-types.js +1 -1
- package/dist/handler-types.mjs +1 -1
- package/dist/handlers.js +1 -1
- package/dist/handlers.mjs +1 -1
- package/dist/icon.js +1 -1
- package/dist/icon.mjs +1 -1
- package/dist/iframe.js +1 -1
- package/dist/iframe.mjs +1 -1
- package/dist/index.executionenv.js +5 -11
- package/dist/index.executionenv.mjs +9 -15
- package/dist/index.js +11 -18
- package/dist/index.mjs +15 -22
- package/dist/json-rpc.js +1 -1
- package/dist/json-rpc.mjs +1 -1
- package/dist/json.js +1 -1
- package/dist/json.mjs +1 -1
- package/dist/localization.js +1 -1
- package/dist/localization.mjs +1 -1
- package/dist/logging.js +1 -1
- package/dist/logging.mjs +1 -1
- package/dist/manifest/index.js +6 -6
- package/dist/manifest/index.mjs +5 -5
- package/dist/manifest/manifest.js +23 -9
- package/dist/manifest/manifest.mjs +24 -10
- package/dist/manifest/node.js +23 -9
- package/dist/manifest/node.mjs +24 -10
- package/dist/manifest/validation.js +6 -6
- package/dist/manifest/validation.mjs +5 -5
- package/dist/manifest/validator-types.js +1 -0
- package/dist/manifest/validator-types.js.map +1 -0
- package/dist/manifest/validator-types.mjs +1 -0
- package/dist/manifest/validator-types.mjs.map +1 -0
- package/dist/manifest/validator.js +44 -0
- package/dist/manifest/validator.js.map +1 -0
- package/dist/manifest/validator.mjs +44 -0
- package/dist/manifest/validator.mjs.map +1 -0
- package/dist/manifest/validators/checksum.js +15 -0
- package/dist/manifest/validators/checksum.js.map +1 -0
- package/dist/manifest/validators/checksum.mjs +15 -0
- package/dist/manifest/validators/checksum.mjs.map +1 -0
- package/dist/manifest/validators/expected-files.js +9 -0
- package/dist/manifest/validators/expected-files.js.map +1 -0
- package/dist/manifest/validators/expected-files.mjs +9 -0
- package/dist/manifest/validators/expected-files.mjs.map +1 -0
- package/dist/manifest/validators/icon-declared.js +8 -0
- package/dist/manifest/validators/icon-declared.js.map +1 -0
- package/dist/manifest/validators/icon-declared.mjs +8 -0
- package/dist/manifest/validators/icon-declared.mjs.map +1 -0
- package/dist/manifest/validators/icon-dimensions.js +10 -0
- package/dist/manifest/validators/icon-dimensions.js.map +1 -0
- package/dist/manifest/validators/icon-dimensions.mjs +10 -0
- package/dist/manifest/validators/icon-dimensions.mjs.map +1 -0
- package/dist/manifest/validators/icon-missing.js +8 -0
- package/dist/manifest/validators/icon-missing.js.map +1 -0
- package/dist/manifest/validators/icon-missing.mjs +8 -0
- package/dist/manifest/validators/icon-missing.mjs.map +1 -0
- package/dist/manifest/validators/index.js +80 -0
- package/dist/manifest/validators/index.js.map +1 -0
- package/dist/manifest/validators/index.mjs +80 -0
- package/dist/manifest/validators/index.mjs.map +1 -0
- package/dist/manifest/validators/is-localization-file.js +12 -0
- package/dist/manifest/validators/is-localization-file.js.map +1 -0
- package/dist/manifest/validators/is-localization-file.mjs +12 -0
- package/dist/manifest/validators/is-localization-file.mjs.map +1 -0
- package/dist/manifest/validators/is-package-json.js +11 -0
- package/dist/manifest/validators/is-package-json.js.map +1 -0
- package/dist/manifest/validators/is-package-json.mjs +11 -0
- package/dist/manifest/validators/is-package-json.mjs.map +1 -0
- package/dist/manifest/validators/is-snap-icon.js +10 -0
- package/dist/manifest/validators/is-snap-icon.js.map +1 -0
- package/dist/manifest/validators/is-snap-icon.mjs +10 -0
- package/dist/manifest/validators/is-snap-icon.mjs.map +1 -0
- package/dist/manifest/validators/is-snap-manifest.js +23 -0
- package/dist/manifest/validators/is-snap-manifest.js.map +1 -0
- package/dist/manifest/validators/is-snap-manifest.mjs +23 -0
- package/dist/manifest/validators/is-snap-manifest.mjs.map +1 -0
- package/dist/manifest/validators/manifest-localization.js +10 -0
- package/dist/manifest/validators/manifest-localization.js.map +1 -0
- package/dist/manifest/validators/manifest-localization.mjs +10 -0
- package/dist/manifest/validators/manifest-localization.mjs.map +1 -0
- package/dist/manifest/validators/package-json-recommended-fields.js +8 -0
- package/dist/manifest/validators/package-json-recommended-fields.js.map +1 -0
- package/dist/manifest/validators/package-json-recommended-fields.mjs +8 -0
- package/dist/manifest/validators/package-json-recommended-fields.mjs.map +1 -0
- package/dist/manifest/validators/package-name-match.js +9 -0
- package/dist/manifest/validators/package-name-match.js.map +1 -0
- package/dist/manifest/validators/package-name-match.mjs +9 -0
- package/dist/manifest/validators/package-name-match.mjs.map +1 -0
- package/dist/manifest/validators/repository-match.js +10 -0
- package/dist/manifest/validators/repository-match.js.map +1 -0
- package/dist/manifest/validators/repository-match.mjs +10 -0
- package/dist/manifest/validators/repository-match.mjs.map +1 -0
- package/dist/manifest/validators/version-match.js +9 -0
- package/dist/manifest/validators/version-match.js.map +1 -0
- package/dist/manifest/validators/version-match.mjs +9 -0
- package/dist/manifest/validators/version-match.mjs.map +1 -0
- package/dist/mock.js +1 -1
- package/dist/mock.mjs +1 -1
- package/dist/namespace.js +1 -1
- package/dist/namespace.mjs +1 -1
- package/dist/node.js +28 -27
- package/dist/node.mjs +34 -33
- package/dist/path.js +1 -1
- package/dist/path.mjs +1 -1
- package/dist/post-process.js +1 -1
- package/dist/post-process.mjs +1 -1
- package/dist/promise.js +2 -0
- package/dist/promise.js.map +1 -0
- package/dist/promise.mjs +2 -0
- package/dist/promise.mjs.map +1 -0
- package/dist/snaps.js +4 -6
- package/dist/snaps.mjs +3 -5
- package/dist/strings.js +1 -1
- package/dist/strings.mjs +1 -1
- package/dist/structs.js +3 -3
- package/dist/structs.mjs +2 -2
- package/dist/svg.js +1 -1
- package/dist/svg.mjs +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/cronjob.d.ts +3 -3
- package/dist/types/derivation-paths.d.ts +1 -1
- package/dist/types/entropy.d.ts +1 -1
- package/dist/types/errors.d.ts +1 -1
- package/dist/types/eval.d.ts +1 -1
- package/dist/types/handler-types.d.ts +1 -1
- package/dist/types/handlers.d.ts +56 -7
- package/dist/types/index.d.ts +1 -0
- package/dist/types/json-rpc.d.ts +2 -2
- package/dist/types/localization.d.ts +1 -1
- package/dist/types/manifest/manifest.d.ts +30 -40
- package/dist/types/manifest/validation.d.ts +6 -6
- package/dist/types/manifest/validator-types.d.ts +34 -0
- package/dist/types/manifest/validator.d.ts +22 -0
- package/dist/types/manifest/validators/checksum.d.ts +5 -0
- package/dist/types/manifest/validators/expected-files.d.ts +5 -0
- package/dist/types/manifest/validators/icon-declared.d.ts +5 -0
- package/dist/types/manifest/validators/icon-dimensions.d.ts +5 -0
- package/dist/types/manifest/validators/icon-missing.d.ts +5 -0
- package/dist/types/manifest/validators/index.d.ts +14 -0
- package/dist/types/manifest/validators/is-localization-file.d.ts +5 -0
- package/dist/types/manifest/validators/is-package-json.d.ts +5 -0
- package/dist/types/manifest/validators/is-snap-icon.d.ts +5 -0
- package/dist/types/manifest/validators/is-snap-manifest.d.ts +5 -0
- package/dist/types/manifest/validators/manifest-localization.d.ts +5 -0
- package/dist/types/manifest/validators/package-json-recommended-fields.d.ts +5 -0
- package/dist/types/manifest/validators/package-name-match.d.ts +5 -0
- package/dist/types/manifest/validators/repository-match.d.ts +5 -0
- package/dist/types/manifest/validators/version-match.d.ts +5 -0
- package/dist/types/namespace.d.ts +5 -5
- package/dist/types/node.d.ts +0 -1
- package/dist/types/post-process.d.ts +3 -3
- package/dist/types/promise.d.ts +1 -0
- package/dist/types/snaps.d.ts +10 -18
- package/dist/types/structs.d.ts +2 -2
- package/dist/types/types.d.ts +9 -33
- package/dist/types/virtual-file/VirtualFile.d.ts +4 -4
- package/dist/types/virtual-file/toVirtualFile.d.ts +1 -1
- package/dist/types.js +3 -9
- package/dist/types.mjs +2 -8
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/dist/validation.js +7 -7
- package/dist/validation.mjs +6 -6
- package/dist/versions.js +1 -1
- package/dist/versions.mjs +1 -1
- package/dist/virtual-file/VirtualFile.js +1 -1
- package/dist/virtual-file/VirtualFile.mjs +1 -1
- package/dist/virtual-file/index.js +1 -1
- package/dist/virtual-file/index.mjs +1 -1
- package/dist/virtual-file/node.js +1 -1
- package/dist/virtual-file/node.mjs +1 -1
- package/dist/virtual-file/toVirtualFile.js +1 -1
- package/dist/virtual-file/toVirtualFile.mjs +1 -1
- package/package.json +5 -5
- package/dist/chunk-25ESL4NL.js +0 -409
- package/dist/chunk-25ESL4NL.js.map +0 -1
- package/dist/chunk-AJNKQYKP.mjs.map +0 -1
- package/dist/chunk-F6G67XQ4.js +0 -1
- package/dist/chunk-FLSK6ISS.mjs.map +0 -1
- package/dist/chunk-H35ZUVQT.mjs.map +0 -1
- package/dist/chunk-KCECQM3L.mjs +0 -409
- package/dist/chunk-KCECQM3L.mjs.map +0 -1
- package/dist/chunk-OYZPBNHS.mjs +0 -1
- package/dist/chunk-PZNIU23I.js.map +0 -1
- package/dist/chunk-RD6BN2TQ.js.map +0 -1
- package/dist/chunk-VOPTAKVG.js.map +0 -1
- package/dist/npm.js +0 -35
- package/dist/npm.mjs +0 -35
- package/dist/types/npm.d.ts +0 -19
- /package/dist/{chunk-5I5WPAVD.js.map → chunk-37EUH3KZ.js.map} +0 -0
- /package/dist/{chunk-SB43G2RI.js.map → chunk-3OXW5H4F.js.map} +0 -0
- /package/dist/{chunk-K6BCBPXF.js.map → chunk-3RFGTBEP.js.map} +0 -0
- /package/dist/{chunk-JMDSN227.mjs.map → chunk-3RUWAMJT.mjs.map} +0 -0
- /package/dist/{chunk-F6G67XQ4.js.map → chunk-FA4QIZH6.js.map} +0 -0
- /package/dist/{chunk-ZXHR322P.mjs.map → chunk-GXSTPU7D.mjs.map} +0 -0
- /package/dist/{chunk-YNOZU43P.mjs.map → chunk-IPUL74MZ.mjs.map} +0 -0
- /package/dist/{chunk-OYZPBNHS.mjs.map → chunk-NNYGTNHP.mjs.map} +0 -0
- /package/dist/{chunk-VWGXNUMD.mjs.map → chunk-PZF4KWU2.mjs.map} +0 -0
- /package/dist/{chunk-PHUTP7NB.js.map → chunk-S3BWTUTZ.js.map} +0 -0
- /package/dist/{npm.js.map → chunk-VWLBM7XM.js.map} +0 -0
- /package/dist/{npm.mjs.map → chunk-W7A3BYUP.mjs.map} +0 -0
package/dist/types/cronjob.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ export declare const CronjobRpcRequestStruct: import("@metamask/superstruct").St
|
|
|
10
10
|
method: import("@metamask/superstruct").Struct<string, null>;
|
|
11
11
|
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | undefined, null>;
|
|
12
12
|
}>;
|
|
13
|
-
export
|
|
13
|
+
export type CronjobRpcRequest = Infer<typeof CronjobRpcRequestStruct>;
|
|
14
14
|
export declare const CronExpressionStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
15
|
-
export
|
|
15
|
+
export type CronExpression = Infer<typeof CronExpressionStruct>;
|
|
16
16
|
/**
|
|
17
17
|
* Parses a cron expression.
|
|
18
18
|
*
|
|
@@ -42,7 +42,7 @@ export declare const CronjobSpecificationStruct: import("@metamask/superstruct")
|
|
|
42
42
|
params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | undefined, null>;
|
|
43
43
|
}>;
|
|
44
44
|
}>;
|
|
45
|
-
export
|
|
45
|
+
export type CronjobSpecification = Infer<typeof CronjobSpecificationStruct>;
|
|
46
46
|
/**
|
|
47
47
|
* Check if the given value is a {@link CronjobSpecification} object.
|
|
48
48
|
*
|
package/dist/types/entropy.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const SIP_6_MAGIC_VALUE: `${number}'`;
|
|
2
2
|
export declare const STATE_ENCRYPTION_MAGIC_VALUE: `${number}'`;
|
|
3
|
-
export
|
|
3
|
+
export type MagicValue = typeof SIP_6_MAGIC_VALUE | typeof STATE_ENCRYPTION_MAGIC_VALUE;
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { SerializedSnapError, SnapError } from '@metamask/snaps-sdk';
|
|
|
4
4
|
import type { Json, JsonRpcError } from '@metamask/utils';
|
|
5
5
|
export declare const SNAP_ERROR_WRAPPER_CODE = -31001;
|
|
6
6
|
export declare const SNAP_ERROR_WRAPPER_MESSAGE = "Wrapped Snap Error";
|
|
7
|
-
export
|
|
7
|
+
export type SerializedSnapErrorWrapper = {
|
|
8
8
|
code: typeof SNAP_ERROR_WRAPPER_CODE;
|
|
9
9
|
message: typeof SNAP_ERROR_WRAPPER_MESSAGE;
|
|
10
10
|
data: {
|
package/dist/types/eval.d.ts
CHANGED
package/dist/types/handlers.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { OnCronjobHandler, OnHomePageHandler, OnKeyringRequestHandler, OnNa
|
|
|
2
2
|
import { SeverityLevel } from '@metamask/snaps-sdk';
|
|
3
3
|
import type { SnapHandler } from './handler-types';
|
|
4
4
|
import { HandlerType } from './handler-types';
|
|
5
|
-
export
|
|
5
|
+
export type SnapRpcHookArgs = {
|
|
6
6
|
origin: string;
|
|
7
7
|
handler: HandlerType;
|
|
8
8
|
request: Record<string, unknown>;
|
|
@@ -11,7 +11,7 @@ export declare const SNAP_EXPORTS: {
|
|
|
11
11
|
readonly onRpcRequest: {
|
|
12
12
|
readonly type: HandlerType.OnRpcRequest;
|
|
13
13
|
readonly required: true;
|
|
14
|
-
readonly validator: (snapExport: unknown) => snapExport is OnRpcRequestHandler
|
|
14
|
+
readonly validator: (snapExport: unknown) => snapExport is OnRpcRequestHandler;
|
|
15
15
|
};
|
|
16
16
|
readonly onTransaction: {
|
|
17
17
|
readonly type: HandlerType.OnTransaction;
|
|
@@ -21,7 +21,7 @@ export declare const SNAP_EXPORTS: {
|
|
|
21
21
|
readonly onCronjob: {
|
|
22
22
|
readonly type: HandlerType.OnCronjob;
|
|
23
23
|
readonly required: true;
|
|
24
|
-
readonly validator: (snapExport: unknown) => snapExport is OnCronjobHandler
|
|
24
|
+
readonly validator: (snapExport: unknown) => snapExport is OnCronjobHandler;
|
|
25
25
|
};
|
|
26
26
|
readonly onNameLookup: {
|
|
27
27
|
readonly type: HandlerType.OnNameLookup;
|
|
@@ -41,7 +41,7 @@ export declare const SNAP_EXPORTS: {
|
|
|
41
41
|
readonly onKeyringRequest: {
|
|
42
42
|
readonly type: HandlerType.OnKeyringRequest;
|
|
43
43
|
readonly required: true;
|
|
44
|
-
readonly validator: (snapExport: unknown) => snapExport is OnKeyringRequestHandler
|
|
44
|
+
readonly validator: (snapExport: unknown) => snapExport is OnKeyringRequestHandler;
|
|
45
45
|
};
|
|
46
46
|
readonly onHomePage: {
|
|
47
47
|
readonly type: HandlerType.OnHomePage;
|
|
@@ -141,6 +141,13 @@ export declare const OnTransactionResponseWithContentStruct: import("@metamask/s
|
|
|
141
141
|
buttonType?: "button" | "submit" | undefined;
|
|
142
142
|
})[];
|
|
143
143
|
} | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
144
|
+
name: string;
|
|
145
|
+
value?: string | undefined;
|
|
146
|
+
children: import("@metamask/snaps-sdk/jsx").SnapsChildren<import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
147
|
+
value: string;
|
|
148
|
+
children: string;
|
|
149
|
+
}, "Radio">>;
|
|
150
|
+
}, "RadioGroup"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
144
151
|
children: import("@metamask/snaps-sdk/jsx").StringElement;
|
|
145
152
|
}, "Heading"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
146
153
|
src: string;
|
|
@@ -217,6 +224,13 @@ export declare const OnTransactionResponseWithContentStruct: import("@metamask/s
|
|
|
217
224
|
buttonType?: "button" | "submit" | undefined;
|
|
218
225
|
})[];
|
|
219
226
|
} | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
227
|
+
name: string;
|
|
228
|
+
value?: string | undefined;
|
|
229
|
+
children: import("@metamask/snaps-sdk/jsx").SnapsChildren<import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
230
|
+
value: string;
|
|
231
|
+
children: string;
|
|
232
|
+
}, "Radio">>;
|
|
233
|
+
}, "RadioGroup"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
220
234
|
children: import("@metamask/snaps-sdk/jsx").StringElement;
|
|
221
235
|
}, "Heading"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
222
236
|
src: string;
|
|
@@ -297,6 +311,13 @@ export declare const OnTransactionResponseStruct: import("@metamask/superstruct"
|
|
|
297
311
|
buttonType?: "button" | "submit" | undefined;
|
|
298
312
|
})[];
|
|
299
313
|
} | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
314
|
+
name: string;
|
|
315
|
+
value?: string | undefined;
|
|
316
|
+
children: import("@metamask/snaps-sdk/jsx").SnapsChildren<import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
317
|
+
value: string;
|
|
318
|
+
children: string;
|
|
319
|
+
}, "Radio">>;
|
|
320
|
+
}, "RadioGroup"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
300
321
|
children: import("@metamask/snaps-sdk/jsx").StringElement;
|
|
301
322
|
}, "Heading"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
302
323
|
src: string;
|
|
@@ -377,6 +398,13 @@ export declare const OnSignatureResponseStruct: import("@metamask/superstruct").
|
|
|
377
398
|
buttonType?: "button" | "submit" | undefined;
|
|
378
399
|
})[];
|
|
379
400
|
} | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
401
|
+
name: string;
|
|
402
|
+
value?: string | undefined;
|
|
403
|
+
children: import("@metamask/snaps-sdk/jsx").SnapsChildren<import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
404
|
+
value: string;
|
|
405
|
+
children: string;
|
|
406
|
+
}, "Radio">>;
|
|
407
|
+
}, "RadioGroup"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
380
408
|
children: import("@metamask/snaps-sdk/jsx").StringElement;
|
|
381
409
|
}, "Heading"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
382
410
|
src: string;
|
|
@@ -454,6 +482,13 @@ export declare const OnHomePageResponseWithContentStruct: import("@metamask/supe
|
|
|
454
482
|
buttonType?: "button" | "submit" | undefined;
|
|
455
483
|
})[];
|
|
456
484
|
} | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
485
|
+
name: string;
|
|
486
|
+
value?: string | undefined;
|
|
487
|
+
children: import("@metamask/snaps-sdk/jsx").SnapsChildren<import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
488
|
+
value: string;
|
|
489
|
+
children: string;
|
|
490
|
+
}, "Radio">>;
|
|
491
|
+
}, "RadioGroup"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
457
492
|
children: import("@metamask/snaps-sdk/jsx").StringElement;
|
|
458
493
|
}, "Heading"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
459
494
|
src: string;
|
|
@@ -529,6 +564,13 @@ export declare const OnHomePageResponseWithContentStruct: import("@metamask/supe
|
|
|
529
564
|
buttonType?: "button" | "submit" | undefined;
|
|
530
565
|
})[];
|
|
531
566
|
} | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
567
|
+
name: string;
|
|
568
|
+
value?: string | undefined;
|
|
569
|
+
children: import("@metamask/snaps-sdk/jsx").SnapsChildren<import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
570
|
+
value: string;
|
|
571
|
+
children: string;
|
|
572
|
+
}, "Radio">>;
|
|
573
|
+
}, "RadioGroup"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
532
574
|
children: import("@metamask/snaps-sdk/jsx").StringElement;
|
|
533
575
|
}, "Heading"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
534
576
|
src: string;
|
|
@@ -610,6 +652,13 @@ export declare const OnHomePageResponseStruct: import("@metamask/superstruct").S
|
|
|
610
652
|
buttonType?: "button" | "submit" | undefined;
|
|
611
653
|
})[];
|
|
612
654
|
} | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
655
|
+
name: string;
|
|
656
|
+
value?: string | undefined;
|
|
657
|
+
children: import("@metamask/snaps-sdk/jsx").SnapsChildren<import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
658
|
+
value: string;
|
|
659
|
+
children: string;
|
|
660
|
+
}, "Radio">>;
|
|
661
|
+
}, "RadioGroup"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
613
662
|
children: import("@metamask/snaps-sdk/jsx").StringElement;
|
|
614
663
|
}, "Heading"> | import("@metamask/snaps-sdk/jsx").SnapElement<{
|
|
615
664
|
src: string;
|
|
@@ -687,14 +736,14 @@ export declare const OnNameLookupResponseStruct: import("@metamask/superstruct")
|
|
|
687
736
|
/**
|
|
688
737
|
* Utility type for getting the handler function type from a handler type.
|
|
689
738
|
*/
|
|
690
|
-
export
|
|
739
|
+
export type HandlerFunction<Type extends SnapHandler> = Type['validator'] extends (snapExport: unknown) => snapExport is infer Handler ? Handler : never;
|
|
691
740
|
/**
|
|
692
741
|
* All the function-based handlers that a snap can implement.
|
|
693
742
|
*/
|
|
694
|
-
export
|
|
743
|
+
export type SnapFunctionExports = {
|
|
695
744
|
[Key in keyof typeof SNAP_EXPORTS]?: HandlerFunction<(typeof SNAP_EXPORTS)[Key]>;
|
|
696
745
|
};
|
|
697
746
|
/**
|
|
698
747
|
* All handlers that a snap can implement.
|
|
699
748
|
*/
|
|
700
|
-
export
|
|
749
|
+
export type SnapExports = SnapFunctionExports;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/json-rpc.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const RpcOriginsStruct: import("@metamask/superstruct").Struct<{
|
|
|
10
10
|
snaps: import("@metamask/superstruct").Struct<boolean | undefined, null>;
|
|
11
11
|
allowedOrigins: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
12
12
|
}>;
|
|
13
|
-
export
|
|
13
|
+
export type RpcOrigins = Infer<typeof RpcOriginsStruct>;
|
|
14
14
|
/**
|
|
15
15
|
* Asserts that the given value is a valid {@link RpcOrigins} object.
|
|
16
16
|
*
|
|
@@ -25,7 +25,7 @@ export declare const KeyringOriginsStruct: import("@metamask/superstruct").Struc
|
|
|
25
25
|
}, {
|
|
26
26
|
allowedOrigins: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
27
27
|
}>;
|
|
28
|
-
export
|
|
28
|
+
export type KeyringOrigins = Infer<typeof KeyringOriginsStruct>;
|
|
29
29
|
/**
|
|
30
30
|
* Assert that the given value is a valid {@link KeyringOrigins} object.
|
|
31
31
|
*
|
|
@@ -15,7 +15,7 @@ export declare const LocalizationFileStruct: import("@metamask/superstruct").Str
|
|
|
15
15
|
description?: string | undefined;
|
|
16
16
|
}>, null>;
|
|
17
17
|
}>;
|
|
18
|
-
export
|
|
18
|
+
export type LocalizationFile = Infer<typeof LocalizationFileStruct>;
|
|
19
19
|
/**
|
|
20
20
|
* Validate a list of localization files.
|
|
21
21
|
*
|
|
@@ -1,53 +1,56 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Json } from '@metamask/utils';
|
|
3
|
-
import { ProgrammaticallyFixableSnapError } from '../snaps';
|
|
4
3
|
import type { SnapFiles } from '../types';
|
|
5
4
|
import { VirtualFile } from '../virtual-file/node';
|
|
6
5
|
import type { SnapManifest } from './validation';
|
|
6
|
+
import type { ValidatorResults } from './validator';
|
|
7
|
+
import type { ValidatorMeta, ValidatorReport } from './validator-types';
|
|
8
|
+
export type CheckManifestReport = Omit<ValidatorReport, 'fix'> & {
|
|
9
|
+
wasFixed?: boolean;
|
|
10
|
+
};
|
|
7
11
|
/**
|
|
8
12
|
* The result from the `checkManifest` function.
|
|
9
13
|
*
|
|
10
14
|
* @property manifest - The fixed manifest object.
|
|
11
|
-
* @property updated - Whether the manifest was updated.
|
|
12
|
-
* @property warnings - An array of warnings that were encountered during
|
|
13
|
-
* processing of the manifest files. These warnings are not logged to the
|
|
14
|
-
* console automatically, so depending on the environment the function is called
|
|
15
|
-
* in, a different method for logging can be used.
|
|
16
|
-
* @property errors - An array of errors that were encountered during
|
|
17
|
-
* processing of the manifest files. These errors are not logged to the
|
|
18
|
-
* console automatically, so depending on the environment the function is called
|
|
19
|
-
* in, a different method for logging can be used.
|
|
15
|
+
* @property updated - Whether the manifest was written and updated.
|
|
20
16
|
*/
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
updated
|
|
24
|
-
|
|
25
|
-
errors: string[];
|
|
17
|
+
export type CheckManifestResult = {
|
|
18
|
+
files?: SnapFiles;
|
|
19
|
+
updated: boolean;
|
|
20
|
+
reports: CheckManifestReport[];
|
|
26
21
|
};
|
|
27
|
-
export
|
|
22
|
+
export type WriteFileFunction = (path: string, data: string) => Promise<void>;
|
|
28
23
|
/**
|
|
29
24
|
* Validates a snap.manifest.json file. Attempts to fix the manifest and write
|
|
30
25
|
* the fixed version to disk if `writeManifest` is true. Throws if validation
|
|
31
26
|
* fails.
|
|
32
27
|
*
|
|
33
28
|
* @param basePath - The path to the folder with the manifest files.
|
|
34
|
-
* @param
|
|
35
|
-
* @param sourceCode - The source code of the Snap.
|
|
36
|
-
* @param writeFileFn - The function to use to write the manifest to disk.
|
|
29
|
+
* @param options - Additional options for the function.
|
|
30
|
+
* @param options.sourceCode - The source code of the Snap.
|
|
31
|
+
* @param options.writeFileFn - The function to use to write the manifest to disk.
|
|
32
|
+
* @param options.updateAndWriteManifest - Whether to auto-magically try to fix errors and then write the manifest to disk.
|
|
37
33
|
* @returns Whether the manifest was updated, and an array of warnings that
|
|
38
34
|
* were encountered during processing of the manifest files.
|
|
39
35
|
*/
|
|
40
|
-
export declare function checkManifest(basePath: string,
|
|
36
|
+
export declare function checkManifest(basePath: string, { updateAndWriteManifest, sourceCode, writeFileFn, }?: {
|
|
37
|
+
updateAndWriteManifest?: boolean;
|
|
38
|
+
sourceCode?: string;
|
|
39
|
+
writeFileFn?: WriteFileFunction;
|
|
40
|
+
}): Promise<CheckManifestResult>;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* the
|
|
42
|
+
* Run the algorithm for automatically fixing errors in manifest.
|
|
43
|
+
*
|
|
44
|
+
* The algorithm updates the manifest by fixing all fixable problems,
|
|
45
|
+
* and then run validation again to check if the new manifest is now correct.
|
|
46
|
+
* If not correct, the algorithm will use the manifest from previous iteration
|
|
47
|
+
* and try again `MAX_ATTEMPTS` times to update it before bailing and
|
|
48
|
+
* resulting in failure.
|
|
45
49
|
*
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @returns A copy of the manifest file where the cause of the error is fixed.
|
|
50
|
+
* @param results - Results of the initial run of validation.
|
|
51
|
+
* @param rules - Optional list of rules to run the fixes with.
|
|
49
52
|
*/
|
|
50
|
-
export declare function
|
|
53
|
+
export declare function runFixes(results: ValidatorResults, rules?: ValidatorMeta[]): Promise<CheckManifestResult>;
|
|
51
54
|
/**
|
|
52
55
|
* Given an unvalidated Snap manifest, attempts to extract the location of the
|
|
53
56
|
* bundle source file location and read the file.
|
|
@@ -93,16 +96,3 @@ export declare function getSnapFiles(basePath: string, paths: string[] | undefin
|
|
|
93
96
|
* @returns The disk-ready manifest.
|
|
94
97
|
*/
|
|
95
98
|
export declare function getWritableManifest(manifest: SnapManifest): SnapManifest;
|
|
96
|
-
/**
|
|
97
|
-
* Validates the fields of an NPM Snap manifest that has already passed JSON
|
|
98
|
-
* Schema validation.
|
|
99
|
-
*
|
|
100
|
-
* @param snapFiles - The relevant snap files to validate.
|
|
101
|
-
* @param snapFiles.manifest - The npm Snap manifest to validate.
|
|
102
|
-
* @param snapFiles.packageJson - The npm Snap's `package.json`.
|
|
103
|
-
* @param snapFiles.sourceCode - The Snap's source code.
|
|
104
|
-
* @param snapFiles.svgIcon - The Snap's optional icon.
|
|
105
|
-
* @param snapFiles.auxiliaryFiles - Any auxiliary files required by the snap at runtime.
|
|
106
|
-
* @param snapFiles.localizationFiles - The Snap's localization files.
|
|
107
|
-
*/
|
|
108
|
-
export declare function validateNpmSnapManifest({ manifest, packageJson, sourceCode, svgIcon, auxiliaryFiles, localizationFiles, }: SnapFiles): Promise<void>;
|
|
@@ -16,7 +16,7 @@ export declare const Bip32EntropyStruct: Struct<{
|
|
|
16
16
|
path: Struct<string[], Struct<string, null>>;
|
|
17
17
|
curve: Describe<"ed25519" | "ed25519Bip32" | "secp256k1">;
|
|
18
18
|
}>;
|
|
19
|
-
export
|
|
19
|
+
export type Bip32Entropy = Infer<typeof Bip32EntropyStruct>;
|
|
20
20
|
export declare const SnapGetBip32EntropyPermissionsStruct: Struct<{
|
|
21
21
|
path: string[];
|
|
22
22
|
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
@@ -31,7 +31,7 @@ export declare const SemVerRangeStruct: Struct<string, null>;
|
|
|
31
31
|
export declare const SnapIdsStruct: Struct<Record<string, {
|
|
32
32
|
version?: string | undefined;
|
|
33
33
|
}>, null>;
|
|
34
|
-
export
|
|
34
|
+
export type SnapIds = Infer<typeof SnapIdsStruct>;
|
|
35
35
|
export declare const ChainIdsStruct: Struct<`${string}:${string}`[], Struct<`${string}:${string}`, null>>;
|
|
36
36
|
export declare const LookupMatchersStruct: Struct<{
|
|
37
37
|
tlds: string[];
|
|
@@ -49,13 +49,13 @@ export declare const HandlerCaveatsStruct: Struct<{
|
|
|
49
49
|
}, {
|
|
50
50
|
maxRequestTime: Struct<number | undefined, null>;
|
|
51
51
|
}>;
|
|
52
|
-
export
|
|
52
|
+
export type HandlerCaveats = Infer<typeof HandlerCaveatsStruct>;
|
|
53
53
|
export declare const EmptyObjectStruct: Struct<EmptyObject, null>;
|
|
54
54
|
export declare const PermissionsStruct: Describe<InitialPermissions>;
|
|
55
|
-
export
|
|
55
|
+
export type SnapPermissions = InferMatching<typeof PermissionsStruct, InitialPermissions>;
|
|
56
56
|
export declare const SnapAuxilaryFilesStruct: Struct<string[], Struct<string, null>>;
|
|
57
57
|
export declare const InitialConnectionsStruct: Struct<Record<string & URL, {}>, null>;
|
|
58
|
-
export
|
|
58
|
+
export type InitialConnections = Infer<typeof InitialConnectionsStruct>;
|
|
59
59
|
export declare const SnapManifestStruct: Struct<{
|
|
60
60
|
description: string;
|
|
61
61
|
version: import("@metamask/utils").SemVerVersion;
|
|
@@ -228,7 +228,7 @@ export declare const SnapManifestStruct: Struct<{
|
|
|
228
228
|
manifestVersion: Struct<"0.1", "0.1">;
|
|
229
229
|
$schema: Struct<string | undefined, null>;
|
|
230
230
|
}>;
|
|
231
|
-
export
|
|
231
|
+
export type SnapManifest = Infer<typeof SnapManifestStruct>;
|
|
232
232
|
/**
|
|
233
233
|
* Check if the given value is a valid {@link SnapManifest} object.
|
|
234
234
|
*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Promisable } from '../promise';
|
|
2
|
+
import type { SnapFiles, UnvalidatedSnapFiles } from '../types';
|
|
3
|
+
import type { SnapManifest } from './validation';
|
|
4
|
+
export type ValidatorFix = (files: {
|
|
5
|
+
manifest: SnapManifest;
|
|
6
|
+
}) => Promisable<{
|
|
7
|
+
manifest: SnapManifest;
|
|
8
|
+
}>;
|
|
9
|
+
export type ValidatorSeverity = 'error' | 'warning';
|
|
10
|
+
export type ValidatorContext = {
|
|
11
|
+
report: (message: string, fix?: ValidatorFix) => void;
|
|
12
|
+
};
|
|
13
|
+
export type ValidatorReport = {
|
|
14
|
+
severity: ValidatorSeverity;
|
|
15
|
+
message: string;
|
|
16
|
+
fix?: ValidatorFix;
|
|
17
|
+
};
|
|
18
|
+
export type ValidatorMeta = {
|
|
19
|
+
severity: ValidatorSeverity;
|
|
20
|
+
/**
|
|
21
|
+
* 1. Run the validator on unverified files to ensure that the files are structurally sound.
|
|
22
|
+
*
|
|
23
|
+
* @param files - Files to be verified
|
|
24
|
+
* @param context - Validator context to report errors
|
|
25
|
+
*/
|
|
26
|
+
structureCheck?: (files: UnvalidatedSnapFiles, context: ValidatorContext) => void | Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* 2. Run the validator after the files were checked to be structurally sound.
|
|
29
|
+
*
|
|
30
|
+
* @param files - Files to be verified
|
|
31
|
+
* @param context - Validator context to report errors
|
|
32
|
+
*/
|
|
33
|
+
semanticCheck?: (files: SnapFiles, context: ValidatorContext) => void | Promise<void>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SnapFiles, UnvalidatedSnapFiles } from '../types';
|
|
2
|
+
import type { ValidatorMeta, ValidatorReport } from './validator-types';
|
|
3
|
+
export type ValidatorResults = {
|
|
4
|
+
files?: SnapFiles;
|
|
5
|
+
reports: ValidatorReport[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Verify that snap files are completely valid.
|
|
9
|
+
* First it runs validators on unparsed files to check structure.
|
|
10
|
+
* Secondly it runs validators on parsed files to check semantics.
|
|
11
|
+
*
|
|
12
|
+
* @param files - All files required to run a snap.
|
|
13
|
+
* @param rules - Validators to run.
|
|
14
|
+
*/
|
|
15
|
+
export declare function runValidators(files: UnvalidatedSnapFiles, rules?: ValidatorMeta[]): Promise<ValidatorResults>;
|
|
16
|
+
/**
|
|
17
|
+
* Get whether any reports has pending fixes.
|
|
18
|
+
*
|
|
19
|
+
* @param results - Results of the validation run.
|
|
20
|
+
* @returns Whether there are fixes pending.
|
|
21
|
+
*/
|
|
22
|
+
export declare function hasFixes(results: ValidatorResults): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './checksum';
|
|
2
|
+
export * from './expected-files';
|
|
3
|
+
export * from './icon-dimensions';
|
|
4
|
+
export * from './is-localization-file';
|
|
5
|
+
export * from './is-package-json';
|
|
6
|
+
export * from './is-snap-icon';
|
|
7
|
+
export * from './is-snap-manifest';
|
|
8
|
+
export * from './manifest-localization';
|
|
9
|
+
export * from './package-json-recommended-fields';
|
|
10
|
+
export * from './package-name-match';
|
|
11
|
+
export * from './repository-match';
|
|
12
|
+
export * from './version-match';
|
|
13
|
+
export * from './icon-declared';
|
|
14
|
+
export * from './icon-missing';
|
|
@@ -40,11 +40,11 @@ export declare const ChainIdStringStruct: import("@metamask/superstruct").Struct
|
|
|
40
40
|
* A CAIP-2 chain ID, i.e., a human-readable namespace and reference.
|
|
41
41
|
*/
|
|
42
42
|
export declare const ChainIdStruct: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
43
|
-
export
|
|
43
|
+
export type Caip2ChainId = InferMatching<typeof ChainIdStruct, ChainId>;
|
|
44
44
|
export declare const AccountIdStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
45
45
|
export declare const AccountIdArrayStruct: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
|
|
46
46
|
export declare const AccountAddressStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
47
|
-
export
|
|
47
|
+
export type AccountAddress = Infer<typeof AccountAddressStruct>;
|
|
48
48
|
/**
|
|
49
49
|
* A chain descriptor.
|
|
50
50
|
*/
|
|
@@ -55,7 +55,7 @@ export declare const ChainStruct: import("@metamask/superstruct").Struct<{
|
|
|
55
55
|
id: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
|
|
56
56
|
name: import("@metamask/superstruct").Struct<string, null>;
|
|
57
57
|
}>;
|
|
58
|
-
export
|
|
58
|
+
export type Chain = Infer<typeof ChainStruct>;
|
|
59
59
|
export declare const NamespaceStruct: import("@metamask/superstruct").Struct<{
|
|
60
60
|
chains: {
|
|
61
61
|
name: string;
|
|
@@ -86,12 +86,12 @@ export declare const NamespaceStruct: import("@metamask/superstruct").Struct<{
|
|
|
86
86
|
*/
|
|
87
87
|
events: import("@metamask/superstruct").Struct<string[] | undefined, import("@metamask/superstruct").Struct<string, null>>;
|
|
88
88
|
}>;
|
|
89
|
-
export
|
|
89
|
+
export type Namespace = Infer<typeof NamespaceStruct>;
|
|
90
90
|
/**
|
|
91
91
|
* A CAIP-2 namespace, i.e., the first part of a chain ID.
|
|
92
92
|
*/
|
|
93
93
|
export declare const NamespaceIdStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
94
|
-
export
|
|
94
|
+
export type NamespaceId = Infer<typeof NamespaceIdStruct>;
|
|
95
95
|
/**
|
|
96
96
|
* Check if the given value is a CAIP-2 namespace ID.
|
|
97
97
|
*
|
package/dist/types/node.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Source map declaration taken from `@babel/core`. Babel doesn't export the
|
|
3
3
|
* type for this, so it's copied from the source code instead here.
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type SourceMap = {
|
|
6
6
|
version: number;
|
|
7
7
|
sources: string[];
|
|
8
8
|
names: string[];
|
|
@@ -23,7 +23,7 @@ export declare type SourceMap = {
|
|
|
23
23
|
* points to the original source. If not provided, a new source map will be
|
|
24
24
|
* generated instead.
|
|
25
25
|
*/
|
|
26
|
-
export
|
|
26
|
+
export type PostProcessOptions = {
|
|
27
27
|
stripComments?: boolean;
|
|
28
28
|
sourceMap?: boolean | 'inline';
|
|
29
29
|
inputSourceMap?: SourceMap;
|
|
@@ -36,7 +36,7 @@ export declare type PostProcessOptions = {
|
|
|
36
36
|
* option was enabled.
|
|
37
37
|
* @property warnings - Any warnings that occurred during the post-processing.
|
|
38
38
|
*/
|
|
39
|
-
export
|
|
39
|
+
export type PostProcessedBundle = {
|
|
40
40
|
code: string;
|
|
41
41
|
sourceMap?: SourceMap | null;
|
|
42
42
|
warnings: PostProcessWarning[];
|