@lit-protocol/vincent-ability-sdk 2.3.1 → 2.4.0-mma

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.
Files changed (104) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +52 -4
  3. package/dist/CHANGELOG.md +6 -0
  4. package/dist/README.md +52 -4
  5. package/dist/package.json +7 -1
  6. package/dist/src/gatedSigner.d.ts +2 -0
  7. package/dist/src/gatedSigner.d.ts.map +1 -0
  8. package/dist/src/gatedSigner.js +5 -0
  9. package/dist/src/gatedSigner.js.map +1 -0
  10. package/dist/src/index.d.ts +1 -1
  11. package/dist/src/index.d.ts.map +1 -1
  12. package/dist/src/index.js +3 -1
  13. package/dist/src/index.js.map +1 -1
  14. package/dist/src/lib/abilityHelpers/bigint-replace.d.ts +8 -0
  15. package/dist/src/lib/abilityHelpers/bigint-replace.d.ts.map +1 -0
  16. package/dist/src/lib/abilityHelpers/bigint-replace.js +14 -0
  17. package/dist/src/lib/abilityHelpers/bigint-replace.js.map +1 -0
  18. package/dist/src/lib/abilityHelpers/erc20-abi.d.ts +2 -0
  19. package/dist/src/lib/abilityHelpers/erc20-abi.d.ts.map +1 -0
  20. package/dist/src/lib/abilityHelpers/erc20-abi.js +122 -0
  21. package/dist/src/lib/abilityHelpers/erc20-abi.js.map +1 -0
  22. package/dist/src/lib/abilityHelpers/gasSponsorship/get-alchemy-chain-config.js +1 -1
  23. package/dist/src/lib/abilityHelpers/gasSponsorship/get-alchemy-chain-config.js.map +1 -1
  24. package/dist/src/lib/abilityHelpers/index.d.ts +2 -0
  25. package/dist/src/lib/abilityHelpers/index.d.ts.map +1 -1
  26. package/dist/src/lib/abilityHelpers/index.js +5 -1
  27. package/dist/src/lib/abilityHelpers/index.js.map +1 -1
  28. package/dist/src/lib/gatedSigner/helpers/eip712.d.ts +34 -0
  29. package/dist/src/lib/gatedSigner/helpers/eip712.d.ts.map +1 -0
  30. package/dist/src/lib/gatedSigner/helpers/eip712.js +30 -0
  31. package/dist/src/lib/gatedSigner/helpers/eip712.js.map +1 -0
  32. package/dist/src/lib/gatedSigner/helpers/hex.d.ts +5 -0
  33. package/dist/src/lib/gatedSigner/helpers/hex.d.ts.map +1 -0
  34. package/dist/src/lib/gatedSigner/helpers/hex.js +16 -0
  35. package/dist/src/lib/gatedSigner/helpers/hex.js.map +1 -0
  36. package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.d.ts +54 -0
  37. package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.d.ts.map +1 -0
  38. package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.js +91 -0
  39. package/dist/src/lib/gatedSigner/helpers/lifecycleFunctions.js.map +1 -0
  40. package/dist/src/lib/gatedSigner/helpers/lowLevelCall.d.ts +13 -0
  41. package/dist/src/lib/gatedSigner/helpers/lowLevelCall.d.ts.map +1 -0
  42. package/dist/src/lib/gatedSigner/helpers/lowLevelCall.js +21 -0
  43. package/dist/src/lib/gatedSigner/helpers/lowLevelCall.js.map +1 -0
  44. package/dist/src/lib/gatedSigner/helpers/schemas.d.ts +925 -0
  45. package/dist/src/lib/gatedSigner/helpers/schemas.d.ts.map +1 -0
  46. package/dist/src/lib/gatedSigner/helpers/schemas.js +64 -0
  47. package/dist/src/lib/gatedSigner/helpers/schemas.js.map +1 -0
  48. package/dist/src/lib/gatedSigner/helpers/signTransaction.d.ts +9 -0
  49. package/dist/src/lib/gatedSigner/helpers/signTransaction.d.ts.map +1 -0
  50. package/dist/src/lib/gatedSigner/helpers/signTransaction.js +30 -0
  51. package/dist/src/lib/gatedSigner/helpers/signTransaction.js.map +1 -0
  52. package/dist/src/lib/gatedSigner/helpers/signUserOperation.d.ts +15 -0
  53. package/dist/src/lib/gatedSigner/helpers/signUserOperation.d.ts.map +1 -0
  54. package/dist/src/lib/gatedSigner/helpers/signUserOperation.js +115 -0
  55. package/dist/src/lib/gatedSigner/helpers/signUserOperation.js.map +1 -0
  56. package/dist/src/lib/gatedSigner/helpers/simulation.d.ts +204 -0
  57. package/dist/src/lib/gatedSigner/helpers/simulation.d.ts.map +1 -0
  58. package/dist/src/lib/gatedSigner/helpers/simulation.js +93 -0
  59. package/dist/src/lib/gatedSigner/helpers/simulation.js.map +1 -0
  60. package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.d.ts +8 -0
  61. package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.d.ts.map +1 -0
  62. package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.js +177 -0
  63. package/dist/src/lib/gatedSigner/helpers/smartAccounts/kernel.js.map +1 -0
  64. package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.d.ts +26 -0
  65. package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.d.ts.map +1 -0
  66. package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.js +195 -0
  67. package/dist/src/lib/gatedSigner/helpers/smartAccounts/safe.js.map +1 -0
  68. package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.d.ts +20 -0
  69. package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.d.ts.map +1 -0
  70. package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.js +69 -0
  71. package/dist/src/lib/gatedSigner/helpers/toLitActionAccount.js.map +1 -0
  72. package/dist/src/lib/gatedSigner/helpers/transaction.d.ts +148 -0
  73. package/dist/src/lib/gatedSigner/helpers/transaction.d.ts.map +1 -0
  74. package/dist/src/lib/gatedSigner/helpers/transaction.js +87 -0
  75. package/dist/src/lib/gatedSigner/helpers/transaction.js.map +1 -0
  76. package/dist/src/lib/gatedSigner/helpers/userOperation.d.ts +200 -0
  77. package/dist/src/lib/gatedSigner/helpers/userOperation.d.ts.map +1 -0
  78. package/dist/src/lib/gatedSigner/helpers/userOperation.js +106 -0
  79. package/dist/src/lib/gatedSigner/helpers/userOperation.js.map +1 -0
  80. package/dist/src/lib/gatedSigner/helpers/validation.d.ts +43 -0
  81. package/dist/src/lib/gatedSigner/helpers/validation.d.ts.map +1 -0
  82. package/dist/src/lib/gatedSigner/helpers/validation.js +81 -0
  83. package/dist/src/lib/gatedSigner/helpers/validation.js.map +1 -0
  84. package/dist/src/lib/gatedSigner/index.d.ts +12 -0
  85. package/dist/src/lib/gatedSigner/index.d.ts.map +1 -0
  86. package/dist/src/lib/gatedSigner/index.js +19 -0
  87. package/dist/src/lib/gatedSigner/index.js.map +1 -0
  88. package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.d.ts +566 -0
  89. package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.d.ts.map +1 -0
  90. package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.js +48 -0
  91. package/dist/src/lib/gatedSigner/vincentGatedSignerAbility.js.map +1 -0
  92. package/dist/src/type-inference-verification/ability-definition-tests.d.ts +6 -6
  93. package/dist/src/type-inference-verification/allow-deny-test-cases-ability.d.ts +90 -90
  94. package/dist/src/type-inference-verification/allow-deny-test-cases.d.ts +8 -8
  95. package/dist/src/type-inference-verification/context-switching-tests.d.ts +3 -3
  96. package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.d.ts +533 -0
  97. package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.d.ts.map +1 -0
  98. package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.js +19 -0
  99. package/dist/src/type-inference-verification/create-vincent-gated-signer-ability.js.map +1 -0
  100. package/dist/src/type-inference-verification/parameter-inference-tests-tool.d.ts +58 -58
  101. package/dist/src/type-inference-verification/parameter-inference-tests.d.ts +5 -5
  102. package/dist/src/type-inference-verification/playground.d.ts +8 -8
  103. package/dist/src/type-inference-verification/schema-test.d.ts +5 -5
  104. package/package.json +8 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.3.4 (2025-11-23)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated contracts-sdk to 5.0.0
6
+
1
7
  ## 2.3.1 (2025-10-08)
2
8
 
3
9
  ### 🧱 Updated Dependencies
package/README.md CHANGED
@@ -12,7 +12,7 @@ Run `nx build ability-sdk` to build the library.
12
12
 
13
13
  This library provides a type-safe lifecycle system for defining and composing **policies** and **abilities**, with strong TypeScript inference support throughout.
14
14
 
15
- ## 🧩 Core Concepts
15
+ ## Core Concepts
16
16
 
17
17
  - **Policies** encapsulate decision logic (precheck, evaluate, commit) and define their input/output schemas.
18
18
  - **Abilities** orchestrate multiple policies and expose `precheck` and `execute` lifecycle methods.
@@ -21,7 +21,7 @@ This library provides a type-safe lifecycle system for defining and composing **
21
21
 
22
22
  ---
23
23
 
24
- ### 🔁 Calling `commit()` on a Policy from within a Ability
24
+ ### Calling `commit()` on a Policy from within a Ability
25
25
 
26
26
  Policies can define a `commit()` lifecycle method to finalize changes once an ability executes successfully. These `commit()` functions are injected automatically into the `allowedPolicies` object of the `AbilityContext`.
27
27
 
@@ -208,6 +208,54 @@ export const myTokenSwapAbility = createVincentAbility({
208
208
  });
209
209
  ```
210
210
 
211
- ## 🧠 Tip
211
+ ---
212
+
213
+ ### Gated Signer Ability
214
+
215
+ A **Gated Signer Ability** is a specialized ability designed to validate and sign EOA transactions or AA user operations. It enforces a strict validation lifecycle before using the delegated PKP to sign the request.
216
+
217
+ #### Lifecycle
218
+
219
+ 1. **Decode**: The ability decodes the transaction data using the provided `decodeTransaction` function.
220
+ 2. **Simulation**: The ability simulates the transaction/userOperation on-chain to determine asset changes.
221
+ 3. **Validate Simulation**: The `validateSimulation` function checks if the simulation results are acceptable (e.g., no unexpected asset transfers).
222
+ 4. **Validate Transaction**: The `validateTransaction` function inspects the decoded transaction to ensure it complies with security policies (e.g., allowed contracts, methods, arguments).
223
+ 5. **Sign**: If all validations pass, the ability signs the transaction or userOperation using the PKP.
224
+
225
+ #### Creating a Gated Signer Ability
226
+
227
+ You can create a Gated Signer Ability using `createVincentGatedSignerAbility`:
228
+
229
+ ```ts
230
+ import { createVincentGatedSignerAbility } from '@lit-protocol/vincent-ability-sdk/gatedSigner';
231
+
232
+ import { decodeTransaction } from './decodeTransaction';
233
+ import { validateSimulation } from './validateSimulation';
234
+ import { validateTransaction } from './validateTransaction';
235
+
236
+ export const myGatedSignerAbility = createVincentGatedSignerAbility({
237
+ packageName: '@my-org/my-gated-signer',
238
+ abilityDescription: 'Safely signs transactions for My Protocol',
239
+
240
+ // Lifecycle functions
241
+ decodeTransaction,
242
+ validateSimulation,
243
+ validateTransaction,
244
+ });
245
+ ```
246
+
247
+ The lifecycle functions must implement the `LifecycleFunctionSteps` interface:
248
+
249
+ ```ts
250
+ interface LifecycleFunctionSteps {
251
+ decodeTransaction: (params: DecodeTransactionParams) => DecodedTransaction;
252
+ validateSimulation: (params: ValidateSimulationParams) => void;
253
+ validateTransaction: (params: ValidateTransactionParams) => void;
254
+ }
255
+ ```
256
+
257
+ This abstraction simplifies the creation of abilities that act as secure signers, ensuring consistent validation logic across different implementations.
258
+
259
+ ## Tip
212
260
 
213
- Ability and policy authors should export the result of `createVincentPolicy()` / `createVincentAbility()`
261
+ Ability and policy authors should export the result of `createVincentPolicy()` / `createVincentAbility()` / `createVincentGatedSignerAbility()`
package/dist/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 2.3.4 (2025-11-23)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated contracts-sdk to 5.0.0
6
+
1
7
  ## 2.3.1 (2025-10-08)
2
8
 
3
9
  ### 🧱 Updated Dependencies
package/dist/README.md CHANGED
@@ -12,7 +12,7 @@ Run `nx build ability-sdk` to build the library.
12
12
 
13
13
  This library provides a type-safe lifecycle system for defining and composing **policies** and **abilities**, with strong TypeScript inference support throughout.
14
14
 
15
- ## 🧩 Core Concepts
15
+ ## Core Concepts
16
16
 
17
17
  - **Policies** encapsulate decision logic (precheck, evaluate, commit) and define their input/output schemas.
18
18
  - **Abilities** orchestrate multiple policies and expose `precheck` and `execute` lifecycle methods.
@@ -21,7 +21,7 @@ This library provides a type-safe lifecycle system for defining and composing **
21
21
 
22
22
  ---
23
23
 
24
- ### 🔁 Calling `commit()` on a Policy from within a Ability
24
+ ### Calling `commit()` on a Policy from within a Ability
25
25
 
26
26
  Policies can define a `commit()` lifecycle method to finalize changes once an ability executes successfully. These `commit()` functions are injected automatically into the `allowedPolicies` object of the `AbilityContext`.
27
27
 
@@ -208,6 +208,54 @@ export const myTokenSwapAbility = createVincentAbility({
208
208
  });
209
209
  ```
210
210
 
211
- ## 🧠 Tip
211
+ ---
212
+
213
+ ### Gated Signer Ability
214
+
215
+ A **Gated Signer Ability** is a specialized ability designed to validate and sign EOA transactions or AA user operations. It enforces a strict validation lifecycle before using the delegated PKP to sign the request.
216
+
217
+ #### Lifecycle
218
+
219
+ 1. **Decode**: The ability decodes the transaction data using the provided `decodeTransaction` function.
220
+ 2. **Simulation**: The ability simulates the transaction/userOperation on-chain to determine asset changes.
221
+ 3. **Validate Simulation**: The `validateSimulation` function checks if the simulation results are acceptable (e.g., no unexpected asset transfers).
222
+ 4. **Validate Transaction**: The `validateTransaction` function inspects the decoded transaction to ensure it complies with security policies (e.g., allowed contracts, methods, arguments).
223
+ 5. **Sign**: If all validations pass, the ability signs the transaction or userOperation using the PKP.
224
+
225
+ #### Creating a Gated Signer Ability
226
+
227
+ You can create a Gated Signer Ability using `createVincentGatedSignerAbility`:
228
+
229
+ ```ts
230
+ import { createVincentGatedSignerAbility } from '@lit-protocol/vincent-ability-sdk/gatedSigner';
231
+
232
+ import { decodeTransaction } from './decodeTransaction';
233
+ import { validateSimulation } from './validateSimulation';
234
+ import { validateTransaction } from './validateTransaction';
235
+
236
+ export const myGatedSignerAbility = createVincentGatedSignerAbility({
237
+ packageName: '@my-org/my-gated-signer',
238
+ abilityDescription: 'Safely signs transactions for My Protocol',
239
+
240
+ // Lifecycle functions
241
+ decodeTransaction,
242
+ validateSimulation,
243
+ validateTransaction,
244
+ });
245
+ ```
246
+
247
+ The lifecycle functions must implement the `LifecycleFunctionSteps` interface:
248
+
249
+ ```ts
250
+ interface LifecycleFunctionSteps {
251
+ decodeTransaction: (params: DecodeTransactionParams) => DecodedTransaction;
252
+ validateSimulation: (params: ValidateSimulationParams) => void;
253
+ validateTransaction: (params: ValidateTransactionParams) => void;
254
+ }
255
+ ```
256
+
257
+ This abstraction simplifies the creation of abilities that act as secure signers, ensuring consistent validation logic across different implementations.
258
+
259
+ ## Tip
212
260
 
213
- Ability and policy authors should export the result of `createVincentPolicy()` / `createVincentAbility()`
261
+ Ability and policy authors should export the result of `createVincentPolicy()` / `createVincentAbility()` / `createVincentGatedSignerAbility()`
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lit-protocol/vincent-ability-sdk",
3
- "version": "2.3.1",
3
+ "version": "2.3.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,6 +12,7 @@
12
12
  "ethers-v6": "npm:ethers@^6",
13
13
  "semver": "^7.7.2",
14
14
  "tslib": "^2.8.1",
15
+ "viem": "^2.40.3",
15
16
  "zod": "^3.25.64"
16
17
  },
17
18
  "scripts": {
@@ -32,6 +33,11 @@
32
33
  "./internal": {
33
34
  "require": "./dist/src/internal.js",
34
35
  "import": "./dist/src/internal.js"
36
+ },
37
+ "./gatedSigner": {
38
+ "require": "./dist/src/gatedSigner.js",
39
+ "import": "./dist/src/gatedSigner.js",
40
+ "types": "./dist/src/gatedSigner.d.ts"
35
41
  }
36
42
  },
37
43
  "devDependencies": {
@@ -0,0 +1,2 @@
1
+ export * from './lib/gatedSigner';
2
+ //# sourceMappingURL=gatedSigner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gatedSigner.d.ts","sourceRoot":"","sources":["../../src/gatedSigner.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./lib/gatedSigner"), exports);
5
+ //# sourceMappingURL=gatedSigner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gatedSigner.js","sourceRoot":"","sources":["../../src/gatedSigner.ts"],"names":[],"mappings":";;;AAAA,4DAAkC"}
@@ -12,5 +12,5 @@ export type { PolicyConfigLifecycleFunction, PolicyConfigCommitFunction, } from
12
12
  export type { PolicyContext } from './lib/policyCore/policyConfig/context/types';
13
13
  export type { VincentAbilityPolicy, BaseContext, PolicyEvaluationResultContext, VincentAbility, AbilityConsumerContext, PolicyConsumerContext, SchemaValidationError, } from './lib/types';
14
14
  export type { BaseAbilityContext } from './lib/abilityCore/abilityConfig/context/types';
15
- export { populateTransaction, sponsoredGasRawTransaction, sponsoredGasContractCall, } from './lib/abilityHelpers';
15
+ export { populateTransaction, sponsoredGasRawTransaction, sponsoredGasContractCall, ERC20_ABI, bigIntReplacer, } from './lib/abilityHelpers';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iDAAiD,CAAC;AAC1F,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAC;AAEpG,YAAY,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACjF,YAAY,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AACpF,YAAY,EACV,6BAA6B,EAC7B,0BAA0B,GAC3B,MAAM,qCAAqC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,+CAA+C,CAAC;AAExF,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,SAAS,EACT,cAAc,GACf,MAAM,sBAAsB,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sponsoredGasContractCall = exports.sponsoredGasRawTransaction = exports.populateTransaction = exports.supportedPoliciesForAbility = exports.asBundledVincentPolicy = exports.asBundledVincentAbility = exports.vincentAbilityHandler = exports.vincentPolicyHandler = exports.VINCENT_TOOL_API_VERSION = exports.createVincentAbility = exports.createVincentAbilityPolicy = exports.createVincentPolicy = void 0;
3
+ exports.bigIntReplacer = exports.ERC20_ABI = exports.sponsoredGasContractCall = exports.sponsoredGasRawTransaction = exports.populateTransaction = exports.supportedPoliciesForAbility = exports.asBundledVincentPolicy = exports.asBundledVincentAbility = exports.vincentAbilityHandler = exports.vincentPolicyHandler = exports.VINCENT_TOOL_API_VERSION = exports.createVincentAbility = exports.createVincentAbilityPolicy = exports.createVincentPolicy = void 0;
4
4
  var vincentPolicy_1 = require("./lib/policyCore/vincentPolicy");
5
5
  Object.defineProperty(exports, "createVincentPolicy", { enumerable: true, get: function () { return vincentPolicy_1.createVincentPolicy; } });
6
6
  Object.defineProperty(exports, "createVincentAbilityPolicy", { enumerable: true, get: function () { return vincentPolicy_1.createVincentAbilityPolicy; } });
@@ -22,4 +22,6 @@ var abilityHelpers_1 = require("./lib/abilityHelpers");
22
22
  Object.defineProperty(exports, "populateTransaction", { enumerable: true, get: function () { return abilityHelpers_1.populateTransaction; } });
23
23
  Object.defineProperty(exports, "sponsoredGasRawTransaction", { enumerable: true, get: function () { return abilityHelpers_1.sponsoredGasRawTransaction; } });
24
24
  Object.defineProperty(exports, "sponsoredGasContractCall", { enumerable: true, get: function () { return abilityHelpers_1.sponsoredGasContractCall; } });
25
+ Object.defineProperty(exports, "ERC20_ABI", { enumerable: true, get: function () { return abilityHelpers_1.ERC20_ABI; } });
26
+ Object.defineProperty(exports, "bigIntReplacer", { enumerable: true, get: function () { return abilityHelpers_1.bigIntReplacer; } });
25
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiG;AAAxF,oHAAA,mBAAmB,OAAA;AAAE,2HAAA,0BAA0B,OAAA;AACxD,mEAAwE;AAA/D,sHAAA,oBAAoB,OAAA;AAC7B,6CAA2D;AAAlD,qHAAA,wBAAwB,OAAA;AAEjC,4EAA2E;AAAlE,4HAAA,oBAAoB,OAAA;AAC7B,8EAA6E;AAApE,8HAAA,qBAAqB,OAAA;AAE9B,kFAA0F;AAAjF,yHAAA,uBAAuB,OAAA;AAChC,8EAAsF;AAA7E,uHAAA,sBAAsB,OAAA;AAC/B,qGAAoG;AAA3F,0IAAA,2BAA2B,OAAA;AAsBpC,uDAI8B;AAH5B,qHAAA,mBAAmB,OAAA;AACnB,4HAAA,0BAA0B,OAAA;AAC1B,0HAAA,wBAAwB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,gEAAiG;AAAxF,oHAAA,mBAAmB,OAAA;AAAE,2HAAA,0BAA0B,OAAA;AACxD,mEAAwE;AAA/D,sHAAA,oBAAoB,OAAA;AAC7B,6CAA2D;AAAlD,qHAAA,wBAAwB,OAAA;AAEjC,4EAA2E;AAAlE,4HAAA,oBAAoB,OAAA;AAC7B,8EAA6E;AAApE,8HAAA,qBAAqB,OAAA;AAE9B,kFAA0F;AAAjF,yHAAA,uBAAuB,OAAA;AAChC,8EAAsF;AAA7E,uHAAA,sBAAsB,OAAA;AAC/B,qGAAoG;AAA3F,0IAAA,2BAA2B,OAAA;AAsBpC,uDAM8B;AAL5B,qHAAA,mBAAmB,OAAA;AACnB,4HAAA,0BAA0B,OAAA;AAC1B,0HAAA,wBAAwB,OAAA;AACxB,2GAAA,SAAS,OAAA;AACT,gHAAA,cAAc,OAAA"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Replace bigint values with strings in JSON.stringify
3
+ * @param key - The key of the value
4
+ * @param value - The value to replace
5
+ * @returns The replaced value
6
+ */
7
+ export declare const bigIntReplacer: (key: string, value: unknown) => unknown;
8
+ //# sourceMappingURL=bigint-replace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint-replace.d.ts","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/bigint-replace.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,EAAE,OAAO,OAAO,KAAG,OAE5D,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bigIntReplacer = void 0;
4
+ /**
5
+ * Replace bigint values with strings in JSON.stringify
6
+ * @param key - The key of the value
7
+ * @param value - The value to replace
8
+ * @returns The replaced value
9
+ */
10
+ const bigIntReplacer = (key, value) => {
11
+ return typeof value === 'bigint' ? value.toString() : value;
12
+ };
13
+ exports.bigIntReplacer = bigIntReplacer;
14
+ //# sourceMappingURL=bigint-replace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigint-replace.js","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/bigint-replace.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,KAAc,EAAW,EAAE;IACrE,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,cAAc,kBAEzB"}
@@ -0,0 +1,2 @@
1
+ export declare const ERC20_ABI: any[];
2
+ //# sourceMappingURL=erc20-abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20-abi.d.ts","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/erc20-abi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,EAAE,GAAG,EAqH1B,CAAC"}
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ERC20_ABI = void 0;
4
+ exports.ERC20_ABI = [
5
+ {
6
+ inputs: [],
7
+ name: 'name',
8
+ outputs: [{ internalType: 'string', name: '', type: 'string' }],
9
+ stateMutability: 'view',
10
+ type: 'function',
11
+ },
12
+ {
13
+ inputs: [],
14
+ name: 'symbol',
15
+ outputs: [{ internalType: 'string', name: '', type: 'string' }],
16
+ stateMutability: 'view',
17
+ type: 'function',
18
+ },
19
+ {
20
+ inputs: [],
21
+ name: 'decimals',
22
+ outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],
23
+ stateMutability: 'view',
24
+ type: 'function',
25
+ },
26
+ {
27
+ inputs: [],
28
+ name: 'totalSupply',
29
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
30
+ stateMutability: 'view',
31
+ type: 'function',
32
+ },
33
+ {
34
+ inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
35
+ name: 'balanceOf',
36
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
37
+ stateMutability: 'view',
38
+ type: 'function',
39
+ },
40
+ {
41
+ inputs: [
42
+ { internalType: 'address', name: 'to', type: 'address' },
43
+ { internalType: 'uint256', name: 'value', type: 'uint256' },
44
+ ],
45
+ name: 'transfer',
46
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
47
+ stateMutability: 'nonpayable',
48
+ type: 'function',
49
+ },
50
+ {
51
+ inputs: [
52
+ { internalType: 'address', name: 'owner', type: 'address' },
53
+ { internalType: 'address', name: 'spender', type: 'address' },
54
+ ],
55
+ name: 'allowance',
56
+ outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
57
+ stateMutability: 'view',
58
+ type: 'function',
59
+ },
60
+ {
61
+ inputs: [
62
+ { internalType: 'address', name: 'spender', type: 'address' },
63
+ { internalType: 'uint256', name: 'value', type: 'uint256' },
64
+ ],
65
+ name: 'approve',
66
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
67
+ stateMutability: 'nonpayable',
68
+ type: 'function',
69
+ },
70
+ {
71
+ inputs: [
72
+ { internalType: 'address', name: 'from', type: 'address' },
73
+ { internalType: 'address', name: 'to', type: 'address' },
74
+ { internalType: 'uint256', name: 'value', type: 'uint256' },
75
+ ],
76
+ name: 'transferFrom',
77
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
78
+ stateMutability: 'nonpayable',
79
+ type: 'function',
80
+ },
81
+ {
82
+ inputs: [
83
+ { internalType: 'address', name: 'spender', type: 'address' },
84
+ { internalType: 'uint256', name: 'addedValue', type: 'uint256' },
85
+ ],
86
+ name: 'increaseAllowance',
87
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
88
+ stateMutability: 'nonpayable',
89
+ type: 'function',
90
+ },
91
+ {
92
+ inputs: [
93
+ { internalType: 'address', name: 'spender', type: 'address' },
94
+ { internalType: 'uint256', name: 'subtractedValue', type: 'uint256' },
95
+ ],
96
+ name: 'decreaseAllowance',
97
+ outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
98
+ stateMutability: 'nonpayable',
99
+ type: 'function',
100
+ },
101
+ {
102
+ anonymous: false,
103
+ inputs: [
104
+ { indexed: true, internalType: 'address', name: 'from', type: 'address' },
105
+ { indexed: true, internalType: 'address', name: 'to', type: 'address' },
106
+ { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
107
+ ],
108
+ name: 'Transfer',
109
+ type: 'event',
110
+ },
111
+ {
112
+ anonymous: false,
113
+ inputs: [
114
+ { indexed: true, internalType: 'address', name: 'owner', type: 'address' },
115
+ { indexed: true, internalType: 'address', name: 'spender', type: 'address' },
116
+ { indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
117
+ ],
118
+ name: 'Approval',
119
+ type: 'event',
120
+ },
121
+ ];
122
+ //# sourceMappingURL=erc20-abi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"erc20-abi.js","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/erc20-abi.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAU;IAC9B;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC/D,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC/D,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC7D,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACjE,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACvE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,CAAC,EAAE,YAAY,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QAC3D,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;YACzE,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE;YACvE,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;SAC5E;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;IACD;QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC1E,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5E,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;SAC5E;QACD,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,OAAO;KACd;CACF,CAAC"}
@@ -51,7 +51,7 @@ function getAlchemyChainConfig(chainId) {
51
51
  infra_1.riseTestnet,
52
52
  infra_1.storyMainnet,
53
53
  infra_1.storyAeneid,
54
- infra_1.celoAlfajores,
54
+ infra_1.celoSepolia,
55
55
  infra_1.celoMainnet,
56
56
  infra_1.teaSepolia,
57
57
  infra_1.bobaSepolia,
@@ -1 +1 @@
1
- {"version":3,"file":"get-alchemy-chain-config.js","sourceRoot":"","sources":["../../../../../src/lib/abilityHelpers/gasSponsorship/get-alchemy-chain-config.ts"],"names":[],"mappings":";;AAsDA,sDA6DC;AAnHD,8CA8C4B;AAE5B;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,OAAe;IACnD,uCAAuC;IACvC,MAAM,eAAe,GAAG;QACtB,gBAAQ;QACR,sBAAc;QACd,oBAAY;QACZ,uBAAe;QACf,YAAI;QACJ,kBAAU;QACV,mBAAW;QACX,eAAO;QACP,sBAAc;QACd,cAAM;QACN,eAAO;QACP,gBAAQ;QACR,sBAAc;QACd,uBAAe;QACf,eAAO;QACP,mBAAW;QACX,qBAAa;QACb,eAAO;QACP,aAAK;QACL,oBAAY;QACZ,kBAAU;QACV,yBAAiB;QACjB,YAAI;QACJ,mBAAW;QACX,uBAAe;QACf,oBAAY;QACZ,oBAAY;QACZ,qBAAa;QACb,sBAAc;QACd,uBAAe;QACf,uBAAe;QACf,kBAAU;QACV,kBAAU;QACV,cAAM;QACN,oBAAY;QACZ,uBAAe;QACf,qBAAa;QACb,mBAAW;QACX,oBAAY;QACZ,mBAAW;QACX,qBAAa;QACb,mBAAW;QACX,kBAAU;QACV,mBAAW;QACX,mBAAW;KACZ,CAAC;IAEF,oDAAoD;IACpD,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IAE5D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,YAAY,OAAO,wCAAwC;YACzD,wBAAwB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxE,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"get-alchemy-chain-config.js","sourceRoot":"","sources":["../../../../../src/lib/abilityHelpers/gasSponsorship/get-alchemy-chain-config.ts"],"names":[],"mappings":";;AAsDA,sDA6DC;AAnHD,8CA8C4B;AAE5B;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,OAAe;IACnD,uCAAuC;IACvC,MAAM,eAAe,GAAG;QACtB,gBAAQ;QACR,sBAAc;QACd,oBAAY;QACZ,uBAAe;QACf,YAAI;QACJ,kBAAU;QACV,mBAAW;QACX,eAAO;QACP,sBAAc;QACd,cAAM;QACN,eAAO;QACP,gBAAQ;QACR,sBAAc;QACd,uBAAe;QACf,eAAO;QACP,mBAAW;QACX,qBAAa;QACb,eAAO;QACP,aAAK;QACL,oBAAY;QACZ,kBAAU;QACV,yBAAiB;QACjB,YAAI;QACJ,mBAAW;QACX,uBAAe;QACf,oBAAY;QACZ,oBAAY;QACZ,qBAAa;QACb,sBAAc;QACd,uBAAe;QACf,uBAAe;QACf,kBAAU;QACV,kBAAU;QACV,cAAM;QACN,oBAAY;QACZ,uBAAe;QACf,qBAAa;QACb,mBAAW;QACX,oBAAY;QACZ,mBAAW;QACX,mBAAW;QACX,mBAAW;QACX,kBAAU;QACV,mBAAW;QACX,mBAAW;KACZ,CAAC;IAEF,oDAAoD;IACpD,MAAM,KAAK,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IAE5D,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,YAAY,OAAO,wCAAwC;YACzD,wBAAwB,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxE,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -1,3 +1,5 @@
1
1
  export { populateTransaction } from './populateTransaction';
2
2
  export { sponsoredGasRawTransaction, sponsoredGasContractCall } from './gasSponsorship';
3
+ export { ERC20_ABI } from './erc20-abi';
4
+ export { bigIntReplacer } from './bigint-replace';
3
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,9 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sponsoredGasContractCall = exports.sponsoredGasRawTransaction = exports.populateTransaction = void 0;
3
+ exports.bigIntReplacer = exports.ERC20_ABI = exports.sponsoredGasContractCall = exports.sponsoredGasRawTransaction = exports.populateTransaction = void 0;
4
4
  var populateTransaction_1 = require("./populateTransaction");
5
5
  Object.defineProperty(exports, "populateTransaction", { enumerable: true, get: function () { return populateTransaction_1.populateTransaction; } });
6
6
  var gasSponsorship_1 = require("./gasSponsorship");
7
7
  Object.defineProperty(exports, "sponsoredGasRawTransaction", { enumerable: true, get: function () { return gasSponsorship_1.sponsoredGasRawTransaction; } });
8
8
  Object.defineProperty(exports, "sponsoredGasContractCall", { enumerable: true, get: function () { return gasSponsorship_1.sponsoredGasContractCall; } });
9
+ var erc20_abi_1 = require("./erc20-abi");
10
+ Object.defineProperty(exports, "ERC20_ABI", { enumerable: true, get: function () { return erc20_abi_1.ERC20_ABI; } });
11
+ var bigint_replace_1 = require("./bigint-replace");
12
+ Object.defineProperty(exports, "bigIntReplacer", { enumerable: true, get: function () { return bigint_replace_1.bigIntReplacer; } });
9
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/index.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,mDAAwF;AAA/E,4HAAA,0BAA0B,OAAA;AAAE,0HAAA,wBAAwB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/abilityHelpers/index.ts"],"names":[],"mappings":";;;AAAA,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,mDAAwF;AAA/E,4HAAA,0BAA0B,OAAA;AAAE,0HAAA,wBAAwB,OAAA;AAC7D,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
@@ -0,0 +1,34 @@
1
+ import { z } from 'zod';
2
+ export declare const eip712ParamsSchema: z.ZodObject<{
3
+ domain: z.ZodRecord<z.ZodString, z.ZodAny>;
4
+ types: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
5
+ name: z.ZodString;
6
+ type: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ type: string;
9
+ name: string;
10
+ }, {
11
+ type: string;
12
+ name: string;
13
+ }>, "many">>;
14
+ primaryType: z.ZodString;
15
+ message: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>]>>, Record<string, string | Record<string, any>>, Record<string, string | Record<string, any>>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ message: Record<string, string | Record<string, any>>;
18
+ domain: Record<string, any>;
19
+ types: Record<string, {
20
+ type: string;
21
+ name: string;
22
+ }[]>;
23
+ primaryType: string;
24
+ }, {
25
+ message: Record<string, string | Record<string, any>>;
26
+ domain: Record<string, any>;
27
+ types: Record<string, {
28
+ type: string;
29
+ name: string;
30
+ }[]>;
31
+ primaryType: string;
32
+ }>;
33
+ export type Eip712Params = z.infer<typeof eip712ParamsSchema>;
34
+ //# sourceMappingURL=eip712.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eip712.d.ts","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/eip712.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkC7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.eip712ParamsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.eip712ParamsSchema = zod_1.z.object({
6
+ domain: zod_1.z.record(zod_1.z.any()).describe('EIP-712 domain'),
7
+ types: zod_1.z
8
+ .record(zod_1.z.array(zod_1.z.object({ name: zod_1.z.string(), type: zod_1.z.string() })))
9
+ .describe('EIP-712 types'),
10
+ primaryType: zod_1.z.string().describe('EIP-712 primary type'),
11
+ message: zod_1.z
12
+ .record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.record(zod_1.z.string(), zod_1.z.any())]))
13
+ .describe('EIP-712 message template. Values must be strings starting with $ that resolve to a valid param (e.g. $userOp.sender, $validUntil).')
14
+ .refine((data) => {
15
+ const validateValue = (value) => {
16
+ if (typeof value === 'string') {
17
+ return (value.startsWith('$') &&
18
+ /^\$(userOp\.(sender|nonce|initCode|callData|callGasLimit|verificationGasLimit|preVerificationGas|maxFeePerGas|maxPriorityFeePerGas|paymasterAndData|signature|factory|factoryData|paymaster|paymasterData|paymasterPostOpGasLimit|paymasterVerificationGasLimit)|entryPointAddress|validAfter|validUntil|safe4337ModuleAddress)$/.test(value));
19
+ }
20
+ if (typeof value === 'object' && value !== null) {
21
+ return Object.values(value).every(validateValue);
22
+ }
23
+ return false;
24
+ };
25
+ return Object.values(data).every(validateValue);
26
+ }, {
27
+ message: 'Invalid message value. Must be a reference string starting with $ (e.g. $userOp.sender) or a nested object containing references.',
28
+ }),
29
+ });
30
+ //# sourceMappingURL=eip712.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eip712.js","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/eip712.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACpD,KAAK,EAAE,OAAC;SACL,MAAM,CAAC,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;SACjE,QAAQ,CAAC,eAAe,CAAC;IAC5B,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sBAAsB,CAAC;IACxD,OAAO,EAAE,OAAC;SACP,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;SACxE,QAAQ,CACP,oIAAoI,CACrI;SACA,MAAM,CACL,CAAC,IAAI,EAAE,EAAE;QACP,MAAM,aAAa,GAAG,CAAC,KAAU,EAAW,EAAE;YAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,OAAO,CACL,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;oBACrB,kUAAkU,CAAC,IAAI,CACrU,KAAK,CACN,CACF,CAAC;YACJ,CAAC;YACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;gBAChD,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YACnD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC;QACF,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAClD,CAAC,EACD;QACE,OAAO,EACL,mIAAmI;KACtI,CACF;CACJ,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export declare const addressSchema: z.ZodEffects<z.ZodString, `0x${string}`, string>;
3
+ export declare const hexSchema: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
4
+ export declare const hexOfBytesSchema: (bytes: number) => z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
5
+ //# sourceMappingURL=hex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.d.ts","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/hex.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa,kDAItB,CAAC;AAEL,eAAO,MAAM,SAAS,uDAEpB,CAAC;AAEH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,0DAI3C,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hexOfBytesSchema = exports.hexSchema = exports.addressSchema = void 0;
4
+ const viem_1 = require("viem");
5
+ const zod_1 = require("zod");
6
+ exports.addressSchema = zod_1.z
7
+ .string()
8
+ .refine((v) => (0, viem_1.isAddress)(v, { strict: false }), {
9
+ message: 'Invalid Ethereum address',
10
+ });
11
+ exports.hexSchema = zod_1.z.custom((v) => typeof v === 'string' && (0, viem_1.isHex)(v, { strict: true }), {
12
+ message: 'Invalid hex (must be 0x-prefixed, even length)',
13
+ });
14
+ const hexOfBytesSchema = (bytes) => zod_1.z.custom((v) => typeof v === 'string' && (0, viem_1.isHex)(v, { strict: true }) && (v.length - 2) / 2 === bytes, { message: `Invalid hex (must be 0x + ${bytes} bytes)` });
15
+ exports.hexOfBytesSchema = hexOfBytesSchema;
16
+ //# sourceMappingURL=hex.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hex.js","sourceRoot":"","sources":["../../../../../src/lib/gatedSigner/helpers/hex.ts"],"names":[],"mappings":";;;AAEA,+BAAwC;AACxC,6BAAwB;AAEX,QAAA,aAAa,GAAG,OAAC;KAC3B,MAAM,EAAE;KACR,MAAM,CAAC,CAAC,CAAC,EAAgB,EAAE,CAAC,IAAA,gBAAS,EAAC,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE;IAC5D,OAAO,EAAE,0BAA0B;CACpC,CAAC,CAAC;AAEQ,QAAA,SAAS,GAAG,OAAC,CAAC,MAAM,CAAM,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAA,YAAK,EAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE;IACjG,OAAO,EAAE,gDAAgD;CAC1D,CAAC,CAAC;AAEI,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE,CAChD,OAAC,CAAC,MAAM,CACN,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,IAAA,YAAK,EAAC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,KAAK,EAC1F,EAAE,OAAO,EAAE,6BAA6B,KAAK,SAAS,EAAE,CACzD,CAAC;AAJS,QAAA,gBAAgB,oBAIzB"}