@1shotapi/ows-types 0.12.0 → 0.13.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.
@@ -8,29 +8,27 @@ export interface IExecutionPermission {
8
8
  isAdjustmentAllowed: boolean;
9
9
  data: Record<string, unknown>;
10
10
  }
11
- /** EIP-7715 rule constraining a permission (e.g. expiry). */
12
- export interface IExecutionPermissionRule {
13
- type: string;
14
- data: Record<string, unknown>;
15
- }
16
11
  /**
17
- * One appended caveat on an EIP-7715 permission request.
12
+ * EIP-7715 rule constraining a permission (e.g. expiry, allowedTargets).
18
13
  *
19
- * The wire shape nests the caveat's config under `data` (consistent with
20
- * `IExecutionPermission.data`), rather than the spread form
21
- * `@metamask/smart-accounts-kit`'s `CoreCaveatConfiguration` uses internally
22
- * (`{ type, ...config }`). At sign time the wallet maps `data` to the kit's
23
- * caveat config via `builder.addCaveat(type, data)` and merges the result onto
24
- * the top-level scope through `createDelegation({ scope, caveats })`.
14
+ * Host-stacked enforcers on `wallet_requestExecutionPermissions` use optional
15
+ * top-level `rules[]` with this shape. At sign time the wallet maps each entry
16
+ * via `builder.addCaveat(type, data)` / `createDelegation({ scope, caveats })`
17
+ * — MetaMask kit “caveats” are the on-delegation concept after that mapping.
25
18
  *
26
- * `type` matches a `CaveatType` value from `@metamask/smart-accounts-kit`.
27
- * `data` carries the config for that caveat's builder (e.g.
28
- * `{ startIndex: 4, value: "0x..." }` for `allowedCalldata`).
19
+ * `type` matches a kit `CaveatType` (or a wallet-allowlisted custom enforcer such
20
+ * as `chainlink-price-rule`). `data` carries the builder config for that type
21
+ * (e.g. `{ targets: address[] }` for `allowedTargets`).
29
22
  */
30
- export interface IAppendedCaveatConfiguration {
23
+ export interface IExecutionPermissionRule {
31
24
  type: string;
32
25
  data: Record<string, unknown>;
33
26
  }
27
+ /**
28
+ * Alias for {@link IExecutionPermissionRule} used at wallet DF mapping call sites
29
+ * that still speak “appended caveats” after host `rules` → `addCaveat`.
30
+ */
31
+ export type IAppendedCaveatConfiguration = IExecutionPermissionRule;
34
32
  /**
35
33
  * One entry in `wallet_requestExecutionPermissions` params.
36
34
  * `params` is the array of these objects (not nested in a further wrapper).
@@ -42,14 +40,12 @@ export interface IExecutionPermissionRequest {
42
40
  /** Session / delegatee account that receives the permission. */
43
41
  to: EVMAccountAddress;
44
42
  permission: IExecutionPermission;
45
- rules?: IExecutionPermissionRule[];
46
43
  /**
47
- * Appended caveats merged onto the top-level `permission` scope at sign time,
48
- * mirroring `createDelegation({ scope, caveats })` in
49
- * `@metamask/smart-accounts-kit`. Optional + additive: omitting it keeps the
50
- * legacy single-scope behaviour.
44
+ * Host-stacked enforcer configs (EIP-7715 `rules`), AND-ed onto the
45
+ * top-level `permission` scope at sign time. Optional + additive: omitting
46
+ * it keeps single-scope behaviour.
51
47
  */
52
- caveats?: IAppendedCaveatConfiguration[];
48
+ rules?: IExecutionPermissionRule[];
53
49
  }
54
50
  /** ERC-4337 factory dependency required before redeeming a permission. */
55
51
  export interface IExecutionPermissionDependency {
@@ -1 +1 @@
1
- {"version":3,"file":"eip7715.d.ts","sourceRoot":"","sources":["../../src/eip1193/eip7715.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,SAAS,EACV,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,EAAE,OAAO,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,6DAA6D;AAC7D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb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AI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,UAAU,CAAC;IACpB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,gEAAgE;IAChE,EAAE,EAAE,iBAAiB,CAAC;IACtB,UAAU,EAAE,oBAAoB,CAAC;IACjC;;;;OAIG;IACH,KAAK,CAAC,EAAE,wBAAwB,EAAE,CAAC;CACpC;AAED,0EAA0E;AAC1E,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,kBAAkB,CAAC;IAC5B,WAAW,EAAE,SAAS,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA6B,SAAQ,2BAA2B;IAC/E,OAAO,EAAE,SAAS,CAAC;IACnB,YAAY,EAAE,8BAA8B,EAAE,CAAC;IAC/C,iBAAiB,EAAE,kBAAkB,CAAC;CACvC;AAED,4DAA4D;AAC5D,MAAM,WAAW,gCAAgC;IAC/C,iBAAiB,EAAE,SAAS,CAAC;CAC9B;AAED,wFAAwF;AACxF,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,UAAU,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAChD,MAAM,EACN,kCAAkC,CACnC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1shotapi/ows-types",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "Shared OWS TypeScript types and error classes for host, wallet, and signer SDKs",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",