@turnkey/gas-station 2.0.0 → 3.0.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.
@@ -12,15 +12,15 @@ import { gasStationAbi } from './abi/gas-station.mjs';
12
12
  * @param config.customConsensus - Optional custom consensus expression (overrides eoaUserId and additionalApprovers)
13
13
  * @param config.restrictions - Signing restrictions
14
14
  * @param config.restrictions.allowedContracts - Whitelist of contract addresses EOA can sign intents for
15
- * @param config.restrictions.disallowEthTransfer - Whether to disallow ETH transfers (if true, ethAmount must be 0)
15
+ * @param config.restrictions.disallowEthTransfer - Whether to disallow ETH transfers (if true, value must be 0)
16
16
  * @param config.policyName - Optional policy name
17
17
  * @returns Policy object ready to submit to Turnkey createPolicy API
18
18
  *
19
19
  * @example
20
20
  * // Simple: single user approval, token-only transfers
21
21
  * const policy = buildIntentSigningPolicy({
22
- * organizationId: "org-123",
23
- * eoaUserId: "user-456",
22
+ * organizationId: "a5b89e4f-1234-5678-9abc-def012345678",
23
+ * eoaUserId: "3c7d6e8a-4b5c-6d7e-8f9a-0b1c2d3e4f5a",
24
24
  * restrictions: {
25
25
  * allowedContracts: ["0x833...USDC", "0x6B1...DAI"],
26
26
  * disallowEthTransfer: true,
@@ -30,24 +30,24 @@ import { gasStationAbi } from './abi/gas-station.mjs';
30
30
  *
31
31
  * // Resulting policy:
32
32
  * {
33
- * organizationId: "org-123",
33
+ * organizationId: "a5b89e4f-1234-5678-9abc-def012345678",
34
34
  * policyName: "Stablecoin Only",
35
35
  * effect: "EFFECT_ALLOW",
36
- * consensus: "approvers.any(user, user.id == 'user-456')",
36
+ * consensus: "approvers.any(user, user.id == '3c7d6e8a-4b5c-6d7e-8f9a-0b1c2d3e4f5a')",
37
37
  * condition: "activity.resource == 'PRIVATE_KEY' && activity.action == 'SIGN' && " +
38
38
  * "eth.eip_712.primary_type == 'Execution' && " +
39
- * "(eth.eip_712.message['outputContract'] == '0x833...usdc' || " +
40
- * "eth.eip_712.message['outputContract'] == '0x6b1...dai') && " +
41
- * "eth.eip_712.message['ethAmount'] == '0'",
39
+ * "(eth.eip_712.message['to'] == '0x833...usdc' || " +
40
+ * "eth.eip_712.message['to'] == '0x6b1...dai') && " +
41
+ * "eth.eip_712.message['value'] == '0'",
42
42
  * notes: "Restricts which EIP-712 intents the EOA can sign for gas station execution"
43
43
  * }
44
44
  *
45
45
  * @example
46
46
  * // Multi-approval: EOA AND backup user must both approve
47
47
  * const policy = buildIntentSigningPolicy({
48
- * organizationId: "org-123",
49
- * eoaUserId: "user-456",
50
- * additionalApprovers: ["backup-user-789"],
48
+ * organizationId: "a5b89e4f-1234-5678-9abc-def012345678",
49
+ * eoaUserId: "3c7d6e8a-4b5c-6d7e-8f9a-0b1c2d3e4f5a",
50
+ * additionalApprovers: ["9d4e2f5b-6c7d-8e9f-0a1b-2c3d4e5f6a7b"],
51
51
  * restrictions: {
52
52
  * allowedContracts: ["0x833...USDC"],
53
53
  * disallowEthTransfer: true,
@@ -56,23 +56,23 @@ import { gasStationAbi } from './abi/gas-station.mjs';
56
56
  *
57
57
  * // Resulting policy:
58
58
  * {
59
- * organizationId: "org-123",
59
+ * organizationId: "a5b89e4f-1234-5678-9abc-def012345678",
60
60
  * policyName: "Gas Station Intent Signing Policy",
61
61
  * effect: "EFFECT_ALLOW",
62
- * consensus: "approvers.any(user, user.id == 'user-456') && " +
63
- * "approvers.any(user, user.id == 'backup-user-789')",
62
+ * consensus: "approvers.any(user, user.id == '3c7d6e8a-4b5c-6d7e-8f9a-0b1c2d3e4f5a') && " +
63
+ * "approvers.any(user, user.id == '9d4e2f5b-6c7d-8e9f-0a1b-2c3d4e5f6a7b')",
64
64
  * condition: "activity.resource == 'PRIVATE_KEY' && activity.action == 'SIGN' && " +
65
65
  * "eth.eip_712.primary_type == 'Execution' && " +
66
- * "(eth.eip_712.message['outputContract'] == '0x833...usdc') && " +
67
- * "eth.eip_712.message['ethAmount'] == '0'",
66
+ * "(eth.eip_712.message['to'] == '0x833...usdc') && " +
67
+ * "eth.eip_712.message['value'] == '0'",
68
68
  * notes: "Restricts which EIP-712 intents the EOA can sign for gas station execution"
69
69
  * }
70
70
  *
71
71
  * @example
72
72
  * // Advanced: custom consensus expression
73
73
  * const policy = buildIntentSigningPolicy({
74
- * organizationId: "org-123",
75
- * eoaUserId: "user-456",
74
+ * organizationId: "a5b89e4f-1234-5678-9abc-def012345678",
75
+ * eoaUserId: "3c7d6e8a-4b5c-6d7e-8f9a-0b1c2d3e4f5a",
76
76
  * customConsensus: "approvers.count() >= 2",
77
77
  * restrictions: {
78
78
  * disallowEthTransfer: false,
@@ -92,12 +92,12 @@ function buildIntentSigningPolicy(config) {
92
92
  // Build OR conditions for each allowed contract
93
93
  // Convert to lowercase for case-insensitive comparison
94
94
  const contractConditions = config.restrictions.allowedContracts
95
- .map((c) => `eth.eip_712.message['outputContract'] == '${c.toLowerCase()}'`)
95
+ .map((c) => `eth.eip_712.message['to'] == '${c.toLowerCase()}'`)
96
96
  .join(" || ");
97
97
  conditions.push(`(${contractConditions})`);
98
98
  }
99
99
  if (!!config.restrictions?.disallowEthTransfer) {
100
- conditions.push(`eth.eip_712.message['ethAmount'] == '0'`);
100
+ conditions.push(`eth.eip_712.message['value'] == '0'`);
101
101
  }
102
102
  // Build consensus expression
103
103
  let consensus;
@@ -154,9 +154,9 @@ function buildIntentSigningPolicy(config) {
154
154
  * @example
155
155
  * // Simple: single paymaster approval with ETH amount limit
156
156
  * const policy = buildPaymasterExecutionPolicy({
157
- * organizationId: "org-paymaster",
158
- * paymasterUserId: "paymaster-user-123",
159
- * executionContractAddress: "0x576A4D741b96996cc93B4919a04c16545734481f",
157
+ * organizationId: "f8c3a5e7-9876-5432-1abc-def098765432",
158
+ * paymasterUserId: "8f2a1b4c-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
159
+ * executionContractAddress: "0x00000000008c57a1CE37836a5e9d36759D070d8c",
160
160
  * restrictions: {
161
161
  * allowedEOAs: ["0xAli...ce", "0xBob...by"],
162
162
  * allowedContracts: ["0x833...USDC", "0x6B1...DAI"],
@@ -169,17 +169,17 @@ function buildIntentSigningPolicy(config) {
169
169
  *
170
170
  * // Resulting policy (uses ABI parsing):
171
171
  * {
172
- * organizationId: "org-paymaster",
172
+ * organizationId: "f8c3a5e7-9876-5432-1abc-def098765432",
173
173
  * policyName: "Paymaster Protection",
174
174
  * effect: "EFFECT_ALLOW",
175
- * consensus: "approvers.any(user, user.id == 'paymaster-user-123')",
175
+ * consensus: "approvers.any(user, user.id == '8f2a1b4c-5d6e-7f8a-9b0c-1d2e3f4a5b6c')",
176
176
  * condition: "activity.resource == 'PRIVATE_KEY' && activity.action == 'SIGN' && " +
177
- * "eth.tx.to == '0x576a...481f' && " +
177
+ * "eth.tx.to == '0x00000000008c57a1ce37836a5e9d36759d070d8c' && " +
178
178
  * "(eth.tx.contract_call_args['_to'] == '0x833...usdc' || " +
179
179
  * "eth.tx.contract_call_args['_to'] == '0x6b1...dai') && " +
180
- * "(eth.tx.contract_call_args['_targetEoA'] == '0xali...ce' || " +
181
- * "eth.tx.contract_call_args['_targetEoA'] == '0xbob...by') && " +
182
- * "eth.tx.contract_call_args['ethAmount'] <= 100000000000000000 && " +
180
+ * "(eth.tx.contract_call_args['_target'] == '0xali...ce' || " +
181
+ * "eth.tx.contract_call_args['_target'] == '0xbob...by') && " +
182
+ * "eth.tx.contract_call_args['_ethAmount'] <= 100000000000000000 && " +
183
183
  * "eth.tx.gasPrice <= 50000000000 && eth.tx.gas <= 500000",
184
184
  * notes: "Restricts which execute() transactions the paymaster can submit on-chain"
185
185
  * }
@@ -187,10 +187,10 @@ function buildIntentSigningPolicy(config) {
187
187
  * @example
188
188
  * // Multi-user: primary paymaster OR backup can approve
189
189
  * const policy = buildPaymasterExecutionPolicy({
190
- * organizationId: "org-paymaster",
191
- * paymasterUserId: "paymaster-user-123",
192
- * additionalApprovers: ["backup-paymaster-456"],
193
- * executionContractAddress: "0x576A4D741b96996cc93B4919a04c16545734481f",
190
+ * organizationId: "f8c3a5e7-9876-5432-1abc-def098765432",
191
+ * paymasterUserId: "8f2a1b4c-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
192
+ * additionalApprovers: ["2e4f6a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b"],
193
+ * executionContractAddress: "0x00000000008c57a1CE37836a5e9d36759D070d8c",
194
194
  * restrictions: {
195
195
  * allowedEOAs: ["0xAli...ce"],
196
196
  * maxEthAmount: parseEther("1"), // Max 1 ETH
@@ -200,15 +200,15 @@ function buildIntentSigningPolicy(config) {
200
200
  *
201
201
  * // Resulting policy (uses ABI parsing):
202
202
  * {
203
- * organizationId: "org-paymaster",
203
+ * organizationId: "f8c3a5e7-9876-5432-1abc-def098765432",
204
204
  * policyName: "Gas Station Paymaster Execution Policy",
205
205
  * effect: "EFFECT_ALLOW",
206
- * consensus: "approvers.any(user, user.id == 'paymaster-user-123' || " +
207
- * "user.id == 'backup-paymaster-456')",
206
+ * consensus: "approvers.any(user, user.id == '8f2a1b4c-5d6e-7f8a-9b0c-1d2e3f4a5b6c' || " +
207
+ * "user.id == '2e4f6a8b-9c0d-1e2f-3a4b-5c6d7e8f9a0b')",
208
208
  * condition: "activity.resource == 'PRIVATE_KEY' && activity.action == 'SIGN' && " +
209
- * "eth.tx.to == '0x576a...481f' && " +
210
- * "(eth.tx.contract_call_args['_targetEoA'] == '0xali...ce') && " +
211
- * "eth.tx.contract_call_args['ethAmount'] <= 1000000000000000000 && " +
209
+ * "eth.tx.to == '0x00000000008c57a1ce37836a5e9d36759d070d8c' && " +
210
+ * "(eth.tx.contract_call_args['_target'] == '0xali...ce') && " +
211
+ * "eth.tx.contract_call_args['_ethAmount'] <= 1000000000000000000 && " +
212
212
  * "eth.tx.gasPrice <= 100000000000",
213
213
  * notes: "Restricts which execute() transactions the paymaster can submit on-chain"
214
214
  * }
@@ -216,10 +216,10 @@ function buildIntentSigningPolicy(config) {
216
216
  * @example
217
217
  * // Advanced: require multiple approvals
218
218
  * const policy = buildPaymasterExecutionPolicy({
219
- * organizationId: "org-paymaster",
220
- * paymasterUserId: "paymaster-user-123",
219
+ * organizationId: "f8c3a5e7-9876-5432-1abc-def098765432",
220
+ * paymasterUserId: "8f2a1b4c-5d6e-7f8a-9b0c-1d2e3f4a5b6c",
221
221
  * customConsensus: "approvers.count() >= 2",
222
- * executionContractAddress: "0x576A4D741b96996cc93B4919a04c16545734481f",
222
+ * executionContractAddress: "0x00000000008c57a1CE37836a5e9d36759D070d8c",
223
223
  * restrictions: { ... },
224
224
  * });
225
225
  *
@@ -232,7 +232,7 @@ function buildPaymasterExecutionPolicy(config) {
232
232
  `eth.tx.to == '${config.executionContractAddress.toLowerCase()}'`,
233
233
  ];
234
234
  // Check output contract address using ABI parsing
235
- // Turnkey parses execute(address _targetEoA, address _to, uint256 ethAmount, bytes _data)
235
+ // Turnkey parses execute(address _target, address _to, uint256 _ethAmount, bytes _data)
236
236
  // and exposes arguments via eth.tx.contract_call_args
237
237
  if (config.restrictions?.allowedContracts &&
238
238
  config.restrictions.allowedContracts.length > 0) {
@@ -349,13 +349,12 @@ async function uploadGasStationInterface({ client, organizationId, contractAddre
349
349
  * @returns The smart contract interface ID
350
350
  *
351
351
  * @example
352
- * const interfaceId = await ensureGasStationInterface(
353
- * turnkeyClient.apiClient(),
354
- * "org-123",
355
- * "0x576A4D741b96996cc93B4919a04c16545734481f",
356
- * undefined,
357
- * "Base Sepolia"
358
- * );
352
+ * const interfaceId = await ensureGasStationInterface({
353
+ * client: turnkeyClient.apiClient(),
354
+ * organizationId: "a5b89e4f-1234-5678-9abc-def012345678",
355
+ * contractAddress: "0x00000000008c57a1CE37836a5e9d36759D070d8c",
356
+ * chainName: "Base Sepolia"
357
+ * });
359
358
  */
360
359
  async function ensureGasStationInterface({ client, organizationId, contractAddress, label, chainName, }) {
361
360
  // Check if interface already exists
@@ -1 +1 @@
1
- {"version":3,"file":"policyUtils.mjs","sources":["../src/policyUtils.ts"],"sourcesContent":[null],"names":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AACrB,UAAE,wBAAwB;IAE9B,IAAI,CAAC,WAAW,EAAE;AAChB,QAAA,MAAM,IAAI,KAAK,CACb,qEAAqE,CACtE;IACH;AAEA,IAAA,OAAO,WAAW;AACpB;AAEA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACI,eAAe,yBAAyB,CAAC,EAC9C,MAAM,EACN,cAAc,EACd,eAAe,EACf,KAAK,EACL,SAAS,GAOV,EAAA;;AAEC,IAAA,MAAM,UAAU,GAAG,MAAM,yBAAyB,CAAC;QACjD,MAAM;QACN,cAAc;QACd,eAAe;AAChB,KAAA,CAAC;IAEF,IAAI,UAAU,EAAE;AACd,QAAA,OAAO,UAAU;IACnB;;AAGA,IAAA,OAAO,yBAAyB,CAAC;QAC/B,MAAM;QACN,cAAc;QACd,eAAe;QACf,KAAK,EAAE,KAAK,IAAI,EAAE;QAClB,SAAS,EAAE,SAAS,IAAI,EAAE;AAC3B,KAAA,CAAC;AACJ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turnkey/gas-station",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
4
4
  "description": "Turnkey Gas Station SDK for EIP-7702 delegated execution",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",