@opendatalabs/vana-sdk 0.1.0-alpha.f2a82f7 → 0.1.0-alpha.f35bb9c

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 (51) hide show
  1. package/dist/controllers/base.cjs +0 -33
  2. package/dist/controllers/base.cjs.map +1 -1
  3. package/dist/controllers/base.d.ts +0 -10
  4. package/dist/controllers/base.js +0 -33
  5. package/dist/controllers/base.js.map +1 -1
  6. package/dist/controllers/data.cjs +19 -26
  7. package/dist/controllers/data.cjs.map +1 -1
  8. package/dist/controllers/data.d.ts +9 -9
  9. package/dist/controllers/data.js +19 -26
  10. package/dist/controllers/data.js.map +1 -1
  11. package/dist/controllers/permissions.cjs +65 -124
  12. package/dist/controllers/permissions.cjs.map +1 -1
  13. package/dist/controllers/permissions.d.ts +11 -20
  14. package/dist/controllers/permissions.js +65 -124
  15. package/dist/controllers/permissions.js.map +1 -1
  16. package/dist/core.cjs +1 -4
  17. package/dist/core.cjs.map +1 -1
  18. package/dist/core.d.ts +1 -2
  19. package/dist/core.js +1 -4
  20. package/dist/core.js.map +1 -1
  21. package/dist/index.node.cjs +0 -2
  22. package/dist/index.node.cjs.map +1 -1
  23. package/dist/index.node.d.ts +4 -27
  24. package/dist/index.node.js +0 -2
  25. package/dist/index.node.js.map +1 -1
  26. package/dist/server/relayerHandler.cjs +87 -201
  27. package/dist/server/relayerHandler.cjs.map +1 -1
  28. package/dist/server/relayerHandler.d.ts +1 -3
  29. package/dist/server/relayerHandler.js +87 -201
  30. package/dist/server/relayerHandler.js.map +1 -1
  31. package/dist/types/config.cjs.map +1 -1
  32. package/dist/types/config.d.ts +0 -32
  33. package/dist/types/config.js.map +1 -1
  34. package/dist/types/controller-context.cjs.map +1 -1
  35. package/dist/types/controller-context.d.ts +1 -3
  36. package/dist/types/generics.cjs.map +1 -1
  37. package/dist/types/generics.d.ts +1 -1
  38. package/dist/types/index.cjs.map +1 -1
  39. package/dist/types/index.d.ts +2 -3
  40. package/dist/types/index.js.map +1 -1
  41. package/dist/types/operations.cjs.map +1 -1
  42. package/dist/types/operations.d.ts +0 -46
  43. package/dist/types/operations.js.map +1 -1
  44. package/dist/types/relayer.cjs.map +1 -1
  45. package/dist/types/relayer.d.ts +8 -19
  46. package/dist/utils/ipfs.cjs +4 -2
  47. package/dist/utils/ipfs.cjs.map +1 -1
  48. package/dist/utils/ipfs.d.ts +1 -1
  49. package/dist/utils/ipfs.js +4 -2
  50. package/dist/utils/ipfs.js.map +1 -1
  51. package/package.json +1 -3
@@ -1,7 +1,7 @@
1
1
  import type { Address, Hash } from "viem";
2
- import type { TransactionOptions, TransactionResult } from "../types/operations";
3
- import type { GrantPermissionParams, RevokePermissionParams, PermissionGrantTypedData, GenericTypedData, OnChainPermissionGrant, GetUserPermissionsOptions, AddAndTrustServerParams, TrustServerParams, UntrustServerParams, AddAndTrustServerTypedData, TrustServerTypedData, TrustedServerInfo, PaginatedTrustedServers, TrustedServerQueryOptions, BatchServerInfoResult, ServerTrustStatus, GrantFile, Grantee, GranteeInfo, RegisterGranteeParams, GranteeQueryOptions, PaginatedGrantees, ServerInfo, ServerFilesAndPermissionParams, ServerFilesAndPermissionTypedData } from "../types/index";
2
+ import type { GrantPermissionParams, RevokePermissionParams, PermissionGrantTypedData, GenericTypedData, OnChainPermissionGrant, GetUserPermissionsOptions, AddAndTrustServerParams, TrustServerParams, UntrustServerParams, AddAndTrustServerTypedData, TrustServerTypedData, TrustedServerInfo, PaginatedTrustedServers, TrustedServerQueryOptions, BatchServerInfoResult, ServerTrustStatus, GrantFile, Grantee, GranteeInfo, RegisterGranteeParams, GranteeQueryOptions, PaginatedGrantees, ServerInfo, ServerFilesAndPermissionParams, ServerFilesAndPermissionTypedData, TransactionOptions } from "../types/index";
4
3
  import type { PermissionGrantResult, PermissionRevokeResult, ServerTrustResult } from "../types/transactionResults";
4
+ import type { TransactionResult } from "../types/operations";
5
5
  import type { PermissionInfo } from "../types/permissions";
6
6
  /**
7
7
  * Provides shared configuration and services for all SDK controllers.
@@ -101,7 +101,7 @@ export declare class PermissionsController extends BaseController {
101
101
  * await vana.permissions.revoke({ permissionId: result.permissionId });
102
102
  * ```
103
103
  */
104
- grant(params: GrantPermissionParams, options?: TransactionOptions): Promise<PermissionGrantResult>;
104
+ grant(params: GrantPermissionParams): Promise<PermissionGrantResult>;
105
105
  /**
106
106
  * Submits a permission grant transaction and returns a handle for flexible result access.
107
107
  *
@@ -127,7 +127,7 @@ export declare class PermissionsController extends BaseController {
127
127
  * console.log(`Permission ID: ${eventData.permissionId}`);
128
128
  * ```
129
129
  */
130
- submitPermissionGrant(params: GrantPermissionParams, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
130
+ submitPermissionGrant(params: GrantPermissionParams): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
131
131
  /**
132
132
  * Prepares a permission grant with preview before signing.
133
133
  *
@@ -153,7 +153,7 @@ export declare class PermissionsController extends BaseController {
153
153
  * const transactionHash = await confirm();
154
154
  * ```
155
155
  */
156
- prepareGrant(params: GrantPermissionParams, options?: TransactionOptions): Promise<{
156
+ prepareGrant(params: GrantPermissionParams): Promise<{
157
157
  preview: GrantFile;
158
158
  confirm: () => Promise<PermissionGrantResult>;
159
159
  }>;
@@ -225,7 +225,7 @@ export declare class PermissionsController extends BaseController {
225
225
  * );
226
226
  * ```
227
227
  */
228
- submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
228
+ submitSignedGrant(typedData: PermissionGrantTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
229
229
  /**
230
230
  * Submits an already-signed trust server transaction to the blockchain.
231
231
  *
@@ -247,7 +247,7 @@ export declare class PermissionsController extends BaseController {
247
247
  * const result = await txHandle.waitForEvents();
248
248
  * ```
249
249
  */
250
- submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
250
+ submitSignedTrustServer(typedData: TrustServerTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "trustServerWithSignature">>;
251
251
  /**
252
252
  * Submits an already-signed add and trust server transaction to the blockchain.
253
253
  *
@@ -269,7 +269,7 @@ export declare class PermissionsController extends BaseController {
269
269
  * const result = await txHandle.waitForEvents();
270
270
  * ```
271
271
  */
272
- submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash, _options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
272
+ submitSignedAddAndTrustServer(typedData: AddAndTrustServerTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "addAndTrustServerWithSignature">>;
273
273
  /**
274
274
  * Internal method to submit a signed grant and wait for events.
275
275
  *
@@ -288,15 +288,6 @@ export declare class PermissionsController extends BaseController {
288
288
  * @returns Promise resolving to PermissionGrantResult with parsed events
289
289
  */
290
290
  private confirmGrantInternalWithEvents;
291
- /**
292
- * Polls the relayer for confirmation of a pending operation.
293
- *
294
- * @param operationId - The operation ID to poll
295
- * @returns Promise resolving to the confirmed hash
296
- * @throws {Error} When the operation fails or times out
297
- * @internal
298
- */
299
- private pollRelayerForConfirmation;
300
291
  /**
301
292
  * Submits an already-signed permission revoke transaction to the blockchain.
302
293
  *
@@ -318,7 +309,7 @@ export declare class PermissionsController extends BaseController {
318
309
  * const result = await txHandle.waitForEvents();
319
310
  * ```
320
311
  */
321
- submitSignedRevoke(typedData: GenericTypedData, signature: Hash, _options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
312
+ submitSignedRevoke(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "revokePermissionWithSignature">>;
322
313
  /**
323
314
  * Submits an already-signed untrust server transaction to the blockchain.
324
315
  *
@@ -340,7 +331,7 @@ export declare class PermissionsController extends BaseController {
340
331
  * const result = await txHandle.waitForEvents();
341
332
  * ```
342
333
  */
343
- submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash, _options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityServers", "untrustServerWithSignature">>;
334
+ submitSignedUntrustServer(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityServers", "untrustServerWithSignature">>;
344
335
  /**
345
336
  * Submits a signed transaction directly to the blockchain.
346
337
  *
@@ -1192,7 +1183,7 @@ export declare class PermissionsController extends BaseController {
1192
1183
  * @throws {BlockchainError} When permission addition fails
1193
1184
  * @throws {NetworkError} When network communication fails
1194
1185
  */
1195
- submitSignedAddPermission(typedData: GenericTypedData, signature: Hash, options?: TransactionOptions): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
1186
+ submitSignedAddPermission(typedData: GenericTypedData, signature: Hash): Promise<TransactionResult<"DataPortabilityPermissions", "addPermission">>;
1196
1187
  /**
1197
1188
  * Submits server files and permissions with signature to the blockchain, supporting schema validation and gasless transactions.
1198
1189
  *
@@ -57,14 +57,10 @@ class PermissionsController extends BaseController {
57
57
  * await vana.permissions.revoke({ permissionId: result.permissionId });
58
58
  * ```
59
59
  */
60
- async grant(params, options) {
60
+ async grant(params) {
61
61
  this.assertWallet();
62
62
  const { typedData, signature } = await this.createAndSign(params);
63
- const result = await this.submitSignedGrantWithEvents(
64
- typedData,
65
- signature,
66
- options
67
- );
63
+ const result = await this.submitSignedGrantWithEvents(typedData, signature);
68
64
  return result;
69
65
  }
70
66
  /**
@@ -92,10 +88,10 @@ class PermissionsController extends BaseController {
92
88
  * console.log(`Permission ID: ${eventData.permissionId}`);
93
89
  * ```
94
90
  */
95
- async submitPermissionGrant(params, options) {
91
+ async submitPermissionGrant(params) {
96
92
  this.assertWallet();
97
93
  const { typedData, signature } = await this.createAndSign(params);
98
- return await this.submitSignedGrant(typedData, signature, options);
94
+ return await this.submitSignedGrant(typedData, signature);
99
95
  }
100
96
  /**
101
97
  * Prepares a permission grant with preview before signing.
@@ -122,7 +118,7 @@ class PermissionsController extends BaseController {
122
118
  * const transactionHash = await confirm();
123
119
  * ```
124
120
  */
125
- async prepareGrant(params, options) {
121
+ async prepareGrant(params) {
126
122
  this.assertWallet();
127
123
  try {
128
124
  const grantFile = createGrantFile(params);
@@ -130,11 +126,7 @@ class PermissionsController extends BaseController {
130
126
  return {
131
127
  preview: grantFile,
132
128
  confirm: async () => {
133
- return await this.confirmGrantInternalWithEvents(
134
- params,
135
- grantFile,
136
- options
137
- );
129
+ return await this.confirmGrantInternalWithEvents(params, grantFile);
138
130
  }
139
131
  };
140
132
  } catch (error) {
@@ -166,7 +158,7 @@ class PermissionsController extends BaseController {
166
158
  * @throws {NetworkError} When IPFS upload fails
167
159
  * @throws {SignatureError} When user rejects the signature
168
160
  */
169
- async confirmGrantInternal(params, grantFile, options) {
161
+ async confirmGrantInternal(params, grantFile) {
170
162
  try {
171
163
  let { grantUrl } = params;
172
164
  console.debug("\u{1F50D} Debug - Grant URL from params:", grantUrl);
@@ -191,7 +183,7 @@ class PermissionsController extends BaseController {
191
183
  if (response.type === "error") {
192
184
  throw new Error(response.error);
193
185
  }
194
- if (response.type === "direct" && typeof response.result === "object" && response.result !== null && "url" in response.result) {
186
+ if (response.type === "direct" && typeof response.result === "object" && "url" in response.result) {
195
187
  grantUrl = response.result.url;
196
188
  } else {
197
189
  throw new Error("Invalid response from relayer for grant storage");
@@ -227,7 +219,7 @@ class PermissionsController extends BaseController {
227
219
  nonce
228
220
  });
229
221
  const signature = await this.signTypedData(typedData);
230
- return await this.submitSignedGrant(typedData, signature, options);
222
+ return await this.submitSignedGrant(typedData, signature);
231
223
  } catch (error) {
232
224
  if (error instanceof Error) {
233
225
  if (error instanceof RelayerError || error instanceof UserRejectedRequestError || error instanceof SerializationError || error instanceof SignatureError || error instanceof NetworkError || error instanceof NonceError) {
@@ -299,7 +291,7 @@ class PermissionsController extends BaseController {
299
291
  if (response.type === "error") {
300
292
  throw new Error(response.error);
301
293
  }
302
- if (response.type === "direct" && typeof response.result === "object" && response.result !== null && "url" in response.result) {
294
+ if (response.type === "direct" && typeof response.result === "object" && "url" in response.result) {
303
295
  grantUrl = response.result.url;
304
296
  } else {
305
297
  throw new Error("Invalid response from relayer for grant storage");
@@ -372,7 +364,7 @@ class PermissionsController extends BaseController {
372
364
  * );
373
365
  * ```
374
366
  */
375
- async submitSignedGrant(typedData, signature, options) {
367
+ async submitSignedGrant(typedData, signature) {
376
368
  try {
377
369
  console.debug(
378
370
  "\u{1F50D} Debug - submitSignedGrant called with typed data:",
@@ -390,40 +382,26 @@ class PermissionsController extends BaseController {
390
382
  signature,
391
383
  expectedUserAddress: this.context.userAddress
392
384
  });
393
- if (response.type === "error") {
385
+ let hash;
386
+ if (response.type === "signed") {
387
+ hash = response.hash;
388
+ } else if (response.type === "error") {
394
389
  throw new Error(`Relayer error: ${response.error}`);
395
- }
396
- let finalHash;
397
- if (response.type === "submitted") {
398
- finalHash = response.hash;
399
- } else if (response.type === "pending") {
400
- const pollResult = await this.pollRelayerForConfirmation(
401
- response.operationId
402
- );
403
- finalHash = pollResult.hash;
404
- } else if (response.type === "confirmed") {
405
- finalHash = response.hash;
406
- } else if (response.type === "signed") {
407
- finalHash = response.hash;
408
390
  } else {
409
391
  throw new Error(
410
- "Invalid response from relayer: unexpected response type"
392
+ "Invalid response from relayer: expected signed transaction"
411
393
  );
412
394
  }
413
395
  const account = this.context.walletClient?.account ?? this.context.userAddress;
414
396
  const { tx } = await import("../utils/transactionHelpers");
415
397
  return tx({
416
- hash: finalHash,
398
+ hash,
417
399
  from: typeof account === "string" ? account : account.address,
418
400
  contract: "DataPortabilityPermissions",
419
401
  fn: "addPermission"
420
402
  });
421
403
  } else {
422
- return await this.submitDirectTransaction(
423
- typedData,
424
- signature,
425
- options
426
- );
404
+ return await this.submitDirectTransaction(typedData, signature);
427
405
  }
428
406
  } catch (error) {
429
407
  if (error instanceof RelayerError || error instanceof NetworkError || error instanceof UserRejectedRequestError || error instanceof SignatureError || error instanceof NonceError) {
@@ -456,7 +434,7 @@ class PermissionsController extends BaseController {
456
434
  * const result = await txHandle.waitForEvents();
457
435
  * ```
458
436
  */
459
- async submitSignedTrustServer(typedData, signature, options) {
437
+ async submitSignedTrustServer(typedData, signature) {
460
438
  try {
461
439
  const trustServerInput = {
462
440
  nonce: BigInt(typedData.message.nonce),
@@ -464,8 +442,7 @@ class PermissionsController extends BaseController {
464
442
  };
465
443
  const hash = await this.submitTrustServerTransaction(
466
444
  trustServerInput,
467
- signature,
468
- options
445
+ signature
469
446
  );
470
447
  const account = this.context.userAddress;
471
448
  const { tx } = await import("../utils/transactionHelpers");
@@ -520,7 +497,7 @@ class PermissionsController extends BaseController {
520
497
  * const result = await txHandle.waitForEvents();
521
498
  * ```
522
499
  */
523
- async submitSignedAddAndTrustServer(typedData, signature, _options) {
500
+ async submitSignedAddAndTrustServer(typedData, signature) {
524
501
  try {
525
502
  const addAndTrustServerInput = {
526
503
  nonce: BigInt(typedData.message.nonce),
@@ -558,12 +535,8 @@ class PermissionsController extends BaseController {
558
535
  * @param signature - The user's signature authorizing the transaction
559
536
  * @returns Promise resolving to PermissionGrantResult with parsed events
560
537
  */
561
- async submitSignedGrantWithEvents(typedData, signature, options) {
562
- const txResult = await this.submitSignedGrant(
563
- typedData,
564
- signature,
565
- options
566
- );
538
+ async submitSignedGrantWithEvents(typedData, signature) {
539
+ const txResult = await this.submitSignedGrant(typedData, signature);
567
540
  if (!this.context.waitForTransactionEvents) {
568
541
  throw new BlockchainError("waitForTransactionEvents not configured");
569
542
  }
@@ -595,12 +568,8 @@ class PermissionsController extends BaseController {
595
568
  * @param grantFile - The pre-created grant file object
596
569
  * @returns Promise resolving to PermissionGrantResult with parsed events
597
570
  */
598
- async confirmGrantInternalWithEvents(params, grantFile, options) {
599
- const txResult = await this.confirmGrantInternal(
600
- params,
601
- grantFile,
602
- options
603
- );
571
+ async confirmGrantInternalWithEvents(params, grantFile) {
572
+ const txResult = await this.confirmGrantInternal(params, grantFile);
604
573
  if (!this.context.waitForTransactionEvents) {
605
574
  throw new BlockchainError("waitForTransactionEvents not configured");
606
575
  }
@@ -624,39 +593,6 @@ class PermissionsController extends BaseController {
624
593
  fileIds: event.fileIds
625
594
  };
626
595
  }
627
- /**
628
- * Polls the relayer for confirmation of a pending operation.
629
- *
630
- * @param operationId - The operation ID to poll
631
- * @returns Promise resolving to the confirmed hash
632
- * @throws {Error} When the operation fails or times out
633
- * @internal
634
- */
635
- async pollRelayerForConfirmation(operationId, options = {}) {
636
- const timeout = options.timeout ?? 3e4;
637
- let interval = options.pollingInterval ?? 1e3;
638
- const startTime = Date.now();
639
- while (Date.now() - startTime < timeout) {
640
- if (!this.context.relayer) {
641
- throw new Error("Relayer not configured for polling");
642
- }
643
- const statusResponse = await this.context.relayer({
644
- type: "status_check",
645
- operationId
646
- });
647
- if (statusResponse.type === "confirmed") {
648
- return { hash: statusResponse.hash };
649
- }
650
- if (statusResponse.type === "error") {
651
- throw new Error(
652
- `Operation ${operationId} failed: ${statusResponse.error}`
653
- );
654
- }
655
- await new Promise((resolve) => setTimeout(resolve, interval));
656
- interval = Math.min(interval * 1.5, 5e3);
657
- }
658
- throw new Error(`Operation ${operationId} timed out after ${timeout}ms`);
659
- }
660
596
  /**
661
597
  * Submits an already-signed permission revoke transaction to the blockchain.
662
598
  *
@@ -678,7 +614,7 @@ class PermissionsController extends BaseController {
678
614
  * const result = await txHandle.waitForEvents();
679
615
  * ```
680
616
  */
681
- async submitSignedRevoke(typedData, signature, _options) {
617
+ async submitSignedRevoke(typedData, signature) {
682
618
  try {
683
619
  let hash;
684
620
  if (this.context.relayer) {
@@ -689,23 +625,13 @@ class PermissionsController extends BaseController {
689
625
  signature,
690
626
  expectedUserAddress: this.context.userAddress
691
627
  });
692
- if (response.type === "error") {
693
- throw new Error(`Relayer error: ${response.error}`);
694
- }
695
- if (response.type === "submitted") {
696
- hash = response.hash;
697
- } else if (response.type === "pending") {
698
- const pollResult = await this.pollRelayerForConfirmation(
699
- response.operationId
700
- );
701
- hash = pollResult.hash;
702
- } else if (response.type === "confirmed") {
703
- hash = response.hash;
704
- } else if (response.type === "signed") {
628
+ if (response.type === "signed") {
705
629
  hash = response.hash;
630
+ } else if (response.type === "error") {
631
+ throw new Error(`Relayer error: ${response.error}`);
706
632
  } else {
707
633
  throw new Error(
708
- "Invalid response from relayer: unexpected response type"
634
+ "Invalid response from relayer: expected signed transaction"
709
635
  );
710
636
  }
711
637
  } else {
@@ -753,7 +679,7 @@ class PermissionsController extends BaseController {
753
679
  * const result = await txHandle.waitForEvents();
754
680
  * ```
755
681
  */
756
- async submitSignedUntrustServer(typedData, signature, _options) {
682
+ async submitSignedUntrustServer(typedData, signature) {
757
683
  try {
758
684
  let hash;
759
685
  if (this.context.relayer) {
@@ -809,7 +735,7 @@ class PermissionsController extends BaseController {
809
735
  * @returns Promise resolving to the transaction hash
810
736
  * @throws {BlockchainError} When contract submission fails
811
737
  */
812
- async submitDirectTransaction(typedData, signature, options) {
738
+ async submitDirectTransaction(typedData, signature) {
813
739
  this.assertWallet();
814
740
  const chainId = await this.context.publicClient.getChainId();
815
741
  const DataPortabilityPermissionsAddress = getContractAddress(
@@ -841,8 +767,7 @@ class PermissionsController extends BaseController {
841
767
  functionName: "addPermission",
842
768
  args: [permissionInput, formattedSignature],
843
769
  account,
844
- chain: this.context.walletClient?.chain ?? null,
845
- ...this.spreadTransactionOptions(options)
770
+ chain: this.context.walletClient?.chain ?? null
846
771
  });
847
772
  const { tx } = await import("../utils/transactionHelpers");
848
773
  return tx({
@@ -941,7 +866,7 @@ class PermissionsController extends BaseController {
941
866
  args: [params.permissionId],
942
867
  account,
943
868
  chain: this.context.walletClient?.chain ?? null,
944
- ...options?.gas && { gas: options.gas },
869
+ ...options?.gasLimit && { gas: options.gasLimit },
945
870
  ...options?.nonce && { nonce: options.nonce },
946
871
  // Use EIP-1559 if available, otherwise fall back to legacy gasPrice
947
872
  ...options?.maxFeePerGas || options?.maxPriorityFeePerGas ? {
@@ -1778,7 +1703,7 @@ class PermissionsController extends BaseController {
1778
1703
  args: [BigInt(params.serverId)],
1779
1704
  account,
1780
1705
  chain: this.context.walletClient?.chain ?? null,
1781
- ...options?.gas && { gas: options.gas },
1706
+ ...options?.gasLimit && { gas: options.gasLimit },
1782
1707
  ...options?.nonce && { nonce: options.nonce },
1783
1708
  // Use EIP-1559 if available, otherwise fall back to legacy gasPrice
1784
1709
  ...options?.maxFeePerGas || options?.maxPriorityFeePerGas ? {
@@ -2373,7 +2298,7 @@ class PermissionsController extends BaseController {
2373
2298
  * @param signature - The cryptographic signature for the transaction
2374
2299
  * @returns Promise resolving to the transaction hash
2375
2300
  */
2376
- async submitTrustServerTransaction(trustServerInput, signature, options) {
2301
+ async submitTrustServerTransaction(trustServerInput, signature) {
2377
2302
  this.assertWallet();
2378
2303
  const chainId = await this.context.walletClient.getChainId();
2379
2304
  const DataPortabilityServersAddress = getContractAddress(
@@ -2394,8 +2319,7 @@ class PermissionsController extends BaseController {
2394
2319
  formattedSignature
2395
2320
  ],
2396
2321
  account: this.context.walletClient?.account ?? this.context.userAddress,
2397
- chain: this.context.walletClient?.chain ?? null,
2398
- ...this.spreadTransactionOptions(options)
2322
+ chain: this.context.walletClient?.chain ?? null
2399
2323
  });
2400
2324
  return txHash;
2401
2325
  }
@@ -2432,7 +2356,7 @@ class PermissionsController extends BaseController {
2432
2356
  * @param signature - The cryptographic signature authorizing the untrust
2433
2357
  * @returns Promise resolving to the transaction hash
2434
2358
  */
2435
- async submitSignedUntrustTransaction(typedData, signature, _options) {
2359
+ async submitSignedUntrustTransaction(typedData, signature) {
2436
2360
  this.assertWallet();
2437
2361
  const chainId = await this.context.walletClient.getChainId();
2438
2362
  const DataPortabilityServersAddress = getContractAddress(
@@ -2502,7 +2426,15 @@ class PermissionsController extends BaseController {
2502
2426
  args: [ownerAddress, granteeAddress, params.publicKey],
2503
2427
  account,
2504
2428
  chain: this.context.walletClient?.chain ?? null,
2505
- ...this.spreadTransactionOptions(options)
2429
+ ...options?.gasLimit && { gas: options.gasLimit },
2430
+ ...options?.nonce && { nonce: options.nonce },
2431
+ // Use EIP-1559 if available, otherwise fall back to legacy gasPrice
2432
+ ...options?.maxFeePerGas || options?.maxPriorityFeePerGas ? {
2433
+ ...options.maxFeePerGas && { maxFeePerGas: options.maxFeePerGas },
2434
+ ...options.maxPriorityFeePerGas && {
2435
+ maxPriorityFeePerGas: options.maxPriorityFeePerGas
2436
+ }
2437
+ } : options?.gasPrice && { gasPrice: options.gasPrice }
2506
2438
  });
2507
2439
  const { tx } = await import("../utils/transactionHelpers");
2508
2440
  return tx({
@@ -3440,7 +3372,7 @@ class PermissionsController extends BaseController {
3440
3372
  args: [serverId, url],
3441
3373
  chain: this.context.walletClient?.chain,
3442
3374
  account,
3443
- ...options?.gas && { gas: options.gas },
3375
+ ...options?.gasLimit && { gas: options.gasLimit },
3444
3376
  ...options?.nonce && { nonce: options.nonce },
3445
3377
  // Use EIP-1559 if available, otherwise fall back to legacy gasPrice
3446
3378
  ...options?.maxFeePerGas || options?.maxPriorityFeePerGas ? {
@@ -3646,7 +3578,7 @@ class PermissionsController extends BaseController {
3646
3578
  * @throws {BlockchainError} When permission addition fails
3647
3579
  * @throws {NetworkError} When network communication fails
3648
3580
  */
3649
- async submitSignedAddPermission(typedData, signature, options) {
3581
+ async submitSignedAddPermission(typedData, signature) {
3650
3582
  this.assertWallet();
3651
3583
  try {
3652
3584
  let hash;
@@ -3669,8 +3601,7 @@ class PermissionsController extends BaseController {
3669
3601
  } else {
3670
3602
  hash = await this.submitDirectAddPermissionTransaction(
3671
3603
  typedData,
3672
- signature,
3673
- options
3604
+ signature
3674
3605
  );
3675
3606
  }
3676
3607
  const account = this.context.walletClient?.account ?? this.context.userAddress;
@@ -3901,7 +3832,7 @@ class PermissionsController extends BaseController {
3901
3832
  args: [permissionId],
3902
3833
  chain: this.context.walletClient?.chain,
3903
3834
  account,
3904
- ...options?.gas && { gas: options.gas },
3835
+ ...options?.gasLimit && { gas: options.gasLimit },
3905
3836
  ...options?.nonce && { nonce: options.nonce },
3906
3837
  // Use EIP-1559 if available, otherwise fall back to legacy gasPrice
3907
3838
  ...options?.maxFeePerGas || options?.maxPriorityFeePerGas ? {
@@ -3934,7 +3865,7 @@ class PermissionsController extends BaseController {
3934
3865
  * @param signature - The cryptographic signature authorizing the transaction
3935
3866
  * @returns Promise resolving to the transaction hash
3936
3867
  */
3937
- async submitDirectAddPermissionTransaction(typedData, signature, options) {
3868
+ async submitDirectAddPermissionTransaction(typedData, signature) {
3938
3869
  this.assertWallet();
3939
3870
  const chainId = await this.context.walletClient.getChainId();
3940
3871
  const DataPortabilityPermissionsAddress = getContractAddress(
@@ -3955,8 +3886,7 @@ class PermissionsController extends BaseController {
3955
3886
  functionName: "addPermission",
3956
3887
  args: [permissionInput, formattedSignature],
3957
3888
  account: this.context.walletClient?.account ?? this.context.userAddress,
3958
- chain: this.context.walletClient?.chain ?? null,
3959
- ...this.spreadTransactionOptions(options)
3889
+ chain: this.context.walletClient?.chain ?? null
3960
3890
  });
3961
3891
  return hash;
3962
3892
  }
@@ -3991,11 +3921,22 @@ class PermissionsController extends BaseController {
3991
3921
  address: DataPortabilityPermissionsAddress,
3992
3922
  abi: DataPortabilityPermissionsAbi,
3993
3923
  functionName: "addServerFilesAndPermissions",
3924
+ // @ts-expect-error - Viem's type inference for nested Permission[][] arrays is incompatible with our Permission type
3994
3925
  args: [serverFilesAndPermissionInput, formattedSignature],
3995
3926
  account: this.context.walletClient?.account ?? this.context.userAddress,
3996
3927
  chain: this.context.walletClient?.chain ?? null,
3928
+ ...options?.gasLimit && { gas: options.gasLimit },
3929
+ ...options?.nonce && { nonce: options.nonce },
3997
3930
  ...options?.value && { value: options.value },
3998
- ...this.spreadTransactionOptions(options)
3931
+ // Use EIP-1559 if available, otherwise fall back to legacy gasPrice
3932
+ ...options?.maxFeePerGas || options?.maxPriorityFeePerGas ? {
3933
+ ...options.maxFeePerGas && {
3934
+ maxFeePerGas: options.maxFeePerGas
3935
+ },
3936
+ ...options.maxPriorityFeePerGas && {
3937
+ maxPriorityFeePerGas: options.maxPriorityFeePerGas
3938
+ }
3939
+ } : options?.gasPrice && { gasPrice: options.gasPrice }
3999
3940
  });
4000
3941
  return hash;
4001
3942
  }