@symmio/trading-react 4.3.0 → 4.5.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.
Files changed (186) hide show
  1. package/dist/account-layer/automatic-timelock-attempt.d.ts +11 -0
  2. package/dist/account-layer/automatic-timelock-attempt.d.ts.map +1 -0
  3. package/dist/account-layer/automatic-timelock-attempt.js +41 -0
  4. package/dist/account-layer/automatic-timelock-attempt.js.map +1 -0
  5. package/dist/account-layer/index.d.ts +9 -0
  6. package/dist/account-layer/index.d.ts.map +1 -1
  7. package/dist/account-layer/index.js +41 -32
  8. package/dist/account-layer/use-active-virtual-account-by-key.d.ts +33 -0
  9. package/dist/account-layer/use-active-virtual-account-by-key.d.ts.map +1 -0
  10. package/dist/account-layer/use-active-virtual-account-by-key.js +27 -0
  11. package/dist/account-layer/use-active-virtual-account-by-key.js.map +1 -0
  12. package/dist/account-layer/use-add-margin.d.ts +2 -2
  13. package/dist/account-layer/use-add-margin.d.ts.map +1 -1
  14. package/dist/account-layer/use-add-margin.js +28 -17
  15. package/dist/account-layer/use-add-margin.js.map +1 -1
  16. package/dist/account-layer/use-allocate.d.ts +2 -2
  17. package/dist/account-layer/use-allocate.d.ts.map +1 -1
  18. package/dist/account-layer/use-allocate.js +28 -17
  19. package/dist/account-layer/use-allocate.js.map +1 -1
  20. package/dist/account-layer/use-automatic-timelock-recovery.d.ts +25 -0
  21. package/dist/account-layer/use-automatic-timelock-recovery.d.ts.map +1 -0
  22. package/dist/account-layer/use-automatic-timelock-recovery.js +26 -0
  23. package/dist/account-layer/use-automatic-timelock-recovery.js.map +1 -0
  24. package/dist/account-layer/use-automatic-timelock.d.ts +48 -0
  25. package/dist/account-layer/use-automatic-timelock.d.ts.map +1 -0
  26. package/dist/account-layer/use-automatic-timelock.js +189 -0
  27. package/dist/account-layer/use-automatic-timelock.js.map +1 -0
  28. package/dist/account-layer/use-create-sub-accounts.d.ts +9 -4
  29. package/dist/account-layer/use-create-sub-accounts.d.ts.map +1 -1
  30. package/dist/account-layer/use-create-sub-accounts.js +11 -13
  31. package/dist/account-layer/use-create-sub-accounts.js.map +1 -1
  32. package/dist/account-layer/use-deallocate-and-initiate-withdraw.d.ts +3 -3
  33. package/dist/account-layer/use-deallocate-and-initiate-withdraw.d.ts.map +1 -1
  34. package/dist/account-layer/use-deallocate-and-initiate-withdraw.js +32 -21
  35. package/dist/account-layer/use-deallocate-and-initiate-withdraw.js.map +1 -1
  36. package/dist/account-layer/use-deallocate.d.ts +6 -5
  37. package/dist/account-layer/use-deallocate.d.ts.map +1 -1
  38. package/dist/account-layer/use-deallocate.js +33 -20
  39. package/dist/account-layer/use-deallocate.js.map +1 -1
  40. package/dist/account-layer/use-delete-sub-account.d.ts +2 -2
  41. package/dist/account-layer/use-delete-sub-account.d.ts.map +1 -1
  42. package/dist/account-layer/use-delete-sub-account.js +30 -19
  43. package/dist/account-layer/use-delete-sub-account.js.map +1 -1
  44. package/dist/account-layer/use-execute-account-calls.d.ts +7 -0
  45. package/dist/account-layer/use-execute-account-calls.d.ts.map +1 -0
  46. package/dist/account-layer/use-execute-account-calls.js +54 -0
  47. package/dist/account-layer/use-execute-account-calls.js.map +1 -0
  48. package/dist/account-layer/use-protected-function.d.ts +22 -0
  49. package/dist/account-layer/use-protected-function.d.ts.map +1 -0
  50. package/dist/account-layer/use-protected-function.js +68 -0
  51. package/dist/account-layer/use-protected-function.js.map +1 -0
  52. package/dist/account-layer/use-remove-margin.d.ts +2 -2
  53. package/dist/account-layer/use-remove-margin.d.ts.map +1 -1
  54. package/dist/account-layer/use-remove-margin.js +31 -20
  55. package/dist/account-layer/use-remove-margin.js.map +1 -1
  56. package/dist/account-layer/use-timelock-policy.d.ts +21 -0
  57. package/dist/account-layer/use-timelock-policy.d.ts.map +1 -0
  58. package/dist/account-layer/use-timelock-policy.js +112 -0
  59. package/dist/account-layer/use-timelock-policy.js.map +1 -0
  60. package/dist/account-layer/use-timelock-route.d.ts +75 -0
  61. package/dist/account-layer/use-timelock-route.d.ts.map +1 -0
  62. package/dist/account-layer/use-timelock-route.js +177 -0
  63. package/dist/account-layer/use-timelock-route.js.map +1 -0
  64. package/dist/account-layer/use-timelock.d.ts +102 -0
  65. package/dist/account-layer/use-timelock.d.ts.map +1 -0
  66. package/dist/account-layer/use-timelock.js +177 -0
  67. package/dist/account-layer/use-timelock.js.map +1 -0
  68. package/dist/account-layer/use-virtual-accounts-count-of-sub-account.d.ts +24 -0
  69. package/dist/account-layer/use-virtual-accounts-count-of-sub-account.d.ts.map +1 -0
  70. package/dist/account-layer/use-virtual-accounts-count-of-sub-account.js +27 -0
  71. package/dist/account-layer/use-virtual-accounts-count-of-sub-account.js.map +1 -0
  72. package/dist/account-layer/use-virtual-accounts-of-sub-account.d.ts +25 -0
  73. package/dist/account-layer/use-virtual-accounts-of-sub-account.d.ts.map +1 -0
  74. package/dist/account-layer/use-virtual-accounts-of-sub-account.js +27 -0
  75. package/dist/account-layer/use-virtual-accounts-of-sub-account.js.map +1 -0
  76. package/dist/errors/normalize-protected-write-error.d.ts +5 -0
  77. package/dist/errors/normalize-protected-write-error.d.ts.map +1 -0
  78. package/dist/errors/normalize-protected-write-error.js +43 -0
  79. package/dist/errors/normalize-protected-write-error.js.map +1 -0
  80. package/dist/errors/normalize-symm-error.d.ts.map +1 -1
  81. package/dist/errors/normalize-symm-error.js +56 -43
  82. package/dist/errors/normalize-symm-error.js.map +1 -1
  83. package/dist/errors/symmio-request-error.d.ts +5 -0
  84. package/dist/errors/symmio-request-error.d.ts.map +1 -1
  85. package/dist/errors/symmio-request-error.js +2 -1
  86. package/dist/errors/symmio-request-error.js.map +1 -1
  87. package/dist/gasless/index.d.ts +1 -0
  88. package/dist/gasless/index.d.ts.map +1 -1
  89. package/dist/gasless/index.js +20 -19
  90. package/dist/gasless/invalidate-relay-reads.d.ts +3 -1
  91. package/dist/gasless/invalidate-relay-reads.d.ts.map +1 -1
  92. package/dist/gasless/invalidate-relay-reads.js +115 -60
  93. package/dist/gasless/invalidate-relay-reads.js.map +1 -1
  94. package/dist/gasless/use-approve-operational-fee-allowance.d.ts +37 -0
  95. package/dist/gasless/use-approve-operational-fee-allowance.d.ts.map +1 -0
  96. package/dist/gasless/use-approve-operational-fee-allowance.js +48 -0
  97. package/dist/gasless/use-approve-operational-fee-allowance.js.map +1 -0
  98. package/dist/gasless/use-approve-operational-fee.d.ts +2 -2
  99. package/dist/gasless/use-approve-operational-fee.d.ts.map +1 -1
  100. package/dist/gasless/use-approve-operational-fee.js +28 -17
  101. package/dist/gasless/use-approve-operational-fee.js.map +1 -1
  102. package/dist/gasless/use-relay-gasless-batch.d.ts +5 -4
  103. package/dist/gasless/use-relay-gasless-batch.d.ts.map +1 -1
  104. package/dist/gasless/use-relay-gasless-batch.js.map +1 -1
  105. package/dist/index.d.ts +13 -7
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +271 -256
  108. package/dist/instant-layer/index.d.ts +2 -0
  109. package/dist/instant-layer/index.d.ts.map +1 -1
  110. package/dist/instant-layer/index.js +25 -23
  111. package/dist/instant-layer/invalidate-delegation-grant.d.ts +17 -0
  112. package/dist/instant-layer/invalidate-delegation-grant.d.ts.map +1 -0
  113. package/dist/instant-layer/invalidate-delegation-grant.js +26 -0
  114. package/dist/instant-layer/invalidate-delegation-grant.js.map +1 -0
  115. package/dist/instant-layer/use-grant-delegation.d.ts +3 -1
  116. package/dist/instant-layer/use-grant-delegation.d.ts.map +1 -1
  117. package/dist/instant-layer/use-grant-delegation.js +19 -28
  118. package/dist/instant-layer/use-grant-delegation.js.map +1 -1
  119. package/dist/instant-layer/use-grant-delegations.d.ts +44 -0
  120. package/dist/instant-layer/use-grant-delegations.d.ts.map +1 -0
  121. package/dist/instant-layer/use-grant-delegations.js +36 -0
  122. package/dist/instant-layer/use-grant-delegations.js.map +1 -0
  123. package/dist/instant-layer/use-instant-close-fees.js +8 -8
  124. package/dist/instant-layer/use-instant-open-inputs.d.ts +1 -0
  125. package/dist/instant-layer/use-instant-open-inputs.d.ts.map +1 -1
  126. package/dist/instant-layer/use-instant-open-inputs.js +81 -80
  127. package/dist/instant-layer/use-instant-open-inputs.js.map +1 -1
  128. package/dist/instant-layer/use-prepare-instant-open-params.d.ts +6 -0
  129. package/dist/instant-layer/use-prepare-instant-open-params.d.ts.map +1 -1
  130. package/dist/instant-layer/use-prepare-instant-open-params.js +1 -0
  131. package/dist/instant-layer/use-prepare-instant-open-params.js.map +1 -1
  132. package/dist/instant-layer/use-session-key-selectors.d.ts +5 -2
  133. package/dist/instant-layer/use-session-key-selectors.d.ts.map +1 -1
  134. package/dist/instant-layer/use-session-key-selectors.js +9 -5
  135. package/dist/instant-layer/use-session-key-selectors.js.map +1 -1
  136. package/dist/instant-layer/use-simulate-grant-delegations.d.ts +25 -0
  137. package/dist/instant-layer/use-simulate-grant-delegations.d.ts.map +1 -0
  138. package/dist/instant-layer/use-simulate-grant-delegations.js +29 -0
  139. package/dist/instant-layer/use-simulate-grant-delegations.js.map +1 -0
  140. package/dist/price-service/use-enigma-prices.d.ts +4 -0
  141. package/dist/price-service/use-enigma-prices.d.ts.map +1 -1
  142. package/dist/price-service/use-enigma-prices.js +60 -24
  143. package/dist/price-service/use-enigma-prices.js.map +1 -1
  144. package/dist/provider/symmio-provider.d.ts +31 -4
  145. package/dist/provider/symmio-provider.d.ts.map +1 -1
  146. package/dist/provider/symmio-provider.js +12 -11
  147. package/dist/provider/symmio-provider.js.map +1 -1
  148. package/dist/solvers/timelock-capability-cache.d.ts +9 -0
  149. package/dist/solvers/timelock-capability-cache.d.ts.map +1 -0
  150. package/dist/solvers/timelock-capability-cache.js +79 -0
  151. package/dist/solvers/timelock-capability-cache.js.map +1 -0
  152. package/dist/solvers/use-solver-info.d.ts +5 -2
  153. package/dist/solvers/use-solver-info.d.ts.map +1 -1
  154. package/dist/solvers/use-solver-info.js +35 -11
  155. package/dist/solvers/use-solver-info.js.map +1 -1
  156. package/dist/transactions/write-types.d.ts +13 -1
  157. package/dist/transactions/write-types.d.ts.map +1 -1
  158. package/dist/withdraw/index.d.ts +3 -0
  159. package/dist/withdraw/index.d.ts.map +1 -1
  160. package/dist/withdraw/use-deallocate-debounce-time.d.ts +29 -0
  161. package/dist/withdraw/use-deallocate-debounce-time.d.ts.map +1 -0
  162. package/dist/withdraw/use-deallocate-debounce-time.js +27 -0
  163. package/dist/withdraw/use-deallocate-debounce-time.js.map +1 -0
  164. package/dist/withdraw/use-finalize-withdraw-request.d.ts.map +1 -1
  165. package/dist/withdraw/use-finalize-withdraw-request.js +13 -12
  166. package/dist/withdraw/use-finalize-withdraw-request.js.map +1 -1
  167. package/dist/withdraw/use-initiate-withdraw.d.ts +2 -2
  168. package/dist/withdraw/use-initiate-withdraw.d.ts.map +1 -1
  169. package/dist/withdraw/use-initiate-withdraw.js +29 -17
  170. package/dist/withdraw/use-initiate-withdraw.js.map +1 -1
  171. package/dist/withdraw/use-pending-withdraw-requests-batch.d.ts +19 -0
  172. package/dist/withdraw/use-pending-withdraw-requests-batch.d.ts.map +1 -0
  173. package/dist/withdraw/use-pending-withdraw-requests-batch.js +27 -0
  174. package/dist/withdraw/use-pending-withdraw-requests-batch.js.map +1 -0
  175. package/dist/withdraw/use-request-cancel-withdraw.d.ts.map +1 -1
  176. package/dist/withdraw/use-request-cancel-withdraw.js +14 -13
  177. package/dist/withdraw/use-request-cancel-withdraw.js.map +1 -1
  178. package/dist/withdraw/use-withdraw-cooldown-of.d.ts +33 -0
  179. package/dist/withdraw/use-withdraw-cooldown-of.d.ts.map +1 -0
  180. package/dist/withdraw/use-withdraw-cooldown-of.js +27 -0
  181. package/dist/withdraw/use-withdraw-cooldown-of.js.map +1 -0
  182. package/dist/withdraw/use-withdraw.d.ts +3 -3
  183. package/dist/withdraw/use-withdraw.d.ts.map +1 -1
  184. package/dist/withdraw/use-withdraw.js +57 -31
  185. package/dist/withdraw/use-withdraw.js.map +1 -1
  186. package/package.json +2 -2
@@ -1,5 +1,6 @@
1
1
  //#region src/errors/symmio-request-error.ts
2
2
  var e = class extends Error {
3
+ timelock;
3
4
  name = "SymmioRequestError";
4
5
  kind;
5
6
  code;
@@ -9,7 +10,7 @@ var e = class extends Error {
9
10
  reason;
10
11
  shortMessage;
11
12
  constructor(e) {
12
- super(e.message, { cause: e.cause }), this.kind = e.kind, this.code = e.code, this.status = e.status, this.responseData = e.responseData, this.retryAfterMs = e.retryAfterMs ?? null, this.reason = e.reason, this.shortMessage = e.shortMessage;
13
+ super(e.message, { cause: e.cause }), this.kind = e.kind, this.timelock = e.timelock, this.code = e.code, this.status = e.status, this.responseData = e.responseData, this.retryAfterMs = e.retryAfterMs ?? null, this.reason = e.reason, this.shortMessage = e.shortMessage;
13
14
  }
14
15
  };
15
16
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"symmio-request-error.js","names":[],"sources":["../../src/errors/symmio-request-error.ts"],"sourcesContent":["import type { SymmioNormalizedErrorKind } from \"./types\";\n\n/**\n * Options accepted by the {@link SymmioRequestError} constructor. Carries\n * the discriminator-specific fields the UI cares about.\n */\nexport interface SymmioRequestErrorOptions {\n kind: SymmioNormalizedErrorKind;\n message: string;\n /** SDK error code (e.g., \"FETCH_MARKETS_FAILED\", \"UNSUPPORTED_CHAIN\"). */\n code?: string;\n /** HTTP status code. Only meaningful when `kind === \"api\"`. */\n status?: number;\n /**\n * Raw response body returned by the server. Only meaningful when `kind === \"api\"`.\n * Forwarded verbatim from `SymmApiError.responseData` so the UI can render the\n * server's structured error fields without unwrapping `cause`.\n */\n responseData?: unknown;\n /**\n * Retry delay the server asked for, in ms, from `SymmApiError.retryAfterMs`.\n * Only meaningful when `kind === \"api\"`. Defaults to `null`.\n */\n retryAfterMs?: number | null;\n /** Solidity revert reason. Only meaningful when `kind === \"contract-revert\"`. */\n reason?: string;\n /** viem's human-readable short message. Only meaningful when `kind === \"rpc\"`. */\n shortMessage?: string;\n /** The original underlying error, kept for debugging. */\n cause?: unknown;\n}\n\n/**\n * The single error class every SYMMIO React hook throws when a read or write\n * fails. Carries a discriminator (`kind`) the UI can switch on without\n * inspecting viem's internal error hierarchy.\n *\n * @example\n * const { error } = useUserSubAccounts({ user });\n * if (error?.kind === \"user-rejected\") return null; // silent\n * if (error?.kind === \"contract-revert\") return <ShowReason reason={error.reason} />;\n * if (error?.kind === \"api\") return <ApiError status={error.status} code={error.code} />;\n * if (error) return <GenericError message={error.message} />;\n */\nexport class SymmioRequestError extends Error {\n override readonly name = \"SymmioRequestError\";\n /** Classification used by the UI to branch on this failure. */\n readonly kind: SymmioNormalizedErrorKind;\n /** SDK error code (e.g., \"FETCH_MARKETS_FAILED\"). */\n readonly code?: string;\n /** HTTP status code when `kind === \"api\"`. */\n readonly status?: number;\n /** Raw response body returned by the server when `kind === \"api\"`. */\n readonly responseData?: unknown;\n /**\n * How long the server asked the client to wait before retrying, in ms,\n * parsed from its `Retry-After` header. `normalizeSymmError` sets it only for\n * `kind === \"api\"`, and even then it is `null` when the response carried no\n * usable header. A cross-origin browser sees the header only when the server\n * exposes it, so treat `null` as \"unknown\" and still back off, e.g. at least\n * one second plus jitter.\n *\n * @example\n * if (error?.kind === \"api\" && error.status === 429) {\n * retryIn(error.retryAfterMs ?? 1_000 + Math.random() * 500);\n * }\n */\n readonly retryAfterMs: number | null;\n /** Solidity revert reason when `kind === \"contract-revert\"`. */\n readonly reason?: string;\n /** viem's short message when `kind === \"rpc\"`. */\n readonly shortMessage?: string;\n\n constructor(options: SymmioRequestErrorOptions) {\n super(options.message, { cause: options.cause });\n this.kind = options.kind;\n this.code = options.code;\n this.status = options.status;\n this.responseData = options.responseData;\n this.retryAfterMs = options.retryAfterMs ?? null;\n this.reason = options.reason;\n this.shortMessage = options.shortMessage;\n }\n}\n"],"mappings":";AA4CA,IAAa,IAAb,cAAwC,MAAM;CAC5C,OAAyB;CAEzB;CAEA;CAEA;CAEA;CAcA;CAEA;CAEA;CAEA,YAAY,GAAoC;EAQ9C,AAPA,MAAM,EAAQ,SAAS,EAAE,OAAO,EAAQ,MAAM,CAAC,GAC/C,KAAK,OAAO,EAAQ,MACpB,KAAK,OAAO,EAAQ,MACpB,KAAK,SAAS,EAAQ,QACtB,KAAK,eAAe,EAAQ,cAC5B,KAAK,eAAe,EAAQ,gBAAgB,MAC5C,KAAK,SAAS,EAAQ,QACtB,KAAK,eAAe,EAAQ;CAC9B;AACF"}
1
+ {"version":3,"file":"symmio-request-error.js","names":[],"sources":["../../src/errors/symmio-request-error.ts"],"sourcesContent":["import type { TimelockErrorDetails } from \"@symmio/trading-core\";\nimport type { SymmioNormalizedErrorKind } from \"./types\";\n\n/**\n * Options accepted by the {@link SymmioRequestError} constructor. Carries\n * the discriminator-specific fields the UI cares about.\n */\nexport interface SymmioRequestErrorOptions {\n /** Normalized timelock solver fields, when this is a typed timelock API error. */\n timelock?: TimelockErrorDetails;\n kind: SymmioNormalizedErrorKind;\n message: string;\n /** SDK error code (e.g., \"FETCH_MARKETS_FAILED\", \"UNSUPPORTED_CHAIN\"). */\n code?: string;\n /** HTTP status code. Only meaningful when `kind === \"api\"`. */\n status?: number;\n /**\n * Raw response body returned by the server. Only meaningful when `kind === \"api\"`.\n * Forwarded verbatim from `SymmApiError.responseData` so the UI can render the\n * server's structured error fields without unwrapping `cause`.\n */\n responseData?: unknown;\n /**\n * Retry delay the server asked for, in ms, from `SymmApiError.retryAfterMs`.\n * Only meaningful when `kind === \"api\"`. Defaults to `null`.\n */\n retryAfterMs?: number | null;\n /** Solidity revert reason. Only meaningful when `kind === \"contract-revert\"`. */\n reason?: string;\n /** viem's human-readable short message. Only meaningful when `kind === \"rpc\"`. */\n shortMessage?: string;\n /** The original underlying error, kept for debugging. */\n cause?: unknown;\n}\n\n/**\n * The single error class every SYMMIO React hook throws when a read or write\n * fails. Carries a discriminator (`kind`) the UI can switch on without\n * inspecting viem's internal error hierarchy.\n *\n * @example\n * const { error } = useUserSubAccounts({ user });\n * if (error?.kind === \"user-rejected\") return null; // silent\n * if (error?.kind === \"contract-revert\") return <ShowReason reason={error.reason} />;\n * if (error?.kind === \"api\") return <ApiError status={error.status} code={error.code} />;\n * if (error) return <GenericError message={error.message} />;\n */\nexport class SymmioRequestError extends Error {\n /** Structured timelock error fields without parsing the free-form diagnostic body. */\n readonly timelock?: TimelockErrorDetails;\n override readonly name = \"SymmioRequestError\";\n /** Classification used by the UI to branch on this failure. */\n readonly kind: SymmioNormalizedErrorKind;\n /** SDK error code (e.g., \"FETCH_MARKETS_FAILED\"). */\n readonly code?: string;\n /** HTTP status code when `kind === \"api\"`. */\n readonly status?: number;\n /** Raw response body returned by the server when `kind === \"api\"`. */\n readonly responseData?: unknown;\n /**\n * How long the server asked the client to wait before retrying, in ms,\n * parsed from its `Retry-After` header. `normalizeSymmError` sets it only for\n * `kind === \"api\"`, and even then it is `null` when the response carried no\n * usable header. A cross-origin browser sees the header only when the server\n * exposes it, so treat `null` as \"unknown\" and still back off, e.g. at least\n * one second plus jitter.\n *\n * @example\n * if (error?.kind === \"api\" && error.status === 429) {\n * retryIn(error.retryAfterMs ?? 1_000 + Math.random() * 500);\n * }\n */\n readonly retryAfterMs: number | null;\n /** Solidity revert reason when `kind === \"contract-revert\"`. */\n readonly reason?: string;\n /** viem's short message when `kind === \"rpc\"`. */\n readonly shortMessage?: string;\n\n constructor(options: SymmioRequestErrorOptions) {\n super(options.message, { cause: options.cause });\n this.kind = options.kind;\n this.timelock = options.timelock;\n this.code = options.code;\n this.status = options.status;\n this.responseData = options.responseData;\n this.retryAfterMs = options.retryAfterMs ?? null;\n this.reason = options.reason;\n this.shortMessage = options.shortMessage;\n }\n}\n"],"mappings":";AA+CA,IAAa,IAAb,cAAwC,MAAM;CAE5C;CACA,OAAyB;CAEzB;CAEA;CAEA;CAEA;CAcA;CAEA;CAEA;CAEA,YAAY,GAAoC;EAS9C,AARA,MAAM,EAAQ,SAAS,EAAE,OAAO,EAAQ,MAAM,CAAC,GAC/C,KAAK,OAAO,EAAQ,MACpB,KAAK,WAAW,EAAQ,UACxB,KAAK,OAAO,EAAQ,MACpB,KAAK,SAAS,EAAQ,QACtB,KAAK,eAAe,EAAQ,cAC5B,KAAK,eAAe,EAAQ,gBAAgB,MAC5C,KAAK,SAAS,EAAQ,QACtB,KAAK,eAAe,EAAQ;CAC9B;AACF"}
@@ -1,5 +1,6 @@
1
1
  export * from './gasless-relay-types.js';
2
2
  export * from './use-approve-operational-fee.js';
3
+ export * from './use-approve-operational-fee-allowance.js';
3
4
  export * from './use-gasless-batch-fee-quote.js';
4
5
  export * from './use-gasless-deposit-policy.js';
5
6
  export * from './use-gasless-fee-quote.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gasless/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/gasless/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,gCAAgC,CAAC"}
@@ -1,21 +1,22 @@
1
1
  import { IDLE_RELAY_PROGRESS as e } from "./gasless-relay-types.js";
2
2
  import { useApproveOperationalFee as t } from "./use-approve-operational-fee.js";
3
- import { useGaslessBatchFeeQuote as n } from "./use-gasless-batch-fee-quote.js";
4
- import { useGaslessDepositPolicy as r } from "./use-gasless-deposit-policy.js";
5
- import { useGaslessFeeQuote as i } from "./use-gasless-fee-quote.js";
6
- import { useGaslessRequestStream as a } from "./use-gasless-request-stream.js";
7
- import { useGaslessRequest as o } from "./use-gasless-request.js";
8
- import { useGaslessRequestTransactions as s } from "./use-gasless-request-transactions.js";
9
- import { useGaslessWalletAddress as c } from "./use-gasless-wallet-address.js";
10
- import { useGaslessWalletCreationFee as l } from "./use-gasless-wallet-creation-fee.js";
11
- import { useGaslessWalletExecute as u } from "./use-gasless-wallet-execute.js";
12
- import { useGaslessWalletExecuteSelectors as d } from "./use-gasless-wallet-execute-selectors.js";
13
- import { useGaslessWalletNonce as f } from "./use-gasless-wallet-nonce.js";
14
- import { useOperationalFeeAllowance as p } from "./use-operational-fee-allowance.js";
15
- import { useRelayGaslessBatch as m } from "./use-relay-gasless-batch.js";
16
- import { useRelayInstantOperations as h } from "./use-relay-instant-operations.js";
17
- import { useResubmitGaslessRequest as g } from "./use-resubmit-gasless-request.js";
18
- import { useSettleGaslessDepositExistingAccount as _ } from "./use-settle-gasless-deposit-existing-account.js";
19
- import { useSettleGaslessDepositNewAccount as v } from "./use-settle-gasless-deposit-new-account.js";
20
- import { useSupportsGaslessService as y } from "./use-supports-gasless-service.js";
21
- export { e as IDLE_RELAY_PROGRESS, t as useApproveOperationalFee, n as useGaslessBatchFeeQuote, r as useGaslessDepositPolicy, i as useGaslessFeeQuote, o as useGaslessRequest, a as useGaslessRequestStream, s as useGaslessRequestTransactions, c as useGaslessWalletAddress, l as useGaslessWalletCreationFee, u as useGaslessWalletExecute, d as useGaslessWalletExecuteSelectors, f as useGaslessWalletNonce, p as useOperationalFeeAllowance, m as useRelayGaslessBatch, h as useRelayInstantOperations, g as useResubmitGaslessRequest, _ as useSettleGaslessDepositExistingAccount, v as useSettleGaslessDepositNewAccount, y as useSupportsGaslessService };
3
+ import { useApproveOperationalFeeAllowance as n } from "./use-approve-operational-fee-allowance.js";
4
+ import { useGaslessBatchFeeQuote as r } from "./use-gasless-batch-fee-quote.js";
5
+ import { useGaslessDepositPolicy as i } from "./use-gasless-deposit-policy.js";
6
+ import { useGaslessFeeQuote as a } from "./use-gasless-fee-quote.js";
7
+ import { useGaslessRequestStream as o } from "./use-gasless-request-stream.js";
8
+ import { useGaslessRequest as s } from "./use-gasless-request.js";
9
+ import { useGaslessRequestTransactions as c } from "./use-gasless-request-transactions.js";
10
+ import { useGaslessWalletAddress as l } from "./use-gasless-wallet-address.js";
11
+ import { useGaslessWalletCreationFee as u } from "./use-gasless-wallet-creation-fee.js";
12
+ import { useGaslessWalletExecute as d } from "./use-gasless-wallet-execute.js";
13
+ import { useGaslessWalletExecuteSelectors as f } from "./use-gasless-wallet-execute-selectors.js";
14
+ import { useGaslessWalletNonce as p } from "./use-gasless-wallet-nonce.js";
15
+ import { useOperationalFeeAllowance as m } from "./use-operational-fee-allowance.js";
16
+ import { useRelayGaslessBatch as h } from "./use-relay-gasless-batch.js";
17
+ import { useRelayInstantOperations as g } from "./use-relay-instant-operations.js";
18
+ import { useResubmitGaslessRequest as _ } from "./use-resubmit-gasless-request.js";
19
+ import { useSettleGaslessDepositExistingAccount as v } from "./use-settle-gasless-deposit-existing-account.js";
20
+ import { useSettleGaslessDepositNewAccount as y } from "./use-settle-gasless-deposit-new-account.js";
21
+ import { useSupportsGaslessService as b } from "./use-supports-gasless-service.js";
22
+ export { e as IDLE_RELAY_PROGRESS, t as useApproveOperationalFee, n as useApproveOperationalFeeAllowance, r as useGaslessBatchFeeQuote, i as useGaslessDepositPolicy, a as useGaslessFeeQuote, s as useGaslessRequest, o as useGaslessRequestStream, c as useGaslessRequestTransactions, l as useGaslessWalletAddress, u as useGaslessWalletCreationFee, d as useGaslessWalletExecute, f as useGaslessWalletExecuteSelectors, p as useGaslessWalletNonce, m as useOperationalFeeAllowance, h as useRelayGaslessBatch, g as useRelayInstantOperations, _ as useResubmitGaslessRequest, v as useSettleGaslessDepositExistingAccount, y as useSettleGaslessDepositNewAccount, b as useSupportsGaslessService };
@@ -1,6 +1,6 @@
1
1
  import { GaslessBatchCall } from '@symmio/trading-core';
2
2
  import { QueryClient } from '@tanstack/react-query';
3
- import { Address } from 'viem';
3
+ import { Address, Hex } from 'viem';
4
4
  /** Chain-config fingerprint every invalidation is scoped by. */
5
5
  interface Scope {
6
6
  configKey?: string;
@@ -69,6 +69,8 @@ export declare function invalidateGaslessBatchReads(queryClient: QueryClient, sc
69
69
  account: Address;
70
70
  calls: readonly GaslessBatchCall[];
71
71
  }): void;
72
+ /** Refresh confirmed timelock execution effects without assuming relay transport. @internal */
73
+ export declare function invalidateTimelockExecutionReads(queryClient: QueryClient, scope: Scope, innerCallData: Hex): void;
72
74
  /**
73
75
  * Invalidate the reads a deposit settlement changed.
74
76
  *
@@ -1 +1 @@
1
- {"version":3,"file":"invalidate-relay-reads.d.ts","sourceRoot":"","sources":["../../src/gasless/invalidate-relay-reads.ts"],"names":[],"mappings":"AAAA,OAAO,EA2BL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,WAAW,EAAE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OAAO,CAAA;CAAE,GAC9E,IAAI,CAcN"}
@@ -1,107 +1,162 @@
1
1
  import { predicateMatch as e } from "../utils/predicate-match.js";
2
2
  import { invalidateAccountBalances as t } from "../utils/invalidate-account-balances.js";
3
- import { accountLayerAbi as n, getCollateralAllowanceQueryKey as r, getCollateralBalanceQueryKey as i, getDelegationExpiryQueryKey as a, getGaslessBatchSelectors as o, getGaslessDepositPolicyQueryKey as s, getGaslessWalletCreationFeeQueryKey as c, getGaslessWalletNonceQueryKey as l, getInstantLayerNonceQueryKey as u, getIsDelegationActiveQueryKey as d, getLastWithdrawRequestIdQueryKey as f, getOperationalFeeAllowanceQueryKey as p, getPartyAOpenPositionsQueryKey as m, getPartyAPendingQuotesQueryKey as h, getPendingQuotesQueryKey as g, getPendingWithdrawRequestsQueryKey as _, getQuotePendingFundingQueryKey as v, getQuoteQueryKey as y, getSubAccountQueryKey as b, getSubAccountsCountOfUserQueryKey as x, getUserSubAccountsAddressesQueryKey as S, getUserSubAccountsQueryKey as C, getWithdrawRequestsQueryKey as w, getWithdrawableTimeQueryKey as T, instantLayerAbi as E, symmioAbi as D } from "@symmio/trading-core";
4
- import { isAddress as O, toFunctionSelector as k } from "viem";
3
+ import { accountLayerAbi as n, getActiveDelegationsQueryKey as r, getActiveVirtualAccountByKeyQueryKey as i, getCollateralAllowanceQueryKey as a, getCollateralBalanceQueryKey as o, getDelegationExpiryQueryKey as s, getGaslessBatchSelectors as c, getGaslessDepositPolicyQueryKey as l, getGaslessWalletCreationFeeQueryKey as u, getGaslessWalletNonceQueryKey as ee, getInstantLayerNonceQueryKey as d, getIsDelegationActiveQueryKey as f, getLastWithdrawRequestIdQueryKey as p, getOperationalFeeAllowanceQueryKey as m, getPartyAOpenPositionsQueryKey as h, getPartyAPendingQuotesQueryKey as g, getPendingQuotesQueryKey as _, getPendingRevocationEtasQueryKey as v, getPendingWithdrawRequestsBatchQueryKey as y, getPendingWithdrawRequestsQueryKey as b, getPredictedNextVirtualAccountQueryKey as x, getQuotePendingFundingQueryKey as te, getQuoteQueryKey as ne, getSelectorTimelockQueryKey as S, getSubAccountQueryKey as C, getSubAccountVirtualNonceQueryKey as w, getSubAccountsCountOfUserQueryKey as T, getTimelockPolicyQueryKey as E, getTimelockScheduleStateQueryKey as D, getUserSubAccountsAddressesQueryKey as O, getUserSubAccountsQueryKey as k, getVirtualAccountQueryKey as A, getVirtualAccountsAddressesOfSubAccountQueryKey as j, getVirtualAccountsCountOfSubAccountQueryKey as M, getVirtualAccountsOfSubAccountQueryKey as N, getWithdrawCooldownOfQueryKey as P, getWithdrawRequestsQueryKey as F, getWithdrawableTimeQueryKey as I, instantLayerAbi as L, symmioAbi as R } from "@symmio/trading-core";
4
+ import { decodeFunctionData as z, encodeFunctionData as B, isAddress as V, sliceHex as re, toFunctionSelector as H } from "viem";
5
5
  //#region src/gasless/invalidate-relay-reads.ts
6
- function A(n, r, i) {
7
- t(n, r), n.invalidateQueries({ predicate: e(p, {
6
+ function U(n, r, i) {
7
+ t(n, r), n.invalidateQueries({ predicate: e(m, {
8
8
  ...r,
9
9
  payer: i
10
10
  }) });
11
11
  }
12
- function j(t, n, r) {
12
+ function W(t, n, r) {
13
13
  let i = {
14
14
  ...n,
15
15
  owner: r.owner,
16
16
  walletId: r.walletId
17
17
  };
18
- t.invalidateQueries({ predicate: e(s, i) }), t.invalidateQueries({ predicate: e(c, i) });
18
+ t.invalidateQueries({ predicate: e(l, i) }), t.invalidateQueries({ predicate: e(u, i) });
19
19
  }
20
- function M(n, r, i) {
20
+ function G(n, r, i) {
21
21
  let a = [...new Set(i)];
22
- for (let t of a) n.invalidateQueries({ predicate: e(u, {
22
+ for (let t of a) n.invalidateQueries({ predicate: e(d, {
23
23
  ...r,
24
24
  account: t
25
- }) }), n.invalidateQueries({ predicate: e(p, {
25
+ }) }), n.invalidateQueries({ predicate: e(m, {
26
26
  ...r,
27
27
  payer: t
28
28
  }) });
29
29
  t(n, r);
30
30
  }
31
- function N(t, n, r) {
32
- t.invalidateQueries({ predicate: e(l, {
31
+ function K(t, n, r) {
32
+ t.invalidateQueries({ predicate: e(ee, {
33
33
  ...n,
34
34
  owner: r.owner,
35
35
  walletId: r.walletId,
36
36
  account: r.signerAccount ?? r.owner
37
- }) }), t.invalidateQueries({ predicate: e(i, n) }), j(t, n, r), A(t, n);
37
+ }) }), t.invalidateQueries({ predicate: e(o, n) }), W(t, n, r), U(t, n);
38
38
  }
39
- function P(e, t) {
39
+ function q(e, t) {
40
40
  let n = e.find((e) => e.type === "function" && e.name === t);
41
41
  if (!n) throw Error(`invalidate-relay-reads: the shipped ABI has no function "${t}".`);
42
- return k(n);
42
+ return H(n);
43
43
  }
44
- var F = new Set([
45
- P(D, "initiateWithdraw"),
46
- P(D, "requestCancelWithdraw"),
47
- P(D, "finalizeWithdrawRequest")
48
- ]), I = new Set([
49
- P(D, "requestToCancelQuote"),
50
- P(D, "requestToCancelCloseRequest"),
51
- P(D, "forceCancelQuote"),
52
- P(D, "forceCancelCloseRequest"),
53
- P(D, "forceClosePosition")
54
- ]), L = new Set([
55
- P(n, "createSubAccounts"),
56
- P(n, "deleteSubAccount"),
57
- P(n, "editAccountName")
58
- ]), R = new Set([P(n, "depositForAccount"), P(n, "depositAndAllocateForAccount")]), z = P(E, "grantDelegation");
59
- function B(t, n, s) {
60
- let c = new Set(o(s.calls)), l = (e) => [...e].some((e) => c.has(e));
61
- t.invalidateQueries({ predicate: e(u, {
44
+ var J = new Set([
45
+ q(R, "initiateWithdraw"),
46
+ q(R, "requestCancelWithdraw"),
47
+ q(R, "finalizeWithdrawRequest")
48
+ ]), Y = new Set([q(R, "deallocate")]), X = new Set([
49
+ q(R, "requestToCancelQuote"),
50
+ q(R, "requestToCancelCloseRequest"),
51
+ q(R, "forceCancelQuote"),
52
+ q(R, "forceCancelCloseRequest"),
53
+ q(R, "forceClosePosition")
54
+ ]), ie = new Set([
55
+ q(n, "createSubAccounts"),
56
+ q(n, "deleteSubAccount"),
57
+ q(n, "editAccountName"),
58
+ q(n, "transferSubAccountOwnership"),
59
+ q(n, "setSingleVAMode"),
60
+ q(n, "createCustomVirtualAccount")
61
+ ]), ae = new Set([
62
+ q(n, "transferSubAccountOwnership"),
63
+ q(n, "deleteSubAccount"),
64
+ q(n, "setSingleVAMode"),
65
+ q(n, "createCustomVirtualAccount")
66
+ ]), oe = new Set([q(R, "approveOperationalFee"), q(R, "approveOperationalFeeWithMultiplier")]), se = new Set([q(n, "depositForAccount"), q(n, "depositAndAllocateForAccount")]), ce = new Set([q(L, "grantDelegation"), q(L, "grantDelegations")]), Z = new Set([q(n, "setupTimelocks"), q(n, "clearTimelocks")]), le = new Set([
67
+ q(n, "scheduleTimelockOp"),
68
+ q(n, "cancelTimelockOp"),
69
+ q(n, "executeTimelockOp")
70
+ ]);
71
+ function ue(e) {
72
+ let t = new Set(c(e)), r = [];
73
+ for (let t of e) "data" in t ? r.push(t.data) : "functionName" in t && t.functionName === "executeTimelockOp" && r.push(B({
74
+ abi: t.abi ?? n,
75
+ functionName: t.functionName,
76
+ args: t.args
77
+ }));
78
+ return Q(r, t);
79
+ }
80
+ function Q(e, t = /* @__PURE__ */ new Set()) {
81
+ for (; e.length;) {
82
+ let r = e.pop();
83
+ if (!(r.length < 10)) {
84
+ t.add(re(r, 0, 4).toLowerCase());
85
+ try {
86
+ let t = z({
87
+ abi: n,
88
+ data: r
89
+ });
90
+ t.functionName === "executeTimelockOp" ? e.push(t.args[1]) : t.functionName === "_call" && e.push(...t.args[1]);
91
+ } catch {}
92
+ }
93
+ }
94
+ return t;
95
+ }
96
+ function de(t, n, r) {
97
+ let i = ue(r.calls);
98
+ t.invalidateQueries({ predicate: e(d, {
62
99
  ...n,
63
- account: s.account
64
- }) }), A(t, n);
65
- for (let e of s.calls) "walletCalls" in e && N(t, n, {
100
+ account: r.account
101
+ }) }), U(t, n), $(t, n, i);
102
+ for (let e of r.calls) "walletCalls" in e && K(t, n, {
66
103
  walletId: e.walletId ?? 0n,
67
- signerAccount: s.account
104
+ signerAccount: r.account
68
105
  });
69
- if (l(F)) for (let r of [
70
- _,
71
- f,
72
- T,
73
- w
106
+ }
107
+ function fe(e, r, i) {
108
+ let a = Q([i]);
109
+ a.add(q(n, "executeTimelockOp")), t(e, r), $(e, r, a);
110
+ }
111
+ function $(t, n, c) {
112
+ let l = (e) => [...e].some((e) => c.has(e));
113
+ if (l(Z) && (t.invalidateQueries({ predicate: e(E, n) }), t.invalidateQueries({ predicate: e(S, n) })), (l(Z) || l(le)) && t.invalidateQueries({ predicate: e(D, n) }), l(J)) for (let r of [
114
+ b,
115
+ y,
116
+ p,
117
+ I,
118
+ F
74
119
  ]) t.invalidateQueries({ predicate: e(r, n) });
75
- if (l(I)) for (let r of [
76
- h,
120
+ if (l(Y)) for (let r of [P, I]) t.invalidateQueries({ predicate: e(r, n) });
121
+ if (l(X)) for (let r of [
77
122
  g,
78
- y,
79
- m,
80
- v
123
+ _,
124
+ ne,
125
+ h,
126
+ te
127
+ ]) t.invalidateQueries({ predicate: e(r, n) });
128
+ if (l(ie)) for (let r of [
129
+ k,
130
+ O,
131
+ T,
132
+ C
81
133
  ]) t.invalidateQueries({ predicate: e(r, n) });
82
- if (l(L)) for (let r of [
83
- C,
84
- S,
134
+ if (l(se) && (t.invalidateQueries({ predicate: e(o, n) }), t.invalidateQueries({ predicate: e(a, n) })), l(ae)) for (let r of [
135
+ A,
136
+ N,
137
+ j,
138
+ M,
139
+ i,
85
140
  x,
86
- b
141
+ w
87
142
  ]) t.invalidateQueries({ predicate: e(r, n) });
88
- l(R) && (t.invalidateQueries({ predicate: e(i, n) }), t.invalidateQueries({ predicate: e(r, n) })), c.has(z) && (t.invalidateQueries({ predicate: e(d, n) }), t.invalidateQueries({ predicate: e(a, n) }));
143
+ l(oe) && t.invalidateQueries({ predicate: e(m, n) }), l(ce) && (t.invalidateQueries({ predicate: e(f, n) }), t.invalidateQueries({ predicate: e(s, n) }), t.invalidateQueries({ predicate: e(r, n) }), t.invalidateQueries({ predicate: e(v, n) }));
89
144
  }
90
- function V(n, r, a) {
91
- let o = a.depositAddress && O(a.depositAddress) ? a.depositAddress : void 0;
92
- if (n.invalidateQueries({ predicate: e(i, {
145
+ function pe(n, r, i) {
146
+ let a = i.depositAddress && V(i.depositAddress) ? i.depositAddress : void 0;
147
+ if (n.invalidateQueries({ predicate: e(o, {
93
148
  ...r,
94
- owner: o
95
- }) }), a.newAccount && a.owner) {
149
+ owner: a
150
+ }) }), i.newAccount && i.owner) {
96
151
  let t = {
97
152
  ...r,
98
- user: a.owner
153
+ user: i.owner
99
154
  };
100
- n.invalidateQueries({ predicate: e(C, t) }), n.invalidateQueries({ predicate: e(S, t) }), n.invalidateQueries({ predicate: e(x, t) });
155
+ n.invalidateQueries({ predicate: e(k, t) }), n.invalidateQueries({ predicate: e(O, t) }), n.invalidateQueries({ predicate: e(T, t) });
101
156
  }
102
- j(n, r, a), t(n, r);
157
+ W(n, r, i), t(n, r);
103
158
  }
104
159
  //#endregion
105
- export { V as invalidateDepositSettlementReads, B as invalidateGaslessBatchReads, N as invalidateGaslessWalletExecuteReads, M as invalidateRelayInstantOperationsReads };
160
+ export { pe as invalidateDepositSettlementReads, de as invalidateGaslessBatchReads, K as invalidateGaslessWalletExecuteReads, G as invalidateRelayInstantOperationsReads, fe as invalidateTimelockExecutionReads };
106
161
 
107
162
  //# sourceMappingURL=invalidate-relay-reads.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"invalidate-relay-reads.js","names":[],"sources":["../../src/gasless/invalidate-relay-reads.ts"],"sourcesContent":["import {\n accountLayerAbi,\n getCollateralAllowanceQueryKey,\n getCollateralBalanceQueryKey,\n getDelegationExpiryQueryKey,\n getGaslessBatchSelectors,\n getGaslessDepositPolicyQueryKey,\n getGaslessWalletCreationFeeQueryKey,\n getGaslessWalletNonceQueryKey,\n getInstantLayerNonceQueryKey,\n getIsDelegationActiveQueryKey,\n getLastWithdrawRequestIdQueryKey,\n getOperationalFeeAllowanceQueryKey,\n getPartyAOpenPositionsQueryKey,\n getPartyAPendingQuotesQueryKey,\n getPendingQuotesQueryKey,\n getPendingWithdrawRequestsQueryKey,\n getQuotePendingFundingQueryKey,\n getQuoteQueryKey,\n getSubAccountQueryKey,\n getSubAccountsCountOfUserQueryKey,\n getUserSubAccountsAddressesQueryKey,\n getUserSubAccountsQueryKey,\n getWithdrawRequestsQueryKey,\n getWithdrawableTimeQueryKey,\n instantLayerAbi,\n symmioAbi,\n type GaslessBatchCall,\n} from \"@symmio/trading-core\";\nimport type { QueryClient } from \"@tanstack/react-query\";\nimport { isAddress, toFunctionSelector, type Abi, type AbiFunction, type Address, type Hex } from \"viem\";\nimport { invalidateAccountBalances } from \"../utils/invalidate-account-balances\";\nimport { predicateMatch } from \"../utils/predicate-match\";\n\n/** Chain-config fingerprint every invalidation is scoped by. */\ninterface Scope {\n configKey?: string;\n}\n\n/**\n * The GaslessWallet a relayed action touched, as far as its variables say.\n * Every omitted field matches all of its values — a superset is correct, a\n * silent no-op is not.\n */\ninterface GaslessWalletScope {\n /** The wallet's owner. */\n owner?: Address;\n /**\n * The wallet's id. `useGaslessWalletExecute` forwards its variables whole, so\n * its `walletId` narrows the invalidation on its own; the settlement hooks\n * take theirs from the acceptance receipt, which is the id the service\n * actually settled. Omitted, every id of the owner matches.\n */\n walletId?: bigint;\n}\n\n/**\n * Invalidate what every relayed action changes, whatever the action was.\n *\n * Two facts hold for all of them, because they are properties of the transport\n * rather than of the operation: the GaslessLayer deducts the operational fee\n * from SYMMIO collateral, and it deducts it from an allowance. So balances and\n * the payer's allowance are always stale afterwards.\n *\n * @param queryClient - The active TanStack query client.\n * @param scope - The chain-config fingerprint.\n * @param payer - The sub-account charged, when known; omitted invalidates every payer on the chain.\n *\n * @internal\n */\nfunction invalidateRelayTransportReads(queryClient: QueryClient, scope: Scope, payer?: Address): void {\n invalidateAccountBalances(queryClient, scope);\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getOperationalFeeAllowanceQueryKey, { ...scope, payer }),\n });\n}\n\n/**\n * Invalidate the reads that change when a GaslessWallet is deployed.\n *\n * A wallet deploys lazily, on the first settlement or wallet operation that\n * uses it, and from then on its creation fee reads `0n` — which also lowers the\n * deposit policy's `settlementMinimum`. Whether this action was the one that\n * deployed it is unknowable from its variables, so both reads are invalidated\n * after every such action.\n *\n * @internal\n */\nfunction invalidateGaslessWalletDeploymentReads(\n queryClient: QueryClient,\n scope: Scope,\n wallet: GaslessWalletScope,\n): void {\n const match = { ...scope, owner: wallet.owner, walletId: wallet.walletId };\n void queryClient.invalidateQueries({ predicate: predicateMatch(getGaslessDepositPolicyQueryKey, match) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getGaslessWalletCreationFeeQueryKey, match) });\n}\n\n/**\n * Invalidate the reads a relayed InstantLayer batch changed.\n *\n * Only transport-level facts: `operationType` is a free-form label the fee\n * policy ignores, so the SDK cannot know which domain reads a batch touched and\n * must not guess. Callers who know the operation pass their own `onSuccess` to\n * `mutate`, which now runs after confirmation.\n *\n * @internal\n */\nexport function invalidateRelayInstantOperationsReads(\n queryClient: QueryClient,\n scope: Scope,\n signerAccounts: readonly Address[],\n): void {\n const accounts = [...new Set(signerAccounts)];\n for (const account of accounts) {\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getInstantLayerNonceQueryKey, { ...scope, account }),\n });\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getOperationalFeeAllowanceQueryKey, { ...scope, payer: account }),\n });\n }\n invalidateAccountBalances(queryClient, scope);\n}\n\n/**\n * Invalidate the reads a relayed gasless-wallet `execute` changed.\n *\n * The wallet-operation nonce is keyed by `(owner, walletId, signerAccount)`,\n * and the operation consumed it under its signer account — which defaults to\n * the owner. The wallet's own collateral balance moves, and its address is\n * derived rather than passed, so the collateral read is invalidated chain-wide.\n * The operation may also have deployed the wallet, which zeroes its creation fee.\n *\n * @param wallet - The action's variables, forwarded whole: `owner`, `signerAccount` and `walletId`\n * scope the invalidation, and each omitted one matches every value.\n *\n * @internal\n */\nexport function invalidateGaslessWalletExecuteReads(\n queryClient: QueryClient,\n scope: Scope,\n wallet: GaslessWalletScope & { signerAccount?: Address },\n): void {\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getGaslessWalletNonceQueryKey, {\n ...scope,\n owner: wallet.owner,\n walletId: wallet.walletId,\n account: wallet.signerAccount ?? wallet.owner,\n }),\n });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, scope) });\n invalidateGaslessWalletDeploymentReads(queryClient, scope, wallet);\n invalidateRelayTransportReads(queryClient, scope);\n}\n\n/** The selector of the first function named `name` in `abi` — the same derivation the SDK's relayable-writes map uses. */\nfunction selectorOf(abi: Abi, name: string): Hex {\n const item = abi.find((entry): entry is AbiFunction => entry.type === \"function\" && entry.name === name);\n if (!item) throw new Error(`invalidate-relay-reads: the shipped ABI has no function \"${name}\".`);\n return toFunctionSelector(item);\n}\n\n/** Relayable writes that move a withdrawal request along. */\nconst WITHDRAW_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(symmioAbi as Abi, \"initiateWithdraw\"),\n selectorOf(symmioAbi as Abi, \"requestCancelWithdraw\"),\n selectorOf(symmioAbi as Abi, \"finalizeWithdrawRequest\"),\n]);\n\n/** Relayable writes that change a quote or an open position. */\nconst QUOTE_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(symmioAbi as Abi, \"requestToCancelQuote\"),\n selectorOf(symmioAbi as Abi, \"requestToCancelCloseRequest\"),\n selectorOf(symmioAbi as Abi, \"forceCancelQuote\"),\n selectorOf(symmioAbi as Abi, \"forceCancelCloseRequest\"),\n selectorOf(symmioAbi as Abi, \"forceClosePosition\"),\n]);\n\n/** Relayable writes that change an owner's sub-account list or a sub-account's details. */\nconst SUB_ACCOUNT_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(accountLayerAbi as Abi, \"createSubAccounts\"),\n selectorOf(accountLayerAbi as Abi, \"deleteSubAccount\"),\n selectorOf(accountLayerAbi as Abi, \"editAccountName\"),\n]);\n\n/** Relayable writes that pull collateral from the signer's own token balance. */\nconst DEPOSIT_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(accountLayerAbi as Abi, \"depositForAccount\"),\n selectorOf(accountLayerAbi as Abi, \"depositAndAllocateForAccount\"),\n]);\n\n/** The one relayable write that grants a delegation. */\nconst GRANT_DELEGATION = selectorOf(instantLayerAbi as Abi, \"grantDelegation\");\n\n/**\n * Invalidate the reads a relayed gasless batch changed.\n *\n * Unlike an opaque `relayInstantOperations` batch, every call of a gasless\n * batch is a known relayable write (the SDK refuses anything else), so its\n * selectors say exactly which domains moved. Each domain's reads are\n * invalidated chain-wide — the calls' own arguments name the rows, but a\n * superset is correct and a silent no-op is not.\n *\n * Always: the account's InstantLayer nonce, fee allowances and balances. Per\n * GaslessWallet entry: that wallet's nonce, collateral and deployment reads.\n *\n * @param batch - The batch's variables: its `account` and `calls`.\n *\n * @internal\n */\nexport function invalidateGaslessBatchReads(\n queryClient: QueryClient,\n scope: Scope,\n batch: { account: Address; calls: readonly GaslessBatchCall[] },\n): void {\n const selectors = new Set(getGaslessBatchSelectors(batch.calls));\n const touches = (writes: ReadonlySet<Hex>) => [...writes].some((selector) => selectors.has(selector));\n\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getInstantLayerNonceQueryKey, { ...scope, account: batch.account }),\n });\n invalidateRelayTransportReads(queryClient, scope);\n\n for (const call of batch.calls) {\n if (\"walletCalls\" in call) {\n invalidateGaslessWalletExecuteReads(queryClient, scope, {\n walletId: call.walletId ?? 0n,\n signerAccount: batch.account,\n });\n }\n }\n\n if (touches(WITHDRAW_WRITES)) {\n for (const queryKey of [\n getPendingWithdrawRequestsQueryKey,\n getLastWithdrawRequestIdQueryKey,\n getWithdrawableTimeQueryKey,\n getWithdrawRequestsQueryKey,\n ]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(QUOTE_WRITES)) {\n for (const queryKey of [\n getPartyAPendingQuotesQueryKey,\n getPendingQuotesQueryKey,\n getQuoteQueryKey,\n getPartyAOpenPositionsQueryKey,\n getQuotePendingFundingQueryKey,\n ]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(SUB_ACCOUNT_WRITES)) {\n for (const queryKey of [\n getUserSubAccountsQueryKey,\n getUserSubAccountsAddressesQueryKey,\n getSubAccountsCountOfUserQueryKey,\n getSubAccountQueryKey,\n ]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(DEPOSIT_WRITES)) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, scope) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralAllowanceQueryKey, scope) });\n }\n if (selectors.has(GRANT_DELEGATION)) {\n /** Scoped by config only: one grant covers every selector it lists, for every delegate. */\n void queryClient.invalidateQueries({ predicate: predicateMatch(getIsDelegationActiveQueryKey, scope) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getDelegationExpiryQueryKey, scope) });\n }\n}\n\n/**\n * Invalidate the reads a deposit settlement changed.\n *\n * The deposit address is swept to zero, so its collateral balance is\n * invalidated precisely when the acceptance receipt carries it. The settlement\n * deploys the wallet on its first use, which zeroes the wallet's creation fee\n * and lowers its deposit policy's `settlementMinimum`, so both are invalidated\n * for the owner's wallet.\n *\n * `depositAddress` arrives as the vendor's raw string, so a value that is not a\n * well-formed address widens to a chain-wide collateral invalidation rather\n * than scoping to nothing — a superset is correct, a silent no-op is not.\n *\n * @param options.owner - The settled wallet's owner.\n * @param options.newAccount - `true` for a new-account settlement, which also\n * refreshes the owner's sub-account lists; omit for a top-up into an existing account.\n *\n * @internal\n */\nexport function invalidateDepositSettlementReads(\n queryClient: QueryClient,\n scope: Scope,\n options: GaslessWalletScope & { depositAddress?: string; newAccount?: boolean },\n): void {\n const depositAddress =\n options.depositAddress && isAddress(options.depositAddress) ? options.depositAddress : undefined;\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getCollateralBalanceQueryKey, { ...scope, owner: depositAddress }),\n });\n if (options.newAccount && options.owner) {\n const user = { ...scope, user: options.owner };\n void queryClient.invalidateQueries({ predicate: predicateMatch(getUserSubAccountsQueryKey, user) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getUserSubAccountsAddressesQueryKey, user) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getSubAccountsCountOfUserQueryKey, user) });\n }\n invalidateGaslessWalletDeploymentReads(queryClient, scope, options);\n invalidateAccountBalances(queryClient, scope);\n}\n"],"mappings":";;;;;AAsEA,SAAS,EAA8B,GAA0B,GAAc,GAAuB;CAEpG,AADA,EAA0B,GAAa,CAAK,GAC5C,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAAoC;EAAE,GAAG;EAAO;CAAM,CAAC,EACnF,CAAC;AACH;AAaA,SAAS,EACP,GACA,GACA,GACM;CACN,IAAM,IAAQ;EAAE,GAAG;EAAO,OAAO,EAAO;EAAO,UAAU,EAAO;CAAS;CAEzE,AADA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAiC,CAAK,EAAE,CAAC,GACxG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAqC,CAAK,EAAE,CAAC;AAC9G;AAYA,SAAgB,EACd,GACA,GACA,GACM;CACN,IAAM,IAAW,CAAC,GAAG,IAAI,IAAI,CAAc,CAAC;CAC5C,KAAK,IAAM,KAAW,GAIpB,AAHA,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAA8B;EAAE,GAAG;EAAO;CAAQ,CAAC,EAC/E,CAAC,GACD,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAAoC;EAAE,GAAG;EAAO,OAAO;CAAQ,CAAC,EAC5F,CAAC;CAEH,EAA0B,GAAa,CAAK;AAC9C;AAgBA,SAAgB,EACd,GACA,GACA,GACM;CAWN,AAVA,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAA+B;EACvD,GAAG;EACH,OAAO,EAAO;EACd,UAAU,EAAO;EACjB,SAAS,E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AE,CAAC,GAClG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAqC,CAAI,EAAE,CAAC,GAC3G,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAmC,CAAI,EAAE,CAAC;CAC3G;CAEA,AADA,EAAuC,GAAa,GAAO,CAAO,GAClE,EAA0B,GAAa,CAAK;AAC9C"}
1
+ {"version":3,"file":"invalidate-relay-reads.js","names":[],"sources":["../../src/gasless/invalidate-relay-reads.ts"],"sourcesContent":["import {\n accountLayerAbi,\n getActiveDelegationsQueryKey,\n getActiveVirtualAccountByKeyQueryKey,\n getCollateralAllowanceQueryKey,\n getCollateralBalanceQueryKey,\n getDelegationExpiryQueryKey,\n getGaslessBatchSelectors,\n getGaslessDepositPolicyQueryKey,\n getGaslessWalletCreationFeeQueryKey,\n getGaslessWalletNonceQueryKey,\n getInstantLayerNonceQueryKey,\n getIsDelegationActiveQueryKey,\n getLastWithdrawRequestIdQueryKey,\n getOperationalFeeAllowanceQueryKey,\n getPartyAOpenPositionsQueryKey,\n getPartyAPendingQuotesQueryKey,\n getPendingQuotesQueryKey,\n getPendingRevocationEtasQueryKey,\n getPendingWithdrawRequestsBatchQueryKey,\n getPendingWithdrawRequestsQueryKey,\n getPredictedNextVirtualAccountQueryKey,\n getQuotePendingFundingQueryKey,\n getQuoteQueryKey,\n getSelectorTimelockQueryKey,\n getSubAccountQueryKey,\n getSubAccountVirtualNonceQueryKey,\n getSubAccountsCountOfUserQueryKey,\n getTimelockPolicyQueryKey,\n getTimelockScheduleStateQueryKey,\n getUserSubAccountsAddressesQueryKey,\n getUserSubAccountsQueryKey,\n getVirtualAccountQueryKey,\n getVirtualAccountsAddressesOfSubAccountQueryKey,\n getVirtualAccountsCountOfSubAccountQueryKey,\n getVirtualAccountsOfSubAccountQueryKey,\n getWithdrawCooldownOfQueryKey,\n getWithdrawRequestsQueryKey,\n getWithdrawableTimeQueryKey,\n instantLayerAbi,\n symmioAbi,\n type GaslessBatchCall,\n} from \"@symmio/trading-core\";\nimport type { QueryClient } from \"@tanstack/react-query\";\nimport {\n decodeFunctionData,\n encodeFunctionData,\n isAddress,\n sliceHex,\n toFunctionSelector,\n type Abi,\n type AbiFunction,\n type Address,\n type Hex,\n} from \"viem\";\nimport { invalidateAccountBalances } from \"../utils/invalidate-account-balances\";\nimport { predicateMatch } from \"../utils/predicate-match\";\n\n/** Chain-config fingerprint every invalidation is scoped by. */\ninterface Scope {\n configKey?: string;\n}\n\n/**\n * The GaslessWallet a relayed action touched, as far as its variables say.\n * Every omitted field matches all of its values — a superset is correct, a\n * silent no-op is not.\n */\ninterface GaslessWalletScope {\n /** The wallet's owner. */\n owner?: Address;\n /**\n * The wallet's id. `useGaslessWalletExecute` forwards its variables whole, so\n * its `walletId` narrows the invalidation on its own; the settlement hooks\n * take theirs from the acceptance receipt, which is the id the service\n * actually settled. Omitted, every id of the owner matches.\n */\n walletId?: bigint;\n}\n\n/**\n * Invalidate what every relayed action changes, whatever the action was.\n *\n * Two facts hold for all of them, because they are properties of the transport\n * rather than of the operation: the GaslessLayer deducts the operational fee\n * from SYMMIO collateral, and it deducts it from an allowance. So balances and\n * the payer's allowance are always stale afterwards.\n *\n * @param queryClient - The active TanStack query client.\n * @param scope - The chain-config fingerprint.\n * @param payer - The sub-account charged, when known; omitted invalidates every payer on the chain.\n *\n * @internal\n */\nfunction invalidateRelayTransportReads(queryClient: QueryClient, scope: Scope, payer?: Address): void {\n invalidateAccountBalances(queryClient, scope);\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getOperationalFeeAllowanceQueryKey, { ...scope, payer }),\n });\n}\n\n/**\n * Invalidate the reads that change when a GaslessWallet is deployed.\n *\n * A wallet deploys lazily, on the first settlement or wallet operation that\n * uses it, and from then on its creation fee reads `0n` — which also lowers the\n * deposit policy's `settlementMinimum`. Whether this action was the one that\n * deployed it is unknowable from its variables, so both reads are invalidated\n * after every such action.\n *\n * @internal\n */\nfunction invalidateGaslessWalletDeploymentReads(\n queryClient: QueryClient,\n scope: Scope,\n wallet: GaslessWalletScope,\n): void {\n const match = { ...scope, owner: wallet.owner, walletId: wallet.walletId };\n void queryClient.invalidateQueries({ predicate: predicateMatch(getGaslessDepositPolicyQueryKey, match) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getGaslessWalletCreationFeeQueryKey, match) });\n}\n\n/**\n * Invalidate the reads a relayed InstantLayer batch changed.\n *\n * Only transport-level facts: `operationType` is a free-form label the fee\n * policy ignores, so the SDK cannot know which domain reads a batch touched and\n * must not guess. Callers who know the operation pass their own `onSuccess` to\n * `mutate`, which now runs after confirmation.\n *\n * @internal\n */\nexport function invalidateRelayInstantOperationsReads(\n queryClient: QueryClient,\n scope: Scope,\n signerAccounts: readonly Address[],\n): void {\n const accounts = [...new Set(signerAccounts)];\n for (const account of accounts) {\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getInstantLayerNonceQueryKey, { ...scope, account }),\n });\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getOperationalFeeAllowanceQueryKey, { ...scope, payer: account }),\n });\n }\n invalidateAccountBalances(queryClient, scope);\n}\n\n/**\n * Invalidate the reads a relayed gasless-wallet `execute` changed.\n *\n * The wallet-operation nonce is keyed by `(owner, walletId, signerAccount)`,\n * and the operation consumed it under its signer account — which defaults to\n * the owner. The wallet's own collateral balance moves, and its address is\n * derived rather than passed, so the collateral read is invalidated chain-wide.\n * The operation may also have deployed the wallet, which zeroes its creation fee.\n *\n * @param wallet - The action's variables, forwarded whole: `owner`, `signerAccount` and `walletId`\n * scope the invalidation, and each omitted one matches every value.\n *\n * @internal\n */\nexport function invalidateGaslessWalletExecuteReads(\n queryClient: QueryClient,\n scope: Scope,\n wallet: GaslessWalletScope & { signerAccount?: Address },\n): void {\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getGaslessWalletNonceQueryKey, {\n ...scope,\n owner: wallet.owner,\n walletId: wallet.walletId,\n account: wallet.signerAccount ?? wallet.owner,\n }),\n });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, scope) });\n invalidateGaslessWalletDeploymentReads(queryClient, scope, wallet);\n invalidateRelayTransportReads(queryClient, scope);\n}\n\n/** The selector of the first function named `name` in `abi` — the same derivation the SDK's relayable-writes map uses. */\nfunction selectorOf(abi: Abi, name: string): Hex {\n const item = abi.find((entry): entry is AbiFunction => entry.type === \"function\" && entry.name === name);\n if (!item) throw new Error(`invalidate-relay-reads: the shipped ABI has no function \"${name}\".`);\n return toFunctionSelector(item);\n}\n\n/** Relayable writes that move a withdrawal request along. */\nconst WITHDRAW_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(symmioAbi as Abi, \"initiateWithdraw\"),\n selectorOf(symmioAbi as Abi, \"requestCancelWithdraw\"),\n selectorOf(symmioAbi as Abi, \"finalizeWithdrawRequest\"),\n]);\n\n/** Relayable writes that stamp the account's cooldown timestamp, which also moves its withdrawable time. */\nconst DEALLOCATE_WRITES: ReadonlySet<Hex> = new Set([selectorOf(symmioAbi as Abi, \"deallocate\")]);\n\n/** Relayable writes that change a quote or an open position. */\nconst QUOTE_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(symmioAbi as Abi, \"requestToCancelQuote\"),\n selectorOf(symmioAbi as Abi, \"requestToCancelCloseRequest\"),\n selectorOf(symmioAbi as Abi, \"forceCancelQuote\"),\n selectorOf(symmioAbi as Abi, \"forceCancelCloseRequest\"),\n selectorOf(symmioAbi as Abi, \"forceClosePosition\"),\n]);\n\n/** Relayable writes that change an owner's sub-account list or a sub-account's details. */\nconst SUB_ACCOUNT_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(accountLayerAbi as Abi, \"createSubAccounts\"),\n selectorOf(accountLayerAbi as Abi, \"deleteSubAccount\"),\n selectorOf(accountLayerAbi as Abi, \"editAccountName\"),\n selectorOf(accountLayerAbi as Abi, \"transferSubAccountOwnership\"),\n selectorOf(accountLayerAbi as Abi, \"setSingleVAMode\"),\n selectorOf(accountLayerAbi as Abi, \"createCustomVirtualAccount\"),\n]);\n\nconst VIRTUAL_ACCOUNT_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(accountLayerAbi as Abi, \"transferSubAccountOwnership\"),\n selectorOf(accountLayerAbi as Abi, \"deleteSubAccount\"),\n selectorOf(accountLayerAbi as Abi, \"setSingleVAMode\"),\n selectorOf(accountLayerAbi as Abi, \"createCustomVirtualAccount\"),\n]);\n\nconst OPERATIONAL_FEE_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(symmioAbi as Abi, \"approveOperationalFee\"),\n selectorOf(symmioAbi as Abi, \"approveOperationalFeeWithMultiplier\"),\n]);\n\n/** Relayable writes that pull collateral from the signer's own token balance. */\nconst DEPOSIT_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(accountLayerAbi as Abi, \"depositForAccount\"),\n selectorOf(accountLayerAbi as Abi, \"depositAndAllocateForAccount\"),\n]);\n\n/** Both owner-signed grant forms change permissions and clear pending revocations. */\nconst GRANT_DELEGATIONS: ReadonlySet<Hex> = new Set([\n selectorOf(instantLayerAbi as Abi, \"grantDelegation\"),\n selectorOf(instantLayerAbi as Abi, \"grantDelegations\"),\n]);\n\nconst TIMELOCK_POLICY_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(accountLayerAbi, \"setupTimelocks\"),\n selectorOf(accountLayerAbi, \"clearTimelocks\"),\n]);\nconst TIMELOCK_SCHEDULE_WRITES: ReadonlySet<Hex> = new Set([\n selectorOf(accountLayerAbi, \"scheduleTimelockOp\"),\n selectorOf(accountLayerAbi, \"cancelTimelockOp\"),\n selectorOf(accountLayerAbi, \"executeTimelockOp\"),\n]);\n\n/** Cache effects differ from delegation permissions: inspect wrapped operations too. */\nfunction batchInvalidationSelectors(calls: readonly GaslessBatchCall[]): Set<Hex> {\n const selectors = new Set(getGaslessBatchSelectors(calls));\n const pending: Hex[] = [];\n for (const call of calls) {\n if (\"data\" in call) pending.push(call.data);\n else if (\"functionName\" in call && call.functionName === \"executeTimelockOp\") {\n pending.push(\n encodeFunctionData({\n abi: (call.abi ?? accountLayerAbi) as Abi,\n functionName: call.functionName,\n args: call.args,\n }),\n );\n }\n }\n return collectOperationSelectors(pending, selectors);\n}\n\nfunction collectOperationSelectors(pending: Hex[], selectors = new Set<Hex>()): Set<Hex> {\n while (pending.length) {\n const data = pending.pop()!;\n if (data.length < 10) continue;\n selectors.add(sliceHex(data, 0, 4).toLowerCase() as Hex);\n try {\n const decoded = decodeFunctionData({ abi: accountLayerAbi, data });\n if (decoded.functionName === \"executeTimelockOp\") pending.push(decoded.args[1]);\n else if (decoded.functionName === \"_call\") pending.push(...decoded.args[1]);\n } catch {\n // Core calls are leaves. Their selector is sufficient for invalidation.\n }\n }\n return selectors;\n}\n\n/**\n * Invalidate the reads a relayed gasless batch changed.\n *\n * Unlike an opaque `relayInstantOperations` batch, every call of a gasless\n * batch is a known relayable write (the SDK refuses anything else), so its\n * selectors say exactly which domains moved. Each domain's reads are\n * invalidated chain-wide — the calls' own arguments name the rows, but a\n * superset is correct and a silent no-op is not.\n *\n * Always: the account's InstantLayer nonce, fee allowances and balances. Per\n * GaslessWallet entry: that wallet's nonce, collateral and deployment reads.\n *\n * @param batch - The batch's variables: its `account` and `calls`.\n *\n * @internal\n */\nexport function invalidateGaslessBatchReads(\n queryClient: QueryClient,\n scope: Scope,\n batch: { account: Address; calls: readonly GaslessBatchCall[] },\n): void {\n const selectors = batchInvalidationSelectors(batch.calls);\n\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getInstantLayerNonceQueryKey, { ...scope, account: batch.account }),\n });\n invalidateRelayTransportReads(queryClient, scope);\n invalidateOperationReads(queryClient, scope, selectors);\n\n for (const call of batch.calls) {\n if (\"walletCalls\" in call) {\n invalidateGaslessWalletExecuteReads(queryClient, scope, {\n walletId: call.walletId ?? 0n,\n signerAccount: batch.account,\n });\n }\n }\n}\n\n/** Refresh confirmed timelock execution effects without assuming relay transport. @internal */\nexport function invalidateTimelockExecutionReads(queryClient: QueryClient, scope: Scope, innerCallData: Hex): void {\n const selectors = collectOperationSelectors([innerCallData]);\n selectors.add(selectorOf(accountLayerAbi, \"executeTimelockOp\"));\n invalidateAccountBalances(queryClient, scope);\n invalidateOperationReads(queryClient, scope, selectors);\n}\n\n/** Domain effects shared by direct execution and gasless batches. */\nfunction invalidateOperationReads(queryClient: QueryClient, scope: Scope, selectors: ReadonlySet<Hex>): void {\n const touches = (writes: ReadonlySet<Hex>) => [...writes].some((selector) => selectors.has(selector));\n\n if (touches(TIMELOCK_POLICY_WRITES)) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(getTimelockPolicyQueryKey, scope) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getSelectorTimelockQueryKey, scope) });\n }\n if (touches(TIMELOCK_POLICY_WRITES) || touches(TIMELOCK_SCHEDULE_WRITES)) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(getTimelockScheduleStateQueryKey, scope) });\n }\n\n if (touches(WITHDRAW_WRITES)) {\n for (const queryKey of [\n getPendingWithdrawRequestsQueryKey,\n getPendingWithdrawRequestsBatchQueryKey,\n getLastWithdrawRequestIdQueryKey,\n getWithdrawableTimeQueryKey,\n getWithdrawRequestsQueryKey,\n ]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(DEALLOCATE_WRITES)) {\n for (const queryKey of [getWithdrawCooldownOfQueryKey, getWithdrawableTimeQueryKey]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(QUOTE_WRITES)) {\n for (const queryKey of [\n getPartyAPendingQuotesQueryKey,\n getPendingQuotesQueryKey,\n getQuoteQueryKey,\n getPartyAOpenPositionsQueryKey,\n getQuotePendingFundingQueryKey,\n ]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(SUB_ACCOUNT_WRITES)) {\n for (const queryKey of [\n getUserSubAccountsQueryKey,\n getUserSubAccountsAddressesQueryKey,\n getSubAccountsCountOfUserQueryKey,\n getSubAccountQueryKey,\n ]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(DEPOSIT_WRITES)) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralBalanceQueryKey, scope) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getCollateralAllowanceQueryKey, scope) });\n }\n if (touches(VIRTUAL_ACCOUNT_WRITES)) {\n for (const queryKey of [\n getVirtualAccountQueryKey,\n getVirtualAccountsOfSubAccountQueryKey,\n getVirtualAccountsAddressesOfSubAccountQueryKey,\n getVirtualAccountsCountOfSubAccountQueryKey,\n getActiveVirtualAccountByKeyQueryKey,\n getPredictedNextVirtualAccountQueryKey,\n getSubAccountVirtualNonceQueryKey,\n ]) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(queryKey, scope) });\n }\n }\n if (touches(OPERATIONAL_FEE_WRITES)) {\n void queryClient.invalidateQueries({ predicate: predicateMatch(getOperationalFeeAllowanceQueryKey, scope) });\n }\n if (touches(GRANT_DELEGATIONS)) {\n /** Scoped by config only: one grant covers every selector it lists, for every delegate. */\n void queryClient.invalidateQueries({ predicate: predicateMatch(getIsDelegationActiveQueryKey, scope) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getDelegationExpiryQueryKey, scope) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getActiveDelegationsQueryKey, scope) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getPendingRevocationEtasQueryKey, scope) });\n }\n}\n\n/**\n * Invalidate the reads a deposit settlement changed.\n *\n * The deposit address is swept to zero, so its collateral balance is\n * invalidated precisely when the acceptance receipt carries it. The settlement\n * deploys the wallet on its first use, which zeroes the wallet's creation fee\n * and lowers its deposit policy's `settlementMinimum`, so both are invalidated\n * for the owner's wallet.\n *\n * `depositAddress` arrives as the vendor's raw string, so a value that is not a\n * well-formed address widens to a chain-wide collateral invalidation rather\n * than scoping to nothing — a superset is correct, a silent no-op is not.\n *\n * @param options.owner - The settled wallet's owner.\n * @param options.newAccount - `true` for a new-account settlement, which also\n * refreshes the owner's sub-account lists; omit for a top-up into an existing account.\n *\n * @internal\n */\nexport function invalidateDepositSettlementReads(\n queryClient: QueryClient,\n scope: Scope,\n options: GaslessWalletScope & { depositAddress?: string; newAccount?: boolean },\n): void {\n const depositAddress =\n options.depositAddress && isAddress(options.depositAddress) ? options.depositAddress : undefined;\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getCollateralBalanceQueryKey, { ...scope, owner: depositAddress }),\n });\n if (options.newAccount && options.owner) {\n const user = { ...scope, user: options.owner };\n void queryClient.invalidateQueries({ predicate: predicateMatch(getUserSubAccountsQueryKey, user) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getUserSubAccountsAddressesQueryKey, user) });\n void queryClient.invalidateQueries({ predicate: predicateMatch(getSubAccountsCountOfUserQueryKey, user) });\n }\n invalidateGaslessWalletDeploymentReads(queryClient, scope, options);\n invalidateAccountBalances(queryClient, scope);\n}\n"],"mappings":";;;;;AA8FA,SAAS,EAA8B,GAA0B,GAAc,GAAuB;CAEpG,AADA,EAA0B,GAAa,CAAK,GAC5C,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAAoC;EAAE,GAAG;EAAO;CAAM,CAAC,EACnF,CAAC;AACH;AAaA,SAAS,EACP,GACA,GACA,GACM;CACN,IAAM,IAAQ;EAAE,GAAG;EAAO,OAAO,EAAO;EAAO,UAAU,EAAO;CAAS;CAEzE,AADA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAiC,CAAK,EAAE,CAAC,GACxG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAqC,CAAK,EAAE,CAAC;AAC9G;AAYA,SAAgB,EACd,GACA,GACA,GACM;CACN,IAAM,IAAW,CAAC,GAAG,IAAI,IAAI,CAAc,CAAC;CAC5C,KAAK,IAAM,KAAW,GAIpB,AAHA,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAA8B;EAAE,GAAG;EAAO;CAAQ,CAAC,EAC/E,CAAC,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AQ,cAAc,IAAI,EAAQ,iBAAiB,KAAA;CAIzF,IAHA,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAA8B;EAAE,GAAG;EAAO,OAAO;CAAe,CAAC,EAC7F,CAAC,GACG,EAAQ,cAAc,EAAQ,OAAO;EACvC,IAAM,IAAO;GAAE,GAAG;GAAO,MAAM,EAAQ;EAAM;EAG7C,AAFA,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAA4B,CAAI,EAAE,CAAC,GAClG,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAqC,CAAI,EAAE,CAAC,GAC3G,EAAiB,kBAAkB,EAAE,WAAW,EAAe,GAAmC,CAAI,EAAE,CAAC;CAC3G;CAEA,AADA,EAAuC,GAAa,GAAO,CAAO,GAClE,EAA0B,GAAa,CAAK;AAC9C"}
@@ -0,0 +1,37 @@
1
+ import { ApproveOperationalFeeAllowanceParameters } from '@symmio/trading-core';
2
+ import { UseMutationResult } from '@tanstack/react-query';
3
+ import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
+ import { AutomaticTimelockWriteParameters, WriteResult } from '../transactions/write-types.js';
5
+ /** Parameters for {@link useApproveOperationalFeeAllowance}. */
6
+ export type UseApproveOperationalFeeAllowanceParameters = AutomaticTimelockWriteParameters;
7
+ /** Mutation variables of {@link useApproveOperationalFeeAllowance}: the core action's parameters. */
8
+ export type ApproveOperationalFeeAllowanceVariables = ApproveOperationalFeeAllowanceParameters;
9
+ /** Result of {@link useApproveOperationalFeeAllowance}. */
10
+ export type ApproveOperationalFeeAllowanceResult = WriteResult;
11
+ /** Return type of {@link useApproveOperationalFeeAllowance}. */
12
+ export type UseApproveOperationalFeeAllowanceReturnType = UseMutationResult<ApproveOperationalFeeAllowanceResult, SymmioRequestError, ApproveOperationalFeeAllowanceVariables>;
13
+ /**
14
+ * Set operational-fee allowances for the gasless fee charger, as the paying
15
+ * sub-account, without touching the fee multiplier — the diamond's
16
+ * two-argument `approveOperationalFee`.
17
+ *
18
+ * Prefer {@link useApproveOperationalFee} by default. Use this one when a
19
+ * multiplier set elsewhere must survive, or when the signer is a session key
20
+ * whose delegation holds only this function's selector. Pass `gasless: true`
21
+ * (and `from` for a session key) in the variables to relay it. On success the
22
+ * allowance read is invalidated after the receipt, so
23
+ * `useOperationalFeeAllowance` reads the new value back.
24
+ *
25
+ * `amounts` are **18-decimal Core units**, and each one replaces the current
26
+ * allowance.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * import { parseUnits } from "viem";
31
+ *
32
+ * const approve = useApproveOperationalFeeAllowance();
33
+ * approve.mutate({ account: subAccount, amounts: [parseUnits("5", 18)], from: sessionKey, gasless: true });
34
+ * ```
35
+ */
36
+ export declare function useApproveOperationalFeeAllowance(parameters?: UseApproveOperationalFeeAllowanceParameters): UseApproveOperationalFeeAllowanceReturnType;
37
+ //# sourceMappingURL=use-approve-operational-fee-allowance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-approve-operational-fee-allowance.d.ts","sourceRoot":"","sources":["../../src/gasless/use-approve-operational-fee-allowance.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,wCAAwC,EAC9C,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,OAAO,KAAK,EAAE,gCAAgC,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAGjG,gEAAgE;AAChE,MAAM,MAAM,2CAA2C,GAAG,gCAAgC,CAAC;AAE3F,qGAAqG;AACrG,MAAM,MAAM,uCAAuC,GAAG,wCAAwC,CAAC;AAE/F,2DAA2D;AAC3D,MAAM,MAAM,oCAAoC,GAAG,WAAW,CAAC;AAE/D,gEAAgE;AAChE,MAAM,MAAM,2CAA2C,GAAG,iBAAiB,CACzE,oCAAoC,EACpC,kBAAkB,EAClB,uCAAuC,CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iCAAiC,CAC/C,UAAU,GAAE,2CAAgD,GAC3D,2CAA2C,CA8C7C"}
@@ -0,0 +1,48 @@
1
+ "use client";
2
+ import { useSymmioChainId as e } from "../provider/use-symmio-chain-id.js";
3
+ import { useSymmioConfig as t } from "../provider/use-symmio-config.js";
4
+ import { normalizeSymmError as n } from "../errors/normalize-symm-error.js";
5
+ import { resolveWriteResult as r } from "../transactions/resolve-write-result.js";
6
+ import { normalizeProtectedWriteError as i } from "../errors/normalize-protected-write-error.js";
7
+ import { predicateMatch as a } from "../utils/predicate-match.js";
8
+ import { useAutomaticTimelock as o } from "../account-layer/use-automatic-timelock.js";
9
+ import { approveOperationalFeeAllowanceMutationOptions as s, getOperationalFeeAllowanceQueryKey as c } from "@symmio/trading-core";
10
+ import { useMutation as l, useQueryClient as u } from "@tanstack/react-query";
11
+ //#region src/gasless/use-approve-operational-fee-allowance.ts
12
+ function d(d = {}) {
13
+ let f = t(d), p = e(), m = u(), h = o(f, d.automaticTimelock), g = s(f);
14
+ return l({
15
+ mutationKey: g.mutationKey,
16
+ mutationFn: async (e) => {
17
+ let t = e.timelock;
18
+ try {
19
+ let n = e.chainId ?? p;
20
+ t = await h(e, {
21
+ account: e.account,
22
+ chainId: n,
23
+ functionName: "approveOperationalFee",
24
+ explicit: t
25
+ });
26
+ let i = await r(f, await g.mutationFn({
27
+ ...e,
28
+ chainId: n,
29
+ ...t ? { timelock: t } : {}
30
+ }), {
31
+ chainId: n,
32
+ waitForReceipt: d.waitForReceipt,
33
+ confirmations: d.confirmations
34
+ });
35
+ return h.finish(e, i), i;
36
+ } catch (r) {
37
+ throw h.fail(e, r), t ? i(r, t) : n(r);
38
+ }
39
+ },
40
+ onSuccess: (e, t) => {
41
+ m.invalidateQueries({ predicate: a(c, { payer: t.account }) });
42
+ }
43
+ });
44
+ }
45
+ //#endregion
46
+ export { d as useApproveOperationalFeeAllowance };
47
+
48
+ //# sourceMappingURL=use-approve-operational-fee-allowance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-approve-operational-fee-allowance.js","names":[],"sources":["../../src/gasless/use-approve-operational-fee-allowance.ts"],"sourcesContent":["\"use client\";\n\nimport {\n approveOperationalFeeAllowanceMutationOptions,\n getOperationalFeeAllowanceQueryKey,\n type ApproveOperationalFeeAllowanceParameters,\n} from \"@symmio/trading-core\";\nimport { useMutation, useQueryClient, type UseMutationResult } from \"@tanstack/react-query\";\nimport { useAutomaticTimelock } from \"../account-layer/use-automatic-timelock\";\nimport { normalizeProtectedWriteError } from \"../errors/normalize-protected-write-error\";\nimport { normalizeSymmError } from \"../errors/normalize-symm-error\";\nimport type { SymmioRequestError } from \"../errors/symmio-request-error\";\nimport { useSymmioChainId } from \"../provider/use-symmio-chain-id\";\nimport { useSymmioConfig } from \"../provider/use-symmio-config\";\nimport { resolveWriteResult } from \"../transactions/resolve-write-result\";\nimport type { AutomaticTimelockWriteParameters, WriteResult } from \"../transactions/write-types\";\nimport { predicateMatch } from \"../utils/predicate-match\";\n\n/** Parameters for {@link useApproveOperationalFeeAllowance}. */\nexport type UseApproveOperationalFeeAllowanceParameters = AutomaticTimelockWriteParameters;\n\n/** Mutation variables of {@link useApproveOperationalFeeAllowance}: the core action's parameters. */\nexport type ApproveOperationalFeeAllowanceVariables = ApproveOperationalFeeAllowanceParameters;\n\n/** Result of {@link useApproveOperationalFeeAllowance}. */\nexport type ApproveOperationalFeeAllowanceResult = WriteResult;\n\n/** Return type of {@link useApproveOperationalFeeAllowance}. */\nexport type UseApproveOperationalFeeAllowanceReturnType = UseMutationResult<\n ApproveOperationalFeeAllowanceResult,\n SymmioRequestError,\n ApproveOperationalFeeAllowanceVariables\n>;\n\n/**\n * Set operational-fee allowances for the gasless fee charger, as the paying\n * sub-account, without touching the fee multiplier — the diamond's\n * two-argument `approveOperationalFee`.\n *\n * Prefer {@link useApproveOperationalFee} by default. Use this one when a\n * multiplier set elsewhere must survive, or when the signer is a session key\n * whose delegation holds only this function's selector. Pass `gasless: true`\n * (and `from` for a session key) in the variables to relay it. On success the\n * allowance read is invalidated after the receipt, so\n * `useOperationalFeeAllowance` reads the new value back.\n *\n * `amounts` are **18-decimal Core units**, and each one replaces the current\n * allowance.\n *\n * @example\n * ```tsx\n * import { parseUnits } from \"viem\";\n *\n * const approve = useApproveOperationalFeeAllowance();\n * approve.mutate({ account: subAccount, amounts: [parseUnits(\"5\", 18)], from: sessionKey, gasless: true });\n * ```\n */\nexport function useApproveOperationalFeeAllowance(\n parameters: UseApproveOperationalFeeAllowanceParameters = {},\n): UseApproveOperationalFeeAllowanceReturnType {\n const config = useSymmioConfig(parameters);\n const chainId = useSymmioChainId();\n const queryClient = useQueryClient();\n const automaticTimelock = useAutomaticTimelock(config, parameters.automaticTimelock);\n\n const base = approveOperationalFeeAllowanceMutationOptions(config);\n\n return useMutation<ApproveOperationalFeeAllowanceResult, SymmioRequestError, ApproveOperationalFeeAllowanceVariables>(\n {\n mutationKey: base.mutationKey,\n mutationFn: async (variables) => {\n let authorization = variables.timelock;\n try {\n const resolvedChainId = variables.chainId ?? chainId;\n authorization = await automaticTimelock(variables, {\n account: variables.account,\n chainId: resolvedChainId,\n functionName: \"approveOperationalFee\",\n explicit: authorization,\n });\n const hash = await base.mutationFn({\n ...variables,\n chainId: resolvedChainId,\n ...(authorization ? { timelock: authorization } : {}),\n });\n const result = resolveWriteResult(config, hash, {\n chainId: resolvedChainId,\n waitForReceipt: parameters.waitForReceipt,\n confirmations: parameters.confirmations,\n });\n const settled = await result;\n automaticTimelock.finish(variables, settled);\n return settled;\n } catch (err) {\n automaticTimelock.fail(variables, err);\n throw authorization ? normalizeProtectedWriteError(err, authorization) : normalizeSymmError(err);\n }\n },\n onSuccess: (_result, variables) => {\n void queryClient.invalidateQueries({\n predicate: predicateMatch(getOperationalFeeAllowanceQueryKey, { payer: variables.account }),\n });\n },\n },\n );\n}\n"],"mappings":";;;;;;;;;;;AAyDA,SAAgB,EACd,IAA0D,CAAC,GACd;CAC7C,IAAM,IAAS,EAAgB,CAAU,GACnC,IAAU,EAAiB,GAC3B,IAAc,EAAe,GAC7B,IAAoB,EAAqB,GAAQ,EAAW,iBAAiB,GAE7E,IAAO,EAA8C,CAAM;CAEjE,OAAO,EACL;EACE,aAAa,EAAK;EAClB,YAAY,OAAO,MAAc;GAC/B,IAAI,IAAgB,EAAU;GAC9B,IAAI;IACF,IAAM,IAAkB,EAAU,WAAW;IAC7C,IAAgB,MAAM,EAAkB,GAAW;KACjD,SAAS,EAAU;KACnB,SAAS;KACT,cAAc;KACd,UAAU;IACZ,CAAC;IAWD,IAAM,IAAU,MALD,EAAmB,GAAQ,MALvB,EAAK,WAAW;KACjC,GAAG;KACH,SAAS;KACT,GAAI,IAAgB,EAAE,UAAU,EAAc,IAAI,CAAC;IACrD,CAAC,GAC+C;KAC9C,SAAS;KACT,gBAAgB,EAAW;KAC3B,eAAe,EAAW;IAC5B,CACsB;IAEtB,OADA,EAAkB,OAAO,GAAW,CAAO,GACpC;GACT,SAAS,GAAK;IAEZ,MADA,EAAkB,KAAK,GAAW,CAAG,GAC/B,IAAgB,EAA6B,GAAK,CAAa,IAAI,EAAmB,CAAG;GACjG;EACF;EACA,YAAY,GAAS,MAAc;GACjC,EAAiB,kBAAkB,EACjC,WAAW,EAAe,GAAoC,EAAE,OAAO,EAAU,QAAQ,CAAC,EAC5F,CAAC;EACH;CACF,CACF;AACF"}
@@ -1,9 +1,9 @@
1
1
  import { ApproveOperationalFeeParameters } from '@symmio/trading-core';
2
2
  import { UseMutationResult } from '@tanstack/react-query';
3
3
  import { SymmioRequestError } from '../errors/symmio-request-error.js';
4
- import { WriteParameters, WriteResult } from '../transactions/write-types.js';
4
+ import { AutomaticTimelockWriteParameters, WriteResult } from '../transactions/write-types.js';
5
5
  /** Parameters for {@link useApproveOperationalFee}. */
6
- export type UseApproveOperationalFeeParameters = WriteParameters;
6
+ export type UseApproveOperationalFeeParameters = AutomaticTimelockWriteParameters;
7
7
  /** Mutation variables of {@link useApproveOperationalFee}: the core action's parameters. */
8
8
  export type ApproveOperationalFeeVariables = ApproveOperationalFeeParameters;
9
9
  /** Result of {@link useApproveOperationalFee}. */
@@ -1 +1 @@
1
- {"version":3,"file":"use-approve-operational-fee.d.ts","sourceRoot":"","sources":["../../src/gasless/use-approve-operational-fee.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAGhF,uDAAuD;AACvD,MAAM,MAAM,kCAAkC,GAAG,eAAe,CAAC;AAEjE,4FAA4F;AAC5F,MAAM,MAAM,8BAA8B,GAAG,+BAA+B,CAAC;AAE7E,kDAAkD;AAClD,MAAM,MAAM,2BAA2B,GAAG,WAAW,CAAC;AAEtD,uDAAuD;AACvD,MAAM,MAAM,kCAAkC,GAAG,iBAAiB,CAChE,2BAA2B,EAC3B,kBAAkB,EAClB,8BAA8B,CAC/B,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,GAAE,kCAAuC,GAClD,kCAAkC,CA4BpC"}
1
+ {"version":3,"file":"use-approve-operational-fee.d.ts","sourceRoot":"","sources":["../../src/gasless/use-approve-operational-fee.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,+BAA+B,EACrC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI5F,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAIzE,OAAO,KAAK,EAAE,gCAAgC,EAAE,WAAW,EAAE,MAAM,6BAA6B,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