@metamask/snaps-sdk 6.22.1 → 6.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -1
- package/dist/error-wrappers.d.cts +192 -192
- package/dist/error-wrappers.d.mts +192 -192
- package/dist/internals/error-wrappers.d.cts +12 -12
- package/dist/internals/error-wrappers.d.mts +12 -12
- package/dist/types/methods/index.cjs.map +1 -1
- package/dist/types/methods/index.d.cts +1 -0
- package/dist/types/methods/index.d.cts.map +1 -1
- package/dist/types/methods/index.d.mts +1 -0
- package/dist/types/methods/index.d.mts.map +1 -1
- package/dist/types/methods/index.mjs.map +1 -1
- package/dist/types/methods/methods.cjs.map +1 -1
- package/dist/types/methods/methods.d.cts +2 -0
- package/dist/types/methods/methods.d.cts.map +1 -1
- package/dist/types/methods/methods.d.mts +2 -0
- package/dist/types/methods/methods.d.mts.map +1 -1
- package/dist/types/methods/methods.mjs.map +1 -1
- package/dist/types/methods/track-event.cjs +3 -0
- package/dist/types/methods/track-event.cjs.map +1 -0
- package/dist/types/methods/track-event.d.cts +21 -0
- package/dist/types/methods/track-event.d.cts.map +1 -0
- package/dist/types/methods/track-event.d.mts +21 -0
- package/dist/types/methods/track-event.d.mts.map +1 -0
- package/dist/types/methods/track-event.mjs +2 -0
- package/dist/types/methods/track-event.mjs.map +1 -0
- package/package.json +4 -4
|
@@ -15,10 +15,10 @@ export type JsonRpcErrorFunction = typeof rpcErrors.parse;
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function createSnapError(fn: JsonRpcErrorFunction): {
|
|
17
17
|
new (message?: string): {
|
|
18
|
-
readonly "__#
|
|
19
|
-
readonly "__#
|
|
20
|
-
readonly "__#
|
|
21
|
-
readonly "__#
|
|
18
|
+
readonly "__#15531@#code": number;
|
|
19
|
+
readonly "__#15531@#message": string;
|
|
20
|
+
readonly "__#15531@#data"?: Record<string, Json> | undefined;
|
|
21
|
+
readonly "__#15531@#stack"?: string | undefined;
|
|
22
22
|
readonly name: string;
|
|
23
23
|
readonly code: number;
|
|
24
24
|
readonly message: string;
|
|
@@ -29,10 +29,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
|
|
|
29
29
|
cause?: unknown;
|
|
30
30
|
};
|
|
31
31
|
new (data?: Record<string, Json>): {
|
|
32
|
-
readonly "__#
|
|
33
|
-
readonly "__#
|
|
34
|
-
readonly "__#
|
|
35
|
-
readonly "__#
|
|
32
|
+
readonly "__#15531@#code": number;
|
|
33
|
+
readonly "__#15531@#message": string;
|
|
34
|
+
readonly "__#15531@#data"?: Record<string, Json> | undefined;
|
|
35
|
+
readonly "__#15531@#stack"?: string | undefined;
|
|
36
36
|
readonly name: string;
|
|
37
37
|
readonly code: number;
|
|
38
38
|
readonly message: string;
|
|
@@ -43,10 +43,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
|
|
|
43
43
|
cause?: unknown;
|
|
44
44
|
};
|
|
45
45
|
new (message?: string | Record<string, Json>, data?: Record<string, Json>): {
|
|
46
|
-
readonly "__#
|
|
47
|
-
readonly "__#
|
|
48
|
-
readonly "__#
|
|
49
|
-
readonly "__#
|
|
46
|
+
readonly "__#15531@#code": number;
|
|
47
|
+
readonly "__#15531@#message": string;
|
|
48
|
+
readonly "__#15531@#data"?: Record<string, Json> | undefined;
|
|
49
|
+
readonly "__#15531@#stack"?: string | undefined;
|
|
50
50
|
readonly name: string;
|
|
51
51
|
readonly code: number;
|
|
52
52
|
readonly message: string;
|
|
@@ -15,10 +15,10 @@ export type JsonRpcErrorFunction = typeof rpcErrors.parse;
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function createSnapError(fn: JsonRpcErrorFunction): {
|
|
17
17
|
new (message?: string): {
|
|
18
|
-
readonly "__#
|
|
19
|
-
readonly "__#
|
|
20
|
-
readonly "__#
|
|
21
|
-
readonly "__#
|
|
18
|
+
readonly "__#7767@#code": number;
|
|
19
|
+
readonly "__#7767@#message": string;
|
|
20
|
+
readonly "__#7767@#data"?: Record<string, Json> | undefined;
|
|
21
|
+
readonly "__#7767@#stack"?: string | undefined;
|
|
22
22
|
readonly name: string;
|
|
23
23
|
readonly code: number;
|
|
24
24
|
readonly message: string;
|
|
@@ -29,10 +29,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
|
|
|
29
29
|
cause?: unknown;
|
|
30
30
|
};
|
|
31
31
|
new (data?: Record<string, Json>): {
|
|
32
|
-
readonly "__#
|
|
33
|
-
readonly "__#
|
|
34
|
-
readonly "__#
|
|
35
|
-
readonly "__#
|
|
32
|
+
readonly "__#7767@#code": number;
|
|
33
|
+
readonly "__#7767@#message": string;
|
|
34
|
+
readonly "__#7767@#data"?: Record<string, Json> | undefined;
|
|
35
|
+
readonly "__#7767@#stack"?: string | undefined;
|
|
36
36
|
readonly name: string;
|
|
37
37
|
readonly code: number;
|
|
38
38
|
readonly message: string;
|
|
@@ -43,10 +43,10 @@ export declare function createSnapError(fn: JsonRpcErrorFunction): {
|
|
|
43
43
|
cause?: unknown;
|
|
44
44
|
};
|
|
45
45
|
new (message?: string | Record<string, Json>, data?: Record<string, Json>): {
|
|
46
|
-
readonly "__#
|
|
47
|
-
readonly "__#
|
|
48
|
-
readonly "__#
|
|
49
|
-
readonly "__#
|
|
46
|
+
readonly "__#7767@#code": number;
|
|
47
|
+
readonly "__#7767@#message": string;
|
|
48
|
+
readonly "__#7767@#data"?: Record<string, Json> | undefined;
|
|
49
|
+
readonly "__#7767@#stack"?: string | undefined;
|
|
50
50
|
readonly name: string;
|
|
51
51
|
readonly code: number;
|
|
52
52
|
readonly message: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,+CAAyB;AAOzB,iDAA2B;AAW3B,qDAA+B;AAE/B,+CAAyB","sourcesContent":["export type * from './clear-state';\nexport type * from './create-interface';\nexport * from './dialog';\nexport type * from './get-bip32-entropy';\nexport type * from './get-bip32-public-key';\nexport type * from './get-bip44-entropy';\nexport type * from './get-client-status';\nexport type * from './get-currency-rate';\nexport type * from './get-entropy';\nexport * from './get-file';\nexport type * from './get-interface-context';\nexport type * from './get-interface-state';\nexport type * from './get-locale';\nexport type * from './get-preferences';\nexport type * from './get-snaps';\nexport type * from './get-state';\nexport type * from './invoke-keyring';\nexport type * from './invoke-snap';\nexport type * from './list-entropy-sources';\nexport type * from './manage-accounts';\nexport * from './manage-state';\nexport type * from './methods';\nexport * from './notify';\nexport type * from './provider-request';\nexport type * from './request-snaps';\nexport type * from './update-interface';\nexport type * from './resolve-interface';\nexport type * from './schedule-background-event';\nexport type * from './cancel-background-event';\nexport type * from './get-background-events';\nexport type * from './set-state';\n"]}
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,+CAAyB;AAOzB,iDAA2B;AAW3B,qDAA+B;AAE/B,+CAAyB","sourcesContent":["export type * from './clear-state';\nexport type * from './create-interface';\nexport * from './dialog';\nexport type * from './get-bip32-entropy';\nexport type * from './get-bip32-public-key';\nexport type * from './get-bip44-entropy';\nexport type * from './get-client-status';\nexport type * from './get-currency-rate';\nexport type * from './get-entropy';\nexport * from './get-file';\nexport type * from './get-interface-context';\nexport type * from './get-interface-state';\nexport type * from './get-locale';\nexport type * from './get-preferences';\nexport type * from './get-snaps';\nexport type * from './get-state';\nexport type * from './invoke-keyring';\nexport type * from './invoke-snap';\nexport type * from './list-entropy-sources';\nexport type * from './manage-accounts';\nexport * from './manage-state';\nexport type * from './methods';\nexport * from './notify';\nexport type * from './provider-request';\nexport type * from './request-snaps';\nexport type * from './update-interface';\nexport type * from './resolve-interface';\nexport type * from './schedule-background-event';\nexport type * from './cancel-background-event';\nexport type * from './get-background-events';\nexport type * from './set-state';\nexport type * from './track-event';\n"]}
|
|
@@ -29,4 +29,5 @@ export type * from "./schedule-background-event.cjs";
|
|
|
29
29
|
export type * from "./cancel-background-event.cjs";
|
|
30
30
|
export type * from "./get-background-events.cjs";
|
|
31
31
|
export type * from "./set-state.cjs";
|
|
32
|
+
export type * from "./track-event.cjs";
|
|
32
33
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":"AAAA,uCAAmC;AACnC,4CAAwC;AACxC,6BAAyB;AACzB,6CAAyC;AACzC,gDAA4C;AAC5C,6CAAyC;AACzC,6CAAyC;AACzC,6CAAyC;AACzC,uCAAmC;AACnC,+BAA2B;AAC3B,iDAA6C;AAC7C,+CAA2C;AAC3C,sCAAkC;AAClC,2CAAuC;AACvC,qCAAiC;AACjC,qCAAiC;AACjC,0CAAsC;AACtC,uCAAmC;AACnC,gDAA4C;AAC5C,2CAAuC;AACvC,mCAA+B;AAC/B,mCAA+B;AAC/B,6BAAyB;AACzB,4CAAwC;AACxC,yCAAqC;AACrC,4CAAwC;AACxC,6CAAyC;AACzC,qDAAiD;AACjD,mDAA+C;AAC/C,iDAA6C;AAC7C,qCAAiC"}
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":"AAAA,uCAAmC;AACnC,4CAAwC;AACxC,6BAAyB;AACzB,6CAAyC;AACzC,gDAA4C;AAC5C,6CAAyC;AACzC,6CAAyC;AACzC,6CAAyC;AACzC,uCAAmC;AACnC,+BAA2B;AAC3B,iDAA6C;AAC7C,+CAA2C;AAC3C,sCAAkC;AAClC,2CAAuC;AACvC,qCAAiC;AACjC,qCAAiC;AACjC,0CAAsC;AACtC,uCAAmC;AACnC,gDAA4C;AAC5C,2CAAuC;AACvC,mCAA+B;AAC/B,mCAA+B;AAC/B,6BAAyB;AACzB,4CAAwC;AACxC,yCAAqC;AACrC,4CAAwC;AACxC,6CAAyC;AACzC,qDAAiD;AACjD,mDAA+C;AAC/C,iDAA6C;AAC7C,qCAAiC;AACjC,uCAAmC"}
|
|
@@ -29,4 +29,5 @@ export type * from "./schedule-background-event.mjs";
|
|
|
29
29
|
export type * from "./cancel-background-event.mjs";
|
|
30
30
|
export type * from "./get-background-events.mjs";
|
|
31
31
|
export type * from "./set-state.mjs";
|
|
32
|
+
export type * from "./track-event.mjs";
|
|
32
33
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":"AAAA,uCAAmC;AACnC,4CAAwC;AACxC,6BAAyB;AACzB,6CAAyC;AACzC,gDAA4C;AAC5C,6CAAyC;AACzC,6CAAyC;AACzC,6CAAyC;AACzC,uCAAmC;AACnC,+BAA2B;AAC3B,iDAA6C;AAC7C,+CAA2C;AAC3C,sCAAkC;AAClC,2CAAuC;AACvC,qCAAiC;AACjC,qCAAiC;AACjC,0CAAsC;AACtC,uCAAmC;AACnC,gDAA4C;AAC5C,2CAAuC;AACvC,mCAA+B;AAC/B,mCAA+B;AAC/B,6BAAyB;AACzB,4CAAwC;AACxC,yCAAqC;AACrC,4CAAwC;AACxC,6CAAyC;AACzC,qDAAiD;AACjD,mDAA+C;AAC/C,iDAA6C;AAC7C,qCAAiC"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":"AAAA,uCAAmC;AACnC,4CAAwC;AACxC,6BAAyB;AACzB,6CAAyC;AACzC,gDAA4C;AAC5C,6CAAyC;AACzC,6CAAyC;AACzC,6CAAyC;AACzC,uCAAmC;AACnC,+BAA2B;AAC3B,iDAA6C;AAC7C,+CAA2C;AAC3C,sCAAkC;AAClC,2CAAuC;AACvC,qCAAiC;AACjC,qCAAiC;AACjC,0CAAsC;AACtC,uCAAmC;AACnC,gDAA4C;AAC5C,2CAAuC;AACvC,mCAA+B;AAC/B,mCAA+B;AAC/B,6BAAyB;AACzB,4CAAwC;AACxC,yCAAqC;AACrC,4CAAwC;AACxC,6CAAyC;AACzC,qDAAiD;AACjD,mDAA+C;AAC/C,iDAA6C;AAC7C,qCAAiC;AACjC,uCAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":"AAEA,6BAAyB;AAOzB,+BAA2B;AAW3B,mCAA+B;AAE/B,6BAAyB","sourcesContent":["export type * from './clear-state';\nexport type * from './create-interface';\nexport * from './dialog';\nexport type * from './get-bip32-entropy';\nexport type * from './get-bip32-public-key';\nexport type * from './get-bip44-entropy';\nexport type * from './get-client-status';\nexport type * from './get-currency-rate';\nexport type * from './get-entropy';\nexport * from './get-file';\nexport type * from './get-interface-context';\nexport type * from './get-interface-state';\nexport type * from './get-locale';\nexport type * from './get-preferences';\nexport type * from './get-snaps';\nexport type * from './get-state';\nexport type * from './invoke-keyring';\nexport type * from './invoke-snap';\nexport type * from './list-entropy-sources';\nexport type * from './manage-accounts';\nexport * from './manage-state';\nexport type * from './methods';\nexport * from './notify';\nexport type * from './provider-request';\nexport type * from './request-snaps';\nexport type * from './update-interface';\nexport type * from './resolve-interface';\nexport type * from './schedule-background-event';\nexport type * from './cancel-background-event';\nexport type * from './get-background-events';\nexport type * from './set-state';\n"]}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/types/methods/index.ts"],"names":[],"mappings":"AAEA,6BAAyB;AAOzB,+BAA2B;AAW3B,mCAA+B;AAE/B,6BAAyB","sourcesContent":["export type * from './clear-state';\nexport type * from './create-interface';\nexport * from './dialog';\nexport type * from './get-bip32-entropy';\nexport type * from './get-bip32-public-key';\nexport type * from './get-bip44-entropy';\nexport type * from './get-client-status';\nexport type * from './get-currency-rate';\nexport type * from './get-entropy';\nexport * from './get-file';\nexport type * from './get-interface-context';\nexport type * from './get-interface-state';\nexport type * from './get-locale';\nexport type * from './get-preferences';\nexport type * from './get-snaps';\nexport type * from './get-state';\nexport type * from './invoke-keyring';\nexport type * from './invoke-snap';\nexport type * from './list-entropy-sources';\nexport type * from './manage-accounts';\nexport * from './manage-state';\nexport type * from './methods';\nexport * from './notify';\nexport type * from './provider-request';\nexport type * from './request-snaps';\nexport type * from './update-interface';\nexport type * from './resolve-interface';\nexport type * from './schedule-background-event';\nexport type * from './cancel-background-event';\nexport type * from './get-background-events';\nexport type * from './set-state';\nexport type * from './track-event';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.cjs","sourceRoot":"","sources":["../../../src/types/methods/methods.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n} from './cancel-background-event';\nimport type { ClearStateParams, ClearStateResult } from './clear-state';\nimport type {\n CreateInterfaceParams,\n CreateInterfaceResult,\n} from './create-interface';\nimport type { DialogParams, DialogResult } from './dialog';\nimport type {\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n} from './get-background-events';\nimport type {\n GetBip32EntropyParams,\n GetBip32EntropyResult,\n} from './get-bip32-entropy';\nimport type {\n GetBip32PublicKeyParams,\n GetBip32PublicKeyResult,\n} from './get-bip32-public-key';\nimport type {\n GetBip44EntropyParams,\n GetBip44EntropyResult,\n} from './get-bip44-entropy';\nimport type {\n GetClientStatusParams,\n GetClientStatusResult,\n} from './get-client-status';\nimport type {\n GetCurrencyRateParams,\n GetCurrencyRateResult,\n} from './get-currency-rate';\nimport type { GetEntropyParams, GetEntropyResult } from './get-entropy';\nimport type { GetFileParams, GetFileResult } from './get-file';\nimport type {\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n} from './get-interface-context';\nimport type {\n GetInterfaceStateParams,\n GetInterfaceStateResult,\n} from './get-interface-state';\nimport type { GetLocaleParams, GetLocaleResult } from './get-locale';\nimport type {\n GetPreferencesParams,\n GetPreferencesResult,\n} from './get-preferences';\nimport type { GetSnapsParams, GetSnapsResult } from './get-snaps';\nimport type { GetStateParams, GetStateResult } from './get-state';\nimport type {\n InvokeKeyringParams,\n InvokeKeyringResult,\n} from './invoke-keyring';\nimport type { InvokeSnapParams, InvokeSnapResult } from './invoke-snap';\nimport type {\n ListEntropySourcesParams,\n ListEntropySourcesResult,\n} from './list-entropy-sources';\nimport type {\n ManageAccountsParams,\n ManageAccountsResult,\n} from './manage-accounts';\nimport type { ManageStateParams, ManageStateResult } from './manage-state';\nimport type { NotifyParams, NotifyResult } from './notify';\nimport type { RequestSnapsParams, RequestSnapsResult } from './request-snaps';\nimport type {\n ResolveInterfaceParams,\n ResolveInterfaceResult,\n} from './resolve-interface';\nimport type {\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n} from './schedule-background-event';\nimport type { SetStateParams, SetStateResult } from './set-state';\nimport type {\n UpdateInterfaceParams,\n UpdateInterfaceResult,\n} from './update-interface';\nimport type { Method } from '../../internals';\n\n/**\n * The methods that are available to the Snap. Each method is a tuple of the\n * request parameters and the result returned by the method.\n */\nexport type SnapMethods = {\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_clearState: [ClearStateParams, ClearStateResult];\n snap_dialog: [DialogParams, DialogResult];\n snap_getBip32Entropy: [GetBip32EntropyParams, GetBip32EntropyResult];\n snap_getBip32PublicKey: [GetBip32PublicKeyParams, GetBip32PublicKeyResult];\n snap_getBip44Entropy: [GetBip44EntropyParams, GetBip44EntropyResult];\n snap_getClientStatus: [GetClientStatusParams, GetClientStatusResult];\n snap_getCurrencyRate: [GetCurrencyRateParams, GetCurrencyRateResult];\n snap_getEntropy: [GetEntropyParams, GetEntropyResult];\n snap_getFile: [GetFileParams, GetFileResult];\n snap_getLocale: [GetLocaleParams, GetLocaleResult];\n snap_getPreferences: [GetPreferencesParams, GetPreferencesResult];\n snap_getState: [GetStateParams, GetStateResult];\n snap_listEntropySources: [ListEntropySourcesParams, ListEntropySourcesResult];\n snap_manageAccounts: [ManageAccountsParams, ManageAccountsResult];\n snap_manageState: [ManageStateParams, ManageStateResult];\n snap_notify: [NotifyParams, NotifyResult];\n snap_scheduleBackgroundEvent: [\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n ];\n snap_cancelBackgroundEvent: [\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n ];\n snap_getBackgroundEvents: [\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n ];\n snap_createInterface: [CreateInterfaceParams, CreateInterfaceResult];\n snap_updateInterface: [UpdateInterfaceParams, UpdateInterfaceResult];\n snap_getInterfaceState: [GetInterfaceStateParams, GetInterfaceStateResult];\n snap_getInterfaceContext: [\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n ];\n snap_resolveInterface: [ResolveInterfaceParams, ResolveInterfaceResult];\n snap_setState: [SetStateParams, SetStateResult];\n wallet_getSnaps: [GetSnapsParams, GetSnapsResult];\n wallet_invokeKeyring: [InvokeKeyringParams, InvokeKeyringResult];\n wallet_invokeSnap: [InvokeSnapParams, InvokeSnapResult];\n wallet_snap: [InvokeSnapParams, InvokeSnapResult];\n wallet_requestSnaps: [RequestSnapsParams, RequestSnapsResult];\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * The request function that is available to the Snap. It takes a request\n * object and returns a promise that resolves to the result of the request.\n *\n * @param request - The request object.\n * @param request.method - The method to call.\n * @param request.params - The parameters to pass to the method. This is\n * inferred from the method, based on the {@link SnapMethods} type, and may be\n * optional.\n * @returns A promise that resolves to the result of the request. This is\n * inferred from the request method, based on the {@link SnapMethods} type.\n * @example\n * // Get the user's locale\n * const result = await request({\n * method: 'snap_getLocale',\n * });\n * @example\n * // Get a file\n * const result = await request({\n * method: 'snap_getFile',\n * params: {\n * path: 'foo/bar.txt',\n * },\n * });\n */\nexport type RequestFunction = <MethodName extends keyof SnapMethods>(\n request: Method<MethodName, SnapMethods[MethodName][0]>,\n) => Promise<SnapMethods[MethodName][1]>;\n"]}
|
|
1
|
+
{"version":3,"file":"methods.cjs","sourceRoot":"","sources":["../../../src/types/methods/methods.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n} from './cancel-background-event';\nimport type { ClearStateParams, ClearStateResult } from './clear-state';\nimport type {\n CreateInterfaceParams,\n CreateInterfaceResult,\n} from './create-interface';\nimport type { DialogParams, DialogResult } from './dialog';\nimport type {\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n} from './get-background-events';\nimport type {\n GetBip32EntropyParams,\n GetBip32EntropyResult,\n} from './get-bip32-entropy';\nimport type {\n GetBip32PublicKeyParams,\n GetBip32PublicKeyResult,\n} from './get-bip32-public-key';\nimport type {\n GetBip44EntropyParams,\n GetBip44EntropyResult,\n} from './get-bip44-entropy';\nimport type {\n GetClientStatusParams,\n GetClientStatusResult,\n} from './get-client-status';\nimport type {\n GetCurrencyRateParams,\n GetCurrencyRateResult,\n} from './get-currency-rate';\nimport type { GetEntropyParams, GetEntropyResult } from './get-entropy';\nimport type { GetFileParams, GetFileResult } from './get-file';\nimport type {\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n} from './get-interface-context';\nimport type {\n GetInterfaceStateParams,\n GetInterfaceStateResult,\n} from './get-interface-state';\nimport type { GetLocaleParams, GetLocaleResult } from './get-locale';\nimport type {\n GetPreferencesParams,\n GetPreferencesResult,\n} from './get-preferences';\nimport type { GetSnapsParams, GetSnapsResult } from './get-snaps';\nimport type { GetStateParams, GetStateResult } from './get-state';\nimport type {\n InvokeKeyringParams,\n InvokeKeyringResult,\n} from './invoke-keyring';\nimport type { InvokeSnapParams, InvokeSnapResult } from './invoke-snap';\nimport type {\n ListEntropySourcesParams,\n ListEntropySourcesResult,\n} from './list-entropy-sources';\nimport type {\n ManageAccountsParams,\n ManageAccountsResult,\n} from './manage-accounts';\nimport type { ManageStateParams, ManageStateResult } from './manage-state';\nimport type { NotifyParams, NotifyResult } from './notify';\nimport type { RequestSnapsParams, RequestSnapsResult } from './request-snaps';\nimport type {\n ResolveInterfaceParams,\n ResolveInterfaceResult,\n} from './resolve-interface';\nimport type {\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n} from './schedule-background-event';\nimport type { SetStateParams, SetStateResult } from './set-state';\nimport type { TrackEventParams, TrackEventResult } from './track-event';\nimport type {\n UpdateInterfaceParams,\n UpdateInterfaceResult,\n} from './update-interface';\nimport type { Method } from '../../internals';\n\n/**\n * The methods that are available to the Snap. Each method is a tuple of the\n * request parameters and the result returned by the method.\n */\nexport type SnapMethods = {\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_clearState: [ClearStateParams, ClearStateResult];\n snap_dialog: [DialogParams, DialogResult];\n snap_getBip32Entropy: [GetBip32EntropyParams, GetBip32EntropyResult];\n snap_getBip32PublicKey: [GetBip32PublicKeyParams, GetBip32PublicKeyResult];\n snap_getBip44Entropy: [GetBip44EntropyParams, GetBip44EntropyResult];\n snap_getClientStatus: [GetClientStatusParams, GetClientStatusResult];\n snap_getCurrencyRate: [GetCurrencyRateParams, GetCurrencyRateResult];\n snap_getEntropy: [GetEntropyParams, GetEntropyResult];\n snap_getFile: [GetFileParams, GetFileResult];\n snap_getLocale: [GetLocaleParams, GetLocaleResult];\n snap_getPreferences: [GetPreferencesParams, GetPreferencesResult];\n snap_getState: [GetStateParams, GetStateResult];\n snap_listEntropySources: [ListEntropySourcesParams, ListEntropySourcesResult];\n snap_manageAccounts: [ManageAccountsParams, ManageAccountsResult];\n snap_manageState: [ManageStateParams, ManageStateResult];\n snap_notify: [NotifyParams, NotifyResult];\n snap_scheduleBackgroundEvent: [\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n ];\n snap_cancelBackgroundEvent: [\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n ];\n snap_getBackgroundEvents: [\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n ];\n snap_createInterface: [CreateInterfaceParams, CreateInterfaceResult];\n snap_updateInterface: [UpdateInterfaceParams, UpdateInterfaceResult];\n snap_getInterfaceState: [GetInterfaceStateParams, GetInterfaceStateResult];\n snap_getInterfaceContext: [\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n ];\n snap_resolveInterface: [ResolveInterfaceParams, ResolveInterfaceResult];\n snap_setState: [SetStateParams, SetStateResult];\n snap_trackEvent: [TrackEventParams, TrackEventResult];\n wallet_getSnaps: [GetSnapsParams, GetSnapsResult];\n wallet_invokeKeyring: [InvokeKeyringParams, InvokeKeyringResult];\n wallet_invokeSnap: [InvokeSnapParams, InvokeSnapResult];\n wallet_snap: [InvokeSnapParams, InvokeSnapResult];\n wallet_requestSnaps: [RequestSnapsParams, RequestSnapsResult];\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * The request function that is available to the Snap. It takes a request\n * object and returns a promise that resolves to the result of the request.\n *\n * @param request - The request object.\n * @param request.method - The method to call.\n * @param request.params - The parameters to pass to the method. This is\n * inferred from the method, based on the {@link SnapMethods} type, and may be\n * optional.\n * @returns A promise that resolves to the result of the request. This is\n * inferred from the request method, based on the {@link SnapMethods} type.\n * @example\n * // Get the user's locale\n * const result = await request({\n * method: 'snap_getLocale',\n * });\n * @example\n * // Get a file\n * const result = await request({\n * method: 'snap_getFile',\n * params: {\n * path: 'foo/bar.txt',\n * },\n * });\n */\nexport type RequestFunction = <MethodName extends keyof SnapMethods>(\n request: Method<MethodName, SnapMethods[MethodName][0]>,\n) => Promise<SnapMethods[MethodName][1]>;\n"]}
|
|
@@ -26,6 +26,7 @@ import type { RequestSnapsParams, RequestSnapsResult } from "./request-snaps.cjs
|
|
|
26
26
|
import type { ResolveInterfaceParams, ResolveInterfaceResult } from "./resolve-interface.cjs";
|
|
27
27
|
import type { ScheduleBackgroundEventParams, ScheduleBackgroundEventResult } from "./schedule-background-event.cjs";
|
|
28
28
|
import type { SetStateParams, SetStateResult } from "./set-state.cjs";
|
|
29
|
+
import type { TrackEventParams, TrackEventResult } from "./track-event.cjs";
|
|
29
30
|
import type { UpdateInterfaceParams, UpdateInterfaceResult } from "./update-interface.cjs";
|
|
30
31
|
import type { Method } from "../../internals/index.cjs";
|
|
31
32
|
/**
|
|
@@ -70,6 +71,7 @@ export type SnapMethods = {
|
|
|
70
71
|
];
|
|
71
72
|
snap_resolveInterface: [ResolveInterfaceParams, ResolveInterfaceResult];
|
|
72
73
|
snap_setState: [SetStateParams, SetStateResult];
|
|
74
|
+
snap_trackEvent: [TrackEventParams, TrackEventResult];
|
|
73
75
|
wallet_getSnaps: [GetSnapsParams, GetSnapsResult];
|
|
74
76
|
wallet_invokeKeyring: [InvokeKeyringParams, InvokeKeyringResult];
|
|
75
77
|
wallet_invokeSnap: [InvokeSnapParams, InvokeSnapResult];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.cts","sourceRoot":"","sources":["../../../src/types/methods/methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC5B,sCAAkC;AACnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,0BAAsB;AACxE,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,+BAA2B;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAiB;AAC3D,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,oCAAgC;AACjC,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,gCAA4B;AAC7B,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,mCAA+B;AAChC,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,gCAA4B;AAC7B,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,gCAA4B;AAC7B,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,gCAA4B;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,0BAAsB;AACxE,OAAO,KAAK,EAAE,aAAa,E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js
|
|
|
26
26
|
import type { ResolveInterfaceParams, ResolveInterfaceResult } from "./resolve-interface.mjs";
|
|
27
27
|
import type { ScheduleBackgroundEventParams, ScheduleBackgroundEventResult } from "./schedule-background-event.mjs";
|
|
28
28
|
import type { SetStateParams, SetStateResult } from "./set-state.mjs";
|
|
29
|
+
import type { TrackEventParams, TrackEventResult } from "./track-event.mjs";
|
|
29
30
|
import type { UpdateInterfaceParams, UpdateInterfaceResult } from "./update-interface.mjs";
|
|
30
31
|
import type { Method } from "../../internals/index.mjs";
|
|
31
32
|
/**
|
|
@@ -70,6 +71,7 @@ export type SnapMethods = {
|
|
|
70
71
|
];
|
|
71
72
|
snap_resolveInterface: [ResolveInterfaceParams, ResolveInterfaceResult];
|
|
72
73
|
snap_setState: [SetStateParams, SetStateResult];
|
|
74
|
+
snap_trackEvent: [TrackEventParams, TrackEventResult];
|
|
73
75
|
wallet_getSnaps: [GetSnapsParams, GetSnapsResult];
|
|
74
76
|
wallet_invokeKeyring: [InvokeKeyringParams, InvokeKeyringResult];
|
|
75
77
|
wallet_invokeSnap: [InvokeSnapParams, InvokeSnapResult];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.d.mts","sourceRoot":"","sources":["../../../src/types/methods/methods.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC5B,sCAAkC;AACnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,0BAAsB;AACxE,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,+BAA2B;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAiB;AAC3D,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EAC1B,oCAAgC;AACjC,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,gCAA4B;AAC7B,OAAO,KAAK,EACV,uBAAuB,EACvB,uBAAuB,EACxB,mCAA+B;AAChC,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eAAe,GAAG,CAAC,UAAU,SAAS,MAAM,WAAW,EACjE,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,KACpD,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"methods.mjs","sourceRoot":"","sources":["../../../src/types/methods/methods.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n} from './cancel-background-event';\nimport type { ClearStateParams, ClearStateResult } from './clear-state';\nimport type {\n CreateInterfaceParams,\n CreateInterfaceResult,\n} from './create-interface';\nimport type { DialogParams, DialogResult } from './dialog';\nimport type {\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n} from './get-background-events';\nimport type {\n GetBip32EntropyParams,\n GetBip32EntropyResult,\n} from './get-bip32-entropy';\nimport type {\n GetBip32PublicKeyParams,\n GetBip32PublicKeyResult,\n} from './get-bip32-public-key';\nimport type {\n GetBip44EntropyParams,\n GetBip44EntropyResult,\n} from './get-bip44-entropy';\nimport type {\n GetClientStatusParams,\n GetClientStatusResult,\n} from './get-client-status';\nimport type {\n GetCurrencyRateParams,\n GetCurrencyRateResult,\n} from './get-currency-rate';\nimport type { GetEntropyParams, GetEntropyResult } from './get-entropy';\nimport type { GetFileParams, GetFileResult } from './get-file';\nimport type {\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n} from './get-interface-context';\nimport type {\n GetInterfaceStateParams,\n GetInterfaceStateResult,\n} from './get-interface-state';\nimport type { GetLocaleParams, GetLocaleResult } from './get-locale';\nimport type {\n GetPreferencesParams,\n GetPreferencesResult,\n} from './get-preferences';\nimport type { GetSnapsParams, GetSnapsResult } from './get-snaps';\nimport type { GetStateParams, GetStateResult } from './get-state';\nimport type {\n InvokeKeyringParams,\n InvokeKeyringResult,\n} from './invoke-keyring';\nimport type { InvokeSnapParams, InvokeSnapResult } from './invoke-snap';\nimport type {\n ListEntropySourcesParams,\n ListEntropySourcesResult,\n} from './list-entropy-sources';\nimport type {\n ManageAccountsParams,\n ManageAccountsResult,\n} from './manage-accounts';\nimport type { ManageStateParams, ManageStateResult } from './manage-state';\nimport type { NotifyParams, NotifyResult } from './notify';\nimport type { RequestSnapsParams, RequestSnapsResult } from './request-snaps';\nimport type {\n ResolveInterfaceParams,\n ResolveInterfaceResult,\n} from './resolve-interface';\nimport type {\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n} from './schedule-background-event';\nimport type { SetStateParams, SetStateResult } from './set-state';\nimport type {\n UpdateInterfaceParams,\n UpdateInterfaceResult,\n} from './update-interface';\nimport type { Method } from '../../internals';\n\n/**\n * The methods that are available to the Snap. Each method is a tuple of the\n * request parameters and the result returned by the method.\n */\nexport type SnapMethods = {\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_clearState: [ClearStateParams, ClearStateResult];\n snap_dialog: [DialogParams, DialogResult];\n snap_getBip32Entropy: [GetBip32EntropyParams, GetBip32EntropyResult];\n snap_getBip32PublicKey: [GetBip32PublicKeyParams, GetBip32PublicKeyResult];\n snap_getBip44Entropy: [GetBip44EntropyParams, GetBip44EntropyResult];\n snap_getClientStatus: [GetClientStatusParams, GetClientStatusResult];\n snap_getCurrencyRate: [GetCurrencyRateParams, GetCurrencyRateResult];\n snap_getEntropy: [GetEntropyParams, GetEntropyResult];\n snap_getFile: [GetFileParams, GetFileResult];\n snap_getLocale: [GetLocaleParams, GetLocaleResult];\n snap_getPreferences: [GetPreferencesParams, GetPreferencesResult];\n snap_getState: [GetStateParams, GetStateResult];\n snap_listEntropySources: [ListEntropySourcesParams, ListEntropySourcesResult];\n snap_manageAccounts: [ManageAccountsParams, ManageAccountsResult];\n snap_manageState: [ManageStateParams, ManageStateResult];\n snap_notify: [NotifyParams, NotifyResult];\n snap_scheduleBackgroundEvent: [\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n ];\n snap_cancelBackgroundEvent: [\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n ];\n snap_getBackgroundEvents: [\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n ];\n snap_createInterface: [CreateInterfaceParams, CreateInterfaceResult];\n snap_updateInterface: [UpdateInterfaceParams, UpdateInterfaceResult];\n snap_getInterfaceState: [GetInterfaceStateParams, GetInterfaceStateResult];\n snap_getInterfaceContext: [\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n ];\n snap_resolveInterface: [ResolveInterfaceParams, ResolveInterfaceResult];\n snap_setState: [SetStateParams, SetStateResult];\n wallet_getSnaps: [GetSnapsParams, GetSnapsResult];\n wallet_invokeKeyring: [InvokeKeyringParams, InvokeKeyringResult];\n wallet_invokeSnap: [InvokeSnapParams, InvokeSnapResult];\n wallet_snap: [InvokeSnapParams, InvokeSnapResult];\n wallet_requestSnaps: [RequestSnapsParams, RequestSnapsResult];\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * The request function that is available to the Snap. It takes a request\n * object and returns a promise that resolves to the result of the request.\n *\n * @param request - The request object.\n * @param request.method - The method to call.\n * @param request.params - The parameters to pass to the method. This is\n * inferred from the method, based on the {@link SnapMethods} type, and may be\n * optional.\n * @returns A promise that resolves to the result of the request. This is\n * inferred from the request method, based on the {@link SnapMethods} type.\n * @example\n * // Get the user's locale\n * const result = await request({\n * method: 'snap_getLocale',\n * });\n * @example\n * // Get a file\n * const result = await request({\n * method: 'snap_getFile',\n * params: {\n * path: 'foo/bar.txt',\n * },\n * });\n */\nexport type RequestFunction = <MethodName extends keyof SnapMethods>(\n request: Method<MethodName, SnapMethods[MethodName][0]>,\n) => Promise<SnapMethods[MethodName][1]>;\n"]}
|
|
1
|
+
{"version":3,"file":"methods.mjs","sourceRoot":"","sources":["../../../src/types/methods/methods.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n} from './cancel-background-event';\nimport type { ClearStateParams, ClearStateResult } from './clear-state';\nimport type {\n CreateInterfaceParams,\n CreateInterfaceResult,\n} from './create-interface';\nimport type { DialogParams, DialogResult } from './dialog';\nimport type {\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n} from './get-background-events';\nimport type {\n GetBip32EntropyParams,\n GetBip32EntropyResult,\n} from './get-bip32-entropy';\nimport type {\n GetBip32PublicKeyParams,\n GetBip32PublicKeyResult,\n} from './get-bip32-public-key';\nimport type {\n GetBip44EntropyParams,\n GetBip44EntropyResult,\n} from './get-bip44-entropy';\nimport type {\n GetClientStatusParams,\n GetClientStatusResult,\n} from './get-client-status';\nimport type {\n GetCurrencyRateParams,\n GetCurrencyRateResult,\n} from './get-currency-rate';\nimport type { GetEntropyParams, GetEntropyResult } from './get-entropy';\nimport type { GetFileParams, GetFileResult } from './get-file';\nimport type {\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n} from './get-interface-context';\nimport type {\n GetInterfaceStateParams,\n GetInterfaceStateResult,\n} from './get-interface-state';\nimport type { GetLocaleParams, GetLocaleResult } from './get-locale';\nimport type {\n GetPreferencesParams,\n GetPreferencesResult,\n} from './get-preferences';\nimport type { GetSnapsParams, GetSnapsResult } from './get-snaps';\nimport type { GetStateParams, GetStateResult } from './get-state';\nimport type {\n InvokeKeyringParams,\n InvokeKeyringResult,\n} from './invoke-keyring';\nimport type { InvokeSnapParams, InvokeSnapResult } from './invoke-snap';\nimport type {\n ListEntropySourcesParams,\n ListEntropySourcesResult,\n} from './list-entropy-sources';\nimport type {\n ManageAccountsParams,\n ManageAccountsResult,\n} from './manage-accounts';\nimport type { ManageStateParams, ManageStateResult } from './manage-state';\nimport type { NotifyParams, NotifyResult } from './notify';\nimport type { RequestSnapsParams, RequestSnapsResult } from './request-snaps';\nimport type {\n ResolveInterfaceParams,\n ResolveInterfaceResult,\n} from './resolve-interface';\nimport type {\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n} from './schedule-background-event';\nimport type { SetStateParams, SetStateResult } from './set-state';\nimport type { TrackEventParams, TrackEventResult } from './track-event';\nimport type {\n UpdateInterfaceParams,\n UpdateInterfaceResult,\n} from './update-interface';\nimport type { Method } from '../../internals';\n\n/**\n * The methods that are available to the Snap. Each method is a tuple of the\n * request parameters and the result returned by the method.\n */\nexport type SnapMethods = {\n /* eslint-disable @typescript-eslint/naming-convention */\n snap_clearState: [ClearStateParams, ClearStateResult];\n snap_dialog: [DialogParams, DialogResult];\n snap_getBip32Entropy: [GetBip32EntropyParams, GetBip32EntropyResult];\n snap_getBip32PublicKey: [GetBip32PublicKeyParams, GetBip32PublicKeyResult];\n snap_getBip44Entropy: [GetBip44EntropyParams, GetBip44EntropyResult];\n snap_getClientStatus: [GetClientStatusParams, GetClientStatusResult];\n snap_getCurrencyRate: [GetCurrencyRateParams, GetCurrencyRateResult];\n snap_getEntropy: [GetEntropyParams, GetEntropyResult];\n snap_getFile: [GetFileParams, GetFileResult];\n snap_getLocale: [GetLocaleParams, GetLocaleResult];\n snap_getPreferences: [GetPreferencesParams, GetPreferencesResult];\n snap_getState: [GetStateParams, GetStateResult];\n snap_listEntropySources: [ListEntropySourcesParams, ListEntropySourcesResult];\n snap_manageAccounts: [ManageAccountsParams, ManageAccountsResult];\n snap_manageState: [ManageStateParams, ManageStateResult];\n snap_notify: [NotifyParams, NotifyResult];\n snap_scheduleBackgroundEvent: [\n ScheduleBackgroundEventParams,\n ScheduleBackgroundEventResult,\n ];\n snap_cancelBackgroundEvent: [\n CancelBackgroundEventParams,\n CancelBackgroundEventResult,\n ];\n snap_getBackgroundEvents: [\n GetBackgroundEventsParams,\n GetBackgroundEventsResult,\n ];\n snap_createInterface: [CreateInterfaceParams, CreateInterfaceResult];\n snap_updateInterface: [UpdateInterfaceParams, UpdateInterfaceResult];\n snap_getInterfaceState: [GetInterfaceStateParams, GetInterfaceStateResult];\n snap_getInterfaceContext: [\n GetInterfaceContextParams,\n GetInterfaceContextResult,\n ];\n snap_resolveInterface: [ResolveInterfaceParams, ResolveInterfaceResult];\n snap_setState: [SetStateParams, SetStateResult];\n snap_trackEvent: [TrackEventParams, TrackEventResult];\n wallet_getSnaps: [GetSnapsParams, GetSnapsResult];\n wallet_invokeKeyring: [InvokeKeyringParams, InvokeKeyringResult];\n wallet_invokeSnap: [InvokeSnapParams, InvokeSnapResult];\n wallet_snap: [InvokeSnapParams, InvokeSnapResult];\n wallet_requestSnaps: [RequestSnapsParams, RequestSnapsResult];\n /* eslint-enable @typescript-eslint/naming-convention */\n};\n\n/**\n * The request function that is available to the Snap. It takes a request\n * object and returns a promise that resolves to the result of the request.\n *\n * @param request - The request object.\n * @param request.method - The method to call.\n * @param request.params - The parameters to pass to the method. This is\n * inferred from the method, based on the {@link SnapMethods} type, and may be\n * optional.\n * @returns A promise that resolves to the result of the request. This is\n * inferred from the request method, based on the {@link SnapMethods} type.\n * @example\n * // Get the user's locale\n * const result = await request({\n * method: 'snap_getLocale',\n * });\n * @example\n * // Get a file\n * const result = await request({\n * method: 'snap_getFile',\n * params: {\n * path: 'foo/bar.txt',\n * },\n * });\n */\nexport type RequestFunction = <MethodName extends keyof SnapMethods>(\n request: Method<MethodName, SnapMethods[MethodName][0]>,\n) => Promise<SnapMethods[MethodName][1]>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track-event.cjs","sourceRoot":"","sources":["../../../src/types/methods/track-event.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\n/**\n * The parameters for the `snap_trackEvent` method.\n *\n * @property event - Primary payload object containing other metrics properties.\n * @property event.event - The name of the event to track.\n * @property event.properties - Custom values to track.\n * @property event.sensitiveProperties - Sensitive values to track.\n */\nexport type TrackEventParams = {\n event: {\n event: string;\n properties?: Record<string, Json>;\n sensitiveProperties?: Record<string, Json>;\n };\n};\n\n/**\n * The result returned by the `snap_trackEvent` method.\n */\nexport type TrackEventResult = null;\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Json } from "@metamask/utils";
|
|
2
|
+
/**
|
|
3
|
+
* The parameters for the `snap_trackEvent` method.
|
|
4
|
+
*
|
|
5
|
+
* @property event - Primary payload object containing other metrics properties.
|
|
6
|
+
* @property event.event - The name of the event to track.
|
|
7
|
+
* @property event.properties - Custom values to track.
|
|
8
|
+
* @property event.sensitiveProperties - Sensitive values to track.
|
|
9
|
+
*/
|
|
10
|
+
export type TrackEventParams = {
|
|
11
|
+
event: {
|
|
12
|
+
event: string;
|
|
13
|
+
properties?: Record<string, Json>;
|
|
14
|
+
sensitiveProperties?: Record<string, Json>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The result returned by the `snap_trackEvent` method.
|
|
19
|
+
*/
|
|
20
|
+
export type TrackEventResult = null;
|
|
21
|
+
//# sourceMappingURL=track-event.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track-event.d.cts","sourceRoot":"","sources":["../../../src/types/methods/track-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAC5C,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Json } from "@metamask/utils";
|
|
2
|
+
/**
|
|
3
|
+
* The parameters for the `snap_trackEvent` method.
|
|
4
|
+
*
|
|
5
|
+
* @property event - Primary payload object containing other metrics properties.
|
|
6
|
+
* @property event.event - The name of the event to track.
|
|
7
|
+
* @property event.properties - Custom values to track.
|
|
8
|
+
* @property event.sensitiveProperties - Sensitive values to track.
|
|
9
|
+
*/
|
|
10
|
+
export type TrackEventParams = {
|
|
11
|
+
event: {
|
|
12
|
+
event: string;
|
|
13
|
+
properties?: Record<string, Json>;
|
|
14
|
+
sensitiveProperties?: Record<string, Json>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The result returned by the `snap_trackEvent` method.
|
|
19
|
+
*/
|
|
20
|
+
export type TrackEventResult = null;
|
|
21
|
+
//# sourceMappingURL=track-event.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track-event.d.mts","sourceRoot":"","sources":["../../../src/types/methods/track-event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAClC,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAC5C,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track-event.mjs","sourceRoot":"","sources":["../../../src/types/methods/track-event.ts"],"names":[],"mappings":"","sourcesContent":["import type { Json } from '@metamask/utils';\n\n/**\n * The parameters for the `snap_trackEvent` method.\n *\n * @property event - Primary payload object containing other metrics properties.\n * @property event.event - The name of the event to track.\n * @property event.properties - Custom values to track.\n * @property event.sensitiveProperties - Sensitive values to track.\n */\nexport type TrackEventParams = {\n event: {\n event: string;\n properties?: Record<string, Json>;\n sensitiveProperties?: Record<string, Json>;\n };\n};\n\n/**\n * The result returned by the `snap_trackEvent` method.\n */\nexport type TrackEventResult = null;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/snaps-sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.23.0",
|
|
4
4
|
"description": "A library containing the core functionality for building MetaMask Snaps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
94
|
"@metamask/key-tree": "^10.1.1",
|
|
95
|
-
"@metamask/providers": "^22.0
|
|
95
|
+
"@metamask/providers": "^22.1.0",
|
|
96
96
|
"@metamask/rpc-errors": "^7.0.2",
|
|
97
97
|
"@metamask/superstruct": "^3.2.1",
|
|
98
98
|
"@metamask/utils": "^11.4.0"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
|
-
"@lavamoat/allow-scripts": "^3.
|
|
102
|
-
"@metamask/auto-changelog": "^5.0.
|
|
101
|
+
"@lavamoat/allow-scripts": "^3.3.3",
|
|
102
|
+
"@metamask/auto-changelog": "^5.0.2",
|
|
103
103
|
"@ts-bridge/cli": "^0.6.1",
|
|
104
104
|
"@types/jest": "^27.5.1",
|
|
105
105
|
"deepmerge": "^4.2.2",
|