@metamask-previews/authenticated-user-storage 2.0.0-preview-51b287c55 → 2.0.0-preview-2f3fe6006
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 +0 -10
- package/README.md +1 -26
- package/dist/authenticated-user-storage-method-action-types.cjs.map +1 -1
- package/dist/authenticated-user-storage-method-action-types.d.cts +1 -26
- package/dist/authenticated-user-storage-method-action-types.d.cts.map +1 -1
- package/dist/authenticated-user-storage-method-action-types.d.mts +1 -26
- package/dist/authenticated-user-storage-method-action-types.d.mts.map +1 -1
- package/dist/authenticated-user-storage-method-action-types.mjs.map +1 -1
- package/dist/authenticated-user-storage.cjs +0 -64
- package/dist/authenticated-user-storage.cjs.map +1 -1
- package/dist/authenticated-user-storage.d.cts +1 -20
- package/dist/authenticated-user-storage.d.cts.map +1 -1
- package/dist/authenticated-user-storage.d.mts +1 -20
- package/dist/authenticated-user-storage.d.mts.map +1 -1
- package/dist/authenticated-user-storage.mjs +1 -65
- package/dist/authenticated-user-storage.mjs.map +1 -1
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -3
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +0 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +0 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +0 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/validators.cjs +1 -53
- package/dist/validators.cjs.map +1 -1
- package/dist/validators.d.cts +0 -58
- package/dist/validators.d.cts.map +1 -1
- package/dist/validators.d.mts +0 -58
- package/dist/validators.d.mts.map +1 -1
- package/dist/validators.mjs +1 -51
- package/dist/validators.mjs.map +1 -1
- package/package.json +2 -2
package/dist/validators.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.mjs","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validators.mjs","sourceRoot":"","sources":["../src/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,MAAM,EACN,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,MAAM,EACN,IAAI,EACL,8BAA8B;AAI/B;;;;;GAKG;AACH,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,iBAAiB,CAAC,CAAC;AAE3D,MAAM,YAAY,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,aAAa;IACvB,KAAK,EAAE,aAAa;IACpB,IAAI,EAAE,aAAa;CACpB,CAAC,CAAC;AAEH,MAAM,sBAAsB,GAAG,IAAI,CAAC;IAClC,QAAQ,EAAE,aAAa;IACvB,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,KAAK,CAAC,YAAY,CAAC;IAC5B,IAAI,EAAE,aAAa;IACnB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,IAAI,CAAC;IACpC,cAAc,EAAE,aAAa;IAC7B,UAAU,EAAE,aAAa;IACzB,SAAS,EAAE,aAAa;IACxB,WAAW,EAAE,MAAM,EAAE;IACrB,YAAY,EAAE,aAAa;IAC3B,IAAI,EAAE,MAAM,EAAE;CACf,CAAC,CAAC;AAEH,MAAM,wBAAwB,GAAG,IAAI,CAAC;IACpC,gBAAgB,EAAE,sBAAsB;IACxC,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC;AAEH,MAAM,2BAA2B,GAAG,IAAI,CAAC;IACvC,OAAO,EAAE,aAAa;IACtB,OAAO,EAAE,OAAO,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,8BAA8B,GAAG,IAAI,CAAC;IAC1C,yBAAyB,EAAE,OAAO,EAAE;IACpC,wBAAwB,E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AAI,EAAE,6BAA6B,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["import {\n array,\n assert,\n boolean,\n number,\n optional,\n pattern,\n string,\n type,\n} from '@metamask/superstruct';\n\nimport type { DelegationResponse, NotificationPreferences } from './types';\n\n/**\n * Matches a 0x-prefixed hex string with zero or more hex digits.\n * Unlike `StrictHexStruct` from `@metamask/utils` (which requires at least\n * one digit after the prefix), this also accepts `\"0x\"` — the standard\n * encoding for empty bytes that the delegation API returns.\n */\nconst HexDataStruct = pattern(string(), /^0x[0-9a-f]*$/iu);\n\nconst CaveatSchema = type({\n enforcer: HexDataStruct,\n terms: HexDataStruct,\n args: HexDataStruct,\n});\n\nconst SignedDelegationSchema = type({\n delegate: HexDataStruct,\n delegator: HexDataStruct,\n authority: HexDataStruct,\n caveats: array(CaveatSchema),\n salt: HexDataStruct,\n signature: HexDataStruct,\n});\n\nconst DelegationMetadataSchema = type({\n delegationHash: HexDataStruct,\n chainIdHex: HexDataStruct,\n allowance: HexDataStruct,\n tokenSymbol: string(),\n tokenAddress: HexDataStruct,\n type: string(),\n});\n\nconst DelegationResponseSchema = type({\n signedDelegation: SignedDelegationSchema,\n metadata: DelegationMetadataSchema,\n});\n\nconst WalletActivityAccountSchema = type({\n address: HexDataStruct,\n enabled: boolean(),\n});\n\nconst WalletActivityPreferenceSchema = type({\n inAppNotificationsEnabled: boolean(),\n pushNotificationsEnabled: boolean(),\n accounts: array(WalletActivityAccountSchema),\n});\n\nconst MarketingPreferenceSchema = type({\n inAppNotificationsEnabled: boolean(),\n pushNotificationsEnabled: boolean(),\n});\n\nconst PerpsWatchlistExchangeSchema = type({\n testnet: array(string()),\n mainnet: array(string()),\n});\n\nconst PerpsWatchlistMarketsSchema = type({\n hyperliquid: PerpsWatchlistExchangeSchema,\n myx: PerpsWatchlistExchangeSchema,\n});\n\nconst PerpsPreferenceSchema = type({\n inAppNotificationsEnabled: boolean(),\n pushNotificationsEnabled: boolean(),\n watchlistMarkets: optional(PerpsWatchlistMarketsSchema),\n});\n\nconst SocialAIPreferenceSchema = type({\n inAppNotificationsEnabled: boolean(),\n pushNotificationsEnabled: boolean(),\n txAmountLimit: optional(number()),\n mutedTraderProfileIds: array(string()),\n});\n\nconst NotificationPreferencesSchema = type({\n walletActivity: WalletActivityPreferenceSchema,\n marketing: MarketingPreferenceSchema,\n perps: PerpsPreferenceSchema,\n socialAI: SocialAIPreferenceSchema,\n});\n\n/**\n * Asserts that the given value is a valid `DelegationResponse[]`.\n *\n * @param data - The unknown value to validate.\n * @throws If the value does not match the expected schema.\n */\nexport function assertDelegationResponseArray(\n data: unknown,\n): asserts data is DelegationResponse[] {\n assert(data, array(DelegationResponseSchema));\n}\n\n/**\n * Asserts that the given value is a valid `NotificationPreferences`.\n *\n * @param data - The unknown value to validate.\n * @throws If the value does not match the expected schema.\n */\nexport function assertNotificationPreferences(\n data: unknown,\n): asserts data is NotificationPreferences {\n assert(data, NotificationPreferencesSchema);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/authenticated-user-storage",
|
|
3
|
-
"version": "2.0.0-preview-
|
|
3
|
+
"version": "2.0.0-preview-2f3fe6006",
|
|
4
4
|
"description": "SDK for authenticated (non-encrypted) user storage endpoints",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@metamask/base-data-service": "^0.1.3",
|
|
57
|
-
"@metamask/controller-utils": "^12.
|
|
57
|
+
"@metamask/controller-utils": "^12.1.0",
|
|
58
58
|
"@metamask/messenger": "^1.2.0",
|
|
59
59
|
"@metamask/superstruct": "^3.1.0",
|
|
60
60
|
"@metamask/utils": "^11.9.0"
|