@coinbase/cdp-sdk 1.29.0 → 1.30.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 (206) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/_cjs/accounts/evm/networkCapabilities.js +101 -0
  3. package/_cjs/accounts/evm/networkCapabilities.js.map +1 -1
  4. package/_cjs/accounts/evm/toEvmServerAccount.js +11 -0
  5. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  6. package/_cjs/accounts/evm/toEvmSmartAccount.js +11 -0
  7. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  8. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +10 -0
  9. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  10. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +10 -0
  11. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  12. package/_cjs/accounts/solana/toSolanaAccount.js +11 -1
  13. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
  14. package/_cjs/actions/evm/getUserOperation.js +1 -0
  15. package/_cjs/actions/evm/getUserOperation.js.map +1 -1
  16. package/_cjs/actions/evm/spend-permissions/account.use.js +33 -0
  17. package/_cjs/actions/evm/spend-permissions/account.use.js.map +1 -0
  18. package/_cjs/actions/evm/spend-permissions/smartAccount.use.js +35 -0
  19. package/_cjs/actions/evm/spend-permissions/smartAccount.use.js.map +1 -0
  20. package/_cjs/actions/evm/spend-permissions/types.js +3 -0
  21. package/_cjs/actions/evm/spend-permissions/types.js.map +1 -0
  22. package/_cjs/actions/solana/sendTransaction.js +1 -0
  23. package/_cjs/actions/solana/sendTransaction.js.map +1 -1
  24. package/_cjs/actions/solana/signTransaction.js +1 -0
  25. package/_cjs/actions/solana/signTransaction.js.map +1 -1
  26. package/_cjs/auth/hooks/axios/withAuth.js +3 -0
  27. package/_cjs/auth/hooks/axios/withAuth.js.map +1 -1
  28. package/_cjs/auth/utils/http.js +2 -1
  29. package/_cjs/auth/utils/http.js.map +1 -1
  30. package/_cjs/client/evm/evm.js +51 -1
  31. package/_cjs/client/evm/evm.js.map +1 -1
  32. package/_cjs/client/solana/solana.js.map +1 -1
  33. package/_cjs/index.js +5 -1
  34. package/_cjs/index.js.map +1 -1
  35. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +41 -3
  36. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  37. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +14 -1
  38. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  39. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +72 -1
  40. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  41. package/_cjs/openapi-client/generated/index.msw.js +2 -0
  42. package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
  43. package/_cjs/openapi-client/generated/onramp/onramp.js +30 -0
  44. package/_cjs/openapi-client/generated/onramp/onramp.js.map +1 -0
  45. package/_cjs/openapi-client/generated/onramp/onramp.msw.js +98 -0
  46. package/_cjs/openapi-client/generated/onramp/onramp.msw.js.map +1 -0
  47. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js +15 -0
  48. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -0
  49. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js +69 -0
  50. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js.map +1 -0
  51. package/_cjs/openapi-client/index.js +2 -0
  52. package/_cjs/openapi-client/index.js.map +1 -1
  53. package/_cjs/spend-permissions/constants.js +716 -0
  54. package/_cjs/spend-permissions/constants.js.map +1 -0
  55. package/_cjs/spend-permissions/types.js +3 -0
  56. package/_cjs/spend-permissions/types.js.map +1 -0
  57. package/_cjs/version.js +1 -1
  58. package/_esm/accounts/evm/networkCapabilities.js +101 -0
  59. package/_esm/accounts/evm/networkCapabilities.js.map +1 -1
  60. package/_esm/accounts/evm/toEvmServerAccount.js +11 -0
  61. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  62. package/_esm/accounts/evm/toEvmSmartAccount.js +11 -0
  63. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  64. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +10 -0
  65. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  66. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +10 -0
  67. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  68. package/_esm/accounts/solana/toSolanaAccount.js +11 -1
  69. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
  70. package/_esm/actions/evm/getUserOperation.js +1 -0
  71. package/_esm/actions/evm/getUserOperation.js.map +1 -1
  72. package/_esm/actions/evm/spend-permissions/account.use.js +30 -0
  73. package/_esm/actions/evm/spend-permissions/account.use.js.map +1 -0
  74. package/_esm/actions/evm/spend-permissions/smartAccount.use.js +32 -0
  75. package/_esm/actions/evm/spend-permissions/smartAccount.use.js.map +1 -0
  76. package/_esm/actions/evm/spend-permissions/types.js +2 -0
  77. package/_esm/actions/evm/spend-permissions/types.js.map +1 -0
  78. package/_esm/actions/solana/sendTransaction.js +1 -0
  79. package/_esm/actions/solana/sendTransaction.js.map +1 -1
  80. package/_esm/actions/solana/signTransaction.js +1 -0
  81. package/_esm/actions/solana/signTransaction.js.map +1 -1
  82. package/_esm/auth/hooks/axios/withAuth.js +3 -0
  83. package/_esm/auth/hooks/axios/withAuth.js.map +1 -1
  84. package/_esm/auth/utils/http.js +2 -1
  85. package/_esm/auth/utils/http.js.map +1 -1
  86. package/_esm/client/evm/evm.js +51 -1
  87. package/_esm/client/evm/evm.js.map +1 -1
  88. package/_esm/client/solana/solana.js +2 -2
  89. package/_esm/client/solana/solana.js.map +1 -1
  90. package/_esm/index.js +2 -1
  91. package/_esm/index.js.map +1 -1
  92. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +39 -1
  93. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  94. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +12 -0
  95. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  96. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +69 -0
  97. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  98. package/_esm/openapi-client/generated/index.msw.js +2 -0
  99. package/_esm/openapi-client/generated/index.msw.js.map +1 -1
  100. package/_esm/openapi-client/generated/onramp/onramp.js +25 -0
  101. package/_esm/openapi-client/generated/onramp/onramp.js.map +1 -0
  102. package/_esm/openapi-client/generated/onramp/onramp.msw.js +90 -0
  103. package/_esm/openapi-client/generated/onramp/onramp.msw.js.map +1 -0
  104. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js +11 -0
  105. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -0
  106. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js +63 -0
  107. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js.map +1 -0
  108. package/_esm/openapi-client/index.js +2 -0
  109. package/_esm/openapi-client/index.js.map +1 -1
  110. package/_esm/spend-permissions/constants.js +713 -0
  111. package/_esm/spend-permissions/constants.js.map +1 -0
  112. package/_esm/spend-permissions/types.js +2 -0
  113. package/_esm/spend-permissions/types.js.map +1 -0
  114. package/_esm/version.js +1 -1
  115. package/_types/accounts/evm/networkCapabilities.d.ts +101 -0
  116. package/_types/accounts/evm/networkCapabilities.d.ts.map +1 -1
  117. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  118. package/_types/accounts/evm/toEvmSmartAccount.d.ts +1 -1
  119. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  120. package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
  121. package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
  122. package/_types/accounts/evm/types.d.ts +6 -0
  123. package/_types/accounts/evm/types.d.ts.map +1 -1
  124. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
  125. package/_types/actions/evm/getUserOperation.d.ts.map +1 -1
  126. package/_types/actions/evm/spend-permissions/account.use.d.ts +15 -0
  127. package/_types/actions/evm/spend-permissions/account.use.d.ts.map +1 -0
  128. package/_types/actions/evm/spend-permissions/smartAccount.use.d.ts +15 -0
  129. package/_types/actions/evm/spend-permissions/smartAccount.use.d.ts.map +1 -0
  130. package/_types/actions/evm/spend-permissions/types.d.ts +13 -0
  131. package/_types/actions/evm/spend-permissions/types.d.ts.map +1 -0
  132. package/_types/actions/evm/types.d.ts +75 -0
  133. package/_types/actions/evm/types.d.ts.map +1 -1
  134. package/_types/actions/solana/sendTransaction.d.ts +8 -2
  135. package/_types/actions/solana/sendTransaction.d.ts.map +1 -1
  136. package/_types/actions/solana/signTransaction.d.ts +8 -2
  137. package/_types/actions/solana/signTransaction.d.ts.map +1 -1
  138. package/_types/actions/solana/types.d.ts +38 -3
  139. package/_types/actions/solana/types.d.ts.map +1 -1
  140. package/_types/auth/hooks/axios/withAuth.d.ts.map +1 -1
  141. package/_types/auth/utils/http.d.ts.map +1 -1
  142. package/_types/client/evm/evm.d.ts +19 -1
  143. package/_types/client/evm/evm.d.ts.map +1 -1
  144. package/_types/client/evm/evm.types.d.ts +29 -2
  145. package/_types/client/evm/evm.types.d.ts.map +1 -1
  146. package/_types/client/solana/solana.d.ts +5 -3
  147. package/_types/client/solana/solana.d.ts.map +1 -1
  148. package/_types/index.d.ts +3 -1
  149. package/_types/index.d.ts.map +1 -1
  150. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +333 -1
  151. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  152. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +7 -1
  153. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
  154. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts +2 -0
  155. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -1
  156. package/_types/openapi-client/generated/index.msw.d.ts +2 -0
  157. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
  158. package/_types/openapi-client/generated/onramp/onramp.d.ts +28 -0
  159. package/_types/openapi-client/generated/onramp/onramp.d.ts.map +1 -0
  160. package/_types/openapi-client/generated/onramp/onramp.msw.d.ts +8 -0
  161. package/_types/openapi-client/generated/onramp/onramp.msw.d.ts.map +1 -0
  162. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts +20 -0
  163. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts.map +1 -0
  164. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.msw.d.ts +6 -0
  165. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.msw.d.ts.map +1 -0
  166. package/_types/openapi-client/index.d.ts +4 -0
  167. package/_types/openapi-client/index.d.ts.map +1 -1
  168. package/_types/spend-permissions/constants.d.ts +1357 -0
  169. package/_types/spend-permissions/constants.d.ts.map +1 -0
  170. package/_types/spend-permissions/types.d.ts +30 -0
  171. package/_types/spend-permissions/types.d.ts.map +1 -0
  172. package/_types/version.d.ts +1 -1
  173. package/accounts/evm/networkCapabilities.ts +101 -0
  174. package/accounts/evm/toEvmServerAccount.ts +15 -0
  175. package/accounts/evm/toEvmSmartAccount.ts +19 -4
  176. package/accounts/evm/toNetworkScopedEvmServerAccount.ts +15 -0
  177. package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +15 -0
  178. package/accounts/evm/types.ts +18 -0
  179. package/accounts/solana/toSolanaAccount.ts +17 -3
  180. package/actions/evm/getUserOperation.ts +1 -0
  181. package/actions/evm/spend-permissions/account.use.ts +48 -0
  182. package/actions/evm/spend-permissions/smartAccount.use.ts +49 -0
  183. package/actions/evm/spend-permissions/types.ts +13 -0
  184. package/actions/evm/types.ts +81 -0
  185. package/actions/solana/sendTransaction.ts +10 -2
  186. package/actions/solana/signTransaction.ts +10 -2
  187. package/actions/solana/types.ts +44 -2
  188. package/auth/hooks/axios/withAuth.ts +3 -0
  189. package/auth/utils/http.ts +2 -1
  190. package/client/evm/evm.ts +61 -1
  191. package/client/evm/evm.types.ts +31 -0
  192. package/client/solana/solana.ts +10 -5
  193. package/index.ts +6 -1
  194. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +375 -1
  195. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +85 -0
  196. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +23 -0
  197. package/openapi-client/generated/index.msw.ts +2 -0
  198. package/openapi-client/generated/onramp/onramp.msw.ts +135 -0
  199. package/openapi-client/generated/onramp/onramp.ts +54 -0
  200. package/openapi-client/generated/x402-facilitator/x402-facilitator.msw.ts +85 -0
  201. package/openapi-client/generated/x402-facilitator/x402-facilitator.ts +34 -0
  202. package/openapi-client/index.ts +2 -0
  203. package/package.json +1 -1
  204. package/spend-permissions/constants.ts +713 -0
  205. package/spend-permissions/types.ts +42 -0
  206. package/version.ts +1 -1
@@ -0,0 +1,713 @@
1
+ export const SPEND_PERMISSION_MANAGER_ADDRESS = "0xf85210B21cC50302F477BA56686d2019dC9b67Ad";
2
+
3
+ export const SPEND_PERMISSION_MANAGER_ABI = [
4
+ {
5
+ inputs: [
6
+ {
7
+ internalType: "contract PublicERC6492Validator",
8
+ name: "publicERC6492Validator",
9
+ type: "address",
10
+ },
11
+ { internalType: "address", name: "magicSpend", type: "address" },
12
+ ],
13
+ stateMutability: "nonpayable",
14
+ type: "constructor",
15
+ },
16
+ {
17
+ inputs: [
18
+ { internalType: "uint48", name: "currentTimestamp", type: "uint48" },
19
+ { internalType: "uint48", name: "end", type: "uint48" },
20
+ ],
21
+ name: "AfterSpendPermissionEnd",
22
+ type: "error",
23
+ },
24
+ {
25
+ inputs: [
26
+ { internalType: "uint48", name: "currentTimestamp", type: "uint48" },
27
+ { internalType: "uint48", name: "start", type: "uint48" },
28
+ ],
29
+ name: "BeforeSpendPermissionStart",
30
+ type: "error",
31
+ },
32
+ {
33
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
34
+ name: "ERC721TokenNotSupported",
35
+ type: "error",
36
+ },
37
+ { inputs: [], name: "EmptySpendPermissionBatch", type: "error" },
38
+ {
39
+ inputs: [
40
+ { internalType: "uint256", name: "value", type: "uint256" },
41
+ { internalType: "uint256", name: "allowance", type: "uint256" },
42
+ ],
43
+ name: "ExceededSpendPermission",
44
+ type: "error",
45
+ },
46
+ {
47
+ inputs: [
48
+ {
49
+ components: [
50
+ { internalType: "uint48", name: "start", type: "uint48" },
51
+ { internalType: "uint48", name: "end", type: "uint48" },
52
+ { internalType: "uint160", name: "spend", type: "uint160" },
53
+ ],
54
+ internalType: "struct SpendPermissionManager.PeriodSpend",
55
+ name: "actualLastUpdatedPeriod",
56
+ type: "tuple",
57
+ },
58
+ {
59
+ components: [
60
+ { internalType: "uint48", name: "start", type: "uint48" },
61
+ { internalType: "uint48", name: "end", type: "uint48" },
62
+ { internalType: "uint160", name: "spend", type: "uint160" },
63
+ ],
64
+ internalType: "struct SpendPermissionManager.PeriodSpend",
65
+ name: "expectedLastUpdatedPeriod",
66
+ type: "tuple",
67
+ },
68
+ ],
69
+ name: "InvalidLastUpdatedPeriod",
70
+ type: "error",
71
+ },
72
+ {
73
+ inputs: [
74
+ { internalType: "address", name: "sender", type: "address" },
75
+ { internalType: "address", name: "expected", type: "address" },
76
+ ],
77
+ name: "InvalidSender",
78
+ type: "error",
79
+ },
80
+ { inputs: [], name: "InvalidSignature", type: "error" },
81
+ {
82
+ inputs: [
83
+ { internalType: "uint48", name: "start", type: "uint48" },
84
+ { internalType: "uint48", name: "end", type: "uint48" },
85
+ ],
86
+ name: "InvalidStartEnd",
87
+ type: "error",
88
+ },
89
+ {
90
+ inputs: [
91
+ { internalType: "uint128", name: "noncePostfix", type: "uint128" },
92
+ { internalType: "uint128", name: "permissionHashPostfix", type: "uint128" },
93
+ ],
94
+ name: "InvalidWithdrawRequestNonce",
95
+ type: "error",
96
+ },
97
+ {
98
+ inputs: [
99
+ { internalType: "address", name: "firstAccount", type: "address" },
100
+ { internalType: "address", name: "secondAccount", type: "address" },
101
+ ],
102
+ name: "MismatchedAccounts",
103
+ type: "error",
104
+ },
105
+ {
106
+ inputs: [{ internalType: "address", name: "token", type: "address" }],
107
+ name: "SafeERC20FailedOperation",
108
+ type: "error",
109
+ },
110
+ {
111
+ inputs: [
112
+ { internalType: "address", name: "spendToken", type: "address" },
113
+ { internalType: "address", name: "withdrawAsset", type: "address" },
114
+ ],
115
+ name: "SpendTokenWithdrawAssetMismatch",
116
+ type: "error",
117
+ },
118
+ {
119
+ inputs: [{ internalType: "uint256", name: "value", type: "uint256" }],
120
+ name: "SpendValueOverflow",
121
+ type: "error",
122
+ },
123
+ {
124
+ inputs: [
125
+ { internalType: "uint256", name: "spendValue", type: "uint256" },
126
+ { internalType: "uint256", name: "withdrawAmount", type: "uint256" },
127
+ ],
128
+ name: "SpendValueWithdrawAmountMismatch",
129
+ type: "error",
130
+ },
131
+ { inputs: [], name: "UnauthorizedSpendPermission", type: "error" },
132
+ {
133
+ inputs: [
134
+ { internalType: "uint256", name: "received", type: "uint256" },
135
+ { internalType: "uint256", name: "expected", type: "uint256" },
136
+ ],
137
+ name: "UnexpectedReceiveAmount",
138
+ type: "error",
139
+ },
140
+ { inputs: [], name: "ZeroAllowance", type: "error" },
141
+ { inputs: [], name: "ZeroPeriod", type: "error" },
142
+ { inputs: [], name: "ZeroSpender", type: "error" },
143
+ { inputs: [], name: "ZeroToken", type: "error" },
144
+ { inputs: [], name: "ZeroValue", type: "error" },
145
+ {
146
+ anonymous: false,
147
+ inputs: [
148
+ { indexed: true, internalType: "bytes32", name: "hash", type: "bytes32" },
149
+ {
150
+ components: [
151
+ { internalType: "address", name: "account", type: "address" },
152
+ { internalType: "address", name: "spender", type: "address" },
153
+ { internalType: "address", name: "token", type: "address" },
154
+ { internalType: "uint160", name: "allowance", type: "uint160" },
155
+ { internalType: "uint48", name: "period", type: "uint48" },
156
+ { internalType: "uint48", name: "start", type: "uint48" },
157
+ { internalType: "uint48", name: "end", type: "uint48" },
158
+ { internalType: "uint256", name: "salt", type: "uint256" },
159
+ { internalType: "bytes", name: "extraData", type: "bytes" },
160
+ ],
161
+ indexed: false,
162
+ internalType: "struct SpendPermissionManager.SpendPermission",
163
+ name: "spendPermission",
164
+ type: "tuple",
165
+ },
166
+ ],
167
+ name: "SpendPermissionApproved",
168
+ type: "event",
169
+ },
170
+ {
171
+ anonymous: false,
172
+ inputs: [
173
+ { indexed: true, internalType: "bytes32", name: "hash", type: "bytes32" },
174
+ {
175
+ components: [
176
+ { internalType: "address", name: "account", type: "address" },
177
+ { internalType: "address", name: "spender", type: "address" },
178
+ { internalType: "address", name: "token", type: "address" },
179
+ { internalType: "uint160", name: "allowance", type: "uint160" },
180
+ { internalType: "uint48", name: "period", type: "uint48" },
181
+ { internalType: "uint48", name: "start", type: "uint48" },
182
+ { internalType: "uint48", name: "end", type: "uint48" },
183
+ { internalType: "uint256", name: "salt", type: "uint256" },
184
+ { internalType: "bytes", name: "extraData", type: "bytes" },
185
+ ],
186
+ indexed: false,
187
+ internalType: "struct SpendPermissionManager.SpendPermission",
188
+ name: "spendPermission",
189
+ type: "tuple",
190
+ },
191
+ ],
192
+ name: "SpendPermissionRevoked",
193
+ type: "event",
194
+ },
195
+ {
196
+ anonymous: false,
197
+ inputs: [
198
+ { indexed: true, internalType: "bytes32", name: "hash", type: "bytes32" },
199
+ { indexed: true, internalType: "address", name: "account", type: "address" },
200
+ { indexed: true, internalType: "address", name: "spender", type: "address" },
201
+ { indexed: false, internalType: "address", name: "token", type: "address" },
202
+ {
203
+ components: [
204
+ { internalType: "uint48", name: "start", type: "uint48" },
205
+ { internalType: "uint48", name: "end", type: "uint48" },
206
+ { internalType: "uint160", name: "spend", type: "uint160" },
207
+ ],
208
+ indexed: false,
209
+ internalType: "struct SpendPermissionManager.PeriodSpend",
210
+ name: "periodSpend",
211
+ type: "tuple",
212
+ },
213
+ ],
214
+ name: "SpendPermissionUsed",
215
+ type: "event",
216
+ },
217
+ {
218
+ inputs: [],
219
+ name: "MAGIC_SPEND",
220
+ outputs: [{ internalType: "address", name: "", type: "address" }],
221
+ stateMutability: "view",
222
+ type: "function",
223
+ },
224
+ {
225
+ inputs: [],
226
+ name: "NATIVE_TOKEN",
227
+ outputs: [{ internalType: "address", name: "", type: "address" }],
228
+ stateMutability: "view",
229
+ type: "function",
230
+ },
231
+ {
232
+ inputs: [],
233
+ name: "PERMISSION_DETAILS_TYPEHASH",
234
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
235
+ stateMutability: "view",
236
+ type: "function",
237
+ },
238
+ {
239
+ inputs: [],
240
+ name: "PUBLIC_ERC6492_VALIDATOR",
241
+ outputs: [{ internalType: "contract PublicERC6492Validator", name: "", type: "address" }],
242
+ stateMutability: "view",
243
+ type: "function",
244
+ },
245
+ {
246
+ inputs: [],
247
+ name: "SPEND_PERMISSION_BATCH_TYPEHASH",
248
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
249
+ stateMutability: "view",
250
+ type: "function",
251
+ },
252
+ {
253
+ inputs: [],
254
+ name: "SPEND_PERMISSION_TYPEHASH",
255
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
256
+ stateMutability: "view",
257
+ type: "function",
258
+ },
259
+ {
260
+ inputs: [
261
+ {
262
+ components: [
263
+ { internalType: "address", name: "account", type: "address" },
264
+ { internalType: "address", name: "spender", type: "address" },
265
+ { internalType: "address", name: "token", type: "address" },
266
+ { internalType: "uint160", name: "allowance", type: "uint160" },
267
+ { internalType: "uint48", name: "period", type: "uint48" },
268
+ { internalType: "uint48", name: "start", type: "uint48" },
269
+ { internalType: "uint48", name: "end", type: "uint48" },
270
+ { internalType: "uint256", name: "salt", type: "uint256" },
271
+ { internalType: "bytes", name: "extraData", type: "bytes" },
272
+ ],
273
+ internalType: "struct SpendPermissionManager.SpendPermission",
274
+ name: "spendPermission",
275
+ type: "tuple",
276
+ },
277
+ ],
278
+ name: "approve",
279
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
280
+ stateMutability: "nonpayable",
281
+ type: "function",
282
+ },
283
+ {
284
+ inputs: [
285
+ {
286
+ components: [
287
+ { internalType: "address", name: "account", type: "address" },
288
+ { internalType: "uint48", name: "period", type: "uint48" },
289
+ { internalType: "uint48", name: "start", type: "uint48" },
290
+ { internalType: "uint48", name: "end", type: "uint48" },
291
+ {
292
+ components: [
293
+ { internalType: "address", name: "spender", type: "address" },
294
+ { internalType: "address", name: "token", type: "address" },
295
+ { internalType: "uint160", name: "allowance", type: "uint160" },
296
+ { internalType: "uint256", name: "salt", type: "uint256" },
297
+ { internalType: "bytes", name: "extraData", type: "bytes" },
298
+ ],
299
+ internalType: "struct SpendPermissionManager.PermissionDetails[]",
300
+ name: "permissions",
301
+ type: "tuple[]",
302
+ },
303
+ ],
304
+ internalType: "struct SpendPermissionManager.SpendPermissionBatch",
305
+ name: "spendPermissionBatch",
306
+ type: "tuple",
307
+ },
308
+ { internalType: "bytes", name: "signature", type: "bytes" },
309
+ ],
310
+ name: "approveBatchWithSignature",
311
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
312
+ stateMutability: "nonpayable",
313
+ type: "function",
314
+ },
315
+ {
316
+ inputs: [
317
+ {
318
+ components: [
319
+ { internalType: "address", name: "account", type: "address" },
320
+ { internalType: "address", name: "spender", type: "address" },
321
+ { internalType: "address", name: "token", type: "address" },
322
+ { internalType: "uint160", name: "allowance", type: "uint160" },
323
+ { internalType: "uint48", name: "period", type: "uint48" },
324
+ { internalType: "uint48", name: "start", type: "uint48" },
325
+ { internalType: "uint48", name: "end", type: "uint48" },
326
+ { internalType: "uint256", name: "salt", type: "uint256" },
327
+ { internalType: "bytes", name: "extraData", type: "bytes" },
328
+ ],
329
+ internalType: "struct SpendPermissionManager.SpendPermission",
330
+ name: "permissionToApprove",
331
+ type: "tuple",
332
+ },
333
+ {
334
+ components: [
335
+ { internalType: "address", name: "account", type: "address" },
336
+ { internalType: "address", name: "spender", type: "address" },
337
+ { internalType: "address", name: "token", type: "address" },
338
+ { internalType: "uint160", name: "allowance", type: "uint160" },
339
+ { internalType: "uint48", name: "period", type: "uint48" },
340
+ { internalType: "uint48", name: "start", type: "uint48" },
341
+ { internalType: "uint48", name: "end", type: "uint48" },
342
+ { internalType: "uint256", name: "salt", type: "uint256" },
343
+ { internalType: "bytes", name: "extraData", type: "bytes" },
344
+ ],
345
+ internalType: "struct SpendPermissionManager.SpendPermission",
346
+ name: "permissionToRevoke",
347
+ type: "tuple",
348
+ },
349
+ {
350
+ components: [
351
+ { internalType: "uint48", name: "start", type: "uint48" },
352
+ { internalType: "uint48", name: "end", type: "uint48" },
353
+ { internalType: "uint160", name: "spend", type: "uint160" },
354
+ ],
355
+ internalType: "struct SpendPermissionManager.PeriodSpend",
356
+ name: "expectedLastUpdatedPeriod",
357
+ type: "tuple",
358
+ },
359
+ ],
360
+ name: "approveWithRevoke",
361
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
362
+ stateMutability: "nonpayable",
363
+ type: "function",
364
+ },
365
+ {
366
+ inputs: [
367
+ {
368
+ components: [
369
+ { internalType: "address", name: "account", type: "address" },
370
+ { internalType: "address", name: "spender", type: "address" },
371
+ { internalType: "address", name: "token", type: "address" },
372
+ { internalType: "uint160", name: "allowance", type: "uint160" },
373
+ { internalType: "uint48", name: "period", type: "uint48" },
374
+ { internalType: "uint48", name: "start", type: "uint48" },
375
+ { internalType: "uint48", name: "end", type: "uint48" },
376
+ { internalType: "uint256", name: "salt", type: "uint256" },
377
+ { internalType: "bytes", name: "extraData", type: "bytes" },
378
+ ],
379
+ internalType: "struct SpendPermissionManager.SpendPermission",
380
+ name: "spendPermission",
381
+ type: "tuple",
382
+ },
383
+ { internalType: "bytes", name: "signature", type: "bytes" },
384
+ ],
385
+ name: "approveWithSignature",
386
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
387
+ stateMutability: "nonpayable",
388
+ type: "function",
389
+ },
390
+ {
391
+ inputs: [],
392
+ name: "eip712Domain",
393
+ outputs: [
394
+ { internalType: "bytes1", name: "fields", type: "bytes1" },
395
+ { internalType: "string", name: "name", type: "string" },
396
+ { internalType: "string", name: "version", type: "string" },
397
+ { internalType: "uint256", name: "chainId", type: "uint256" },
398
+ { internalType: "address", name: "verifyingContract", type: "address" },
399
+ { internalType: "bytes32", name: "salt", type: "bytes32" },
400
+ { internalType: "uint256[]", name: "extensions", type: "uint256[]" },
401
+ ],
402
+ stateMutability: "view",
403
+ type: "function",
404
+ },
405
+ {
406
+ inputs: [
407
+ {
408
+ components: [
409
+ { internalType: "address", name: "account", type: "address" },
410
+ { internalType: "uint48", name: "period", type: "uint48" },
411
+ { internalType: "uint48", name: "start", type: "uint48" },
412
+ { internalType: "uint48", name: "end", type: "uint48" },
413
+ {
414
+ components: [
415
+ { internalType: "address", name: "spender", type: "address" },
416
+ { internalType: "address", name: "token", type: "address" },
417
+ { internalType: "uint160", name: "allowance", type: "uint160" },
418
+ { internalType: "uint256", name: "salt", type: "uint256" },
419
+ { internalType: "bytes", name: "extraData", type: "bytes" },
420
+ ],
421
+ internalType: "struct SpendPermissionManager.PermissionDetails[]",
422
+ name: "permissions",
423
+ type: "tuple[]",
424
+ },
425
+ ],
426
+ internalType: "struct SpendPermissionManager.SpendPermissionBatch",
427
+ name: "spendPermissionBatch",
428
+ type: "tuple",
429
+ },
430
+ ],
431
+ name: "getBatchHash",
432
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
433
+ stateMutability: "view",
434
+ type: "function",
435
+ },
436
+ {
437
+ inputs: [
438
+ {
439
+ components: [
440
+ { internalType: "address", name: "account", type: "address" },
441
+ { internalType: "address", name: "spender", type: "address" },
442
+ { internalType: "address", name: "token", type: "address" },
443
+ { internalType: "uint160", name: "allowance", type: "uint160" },
444
+ { internalType: "uint48", name: "period", type: "uint48" },
445
+ { internalType: "uint48", name: "start", type: "uint48" },
446
+ { internalType: "uint48", name: "end", type: "uint48" },
447
+ { internalType: "uint256", name: "salt", type: "uint256" },
448
+ { internalType: "bytes", name: "extraData", type: "bytes" },
449
+ ],
450
+ internalType: "struct SpendPermissionManager.SpendPermission",
451
+ name: "spendPermission",
452
+ type: "tuple",
453
+ },
454
+ ],
455
+ name: "getCurrentPeriod",
456
+ outputs: [
457
+ {
458
+ components: [
459
+ { internalType: "uint48", name: "start", type: "uint48" },
460
+ { internalType: "uint48", name: "end", type: "uint48" },
461
+ { internalType: "uint160", name: "spend", type: "uint160" },
462
+ ],
463
+ internalType: "struct SpendPermissionManager.PeriodSpend",
464
+ name: "",
465
+ type: "tuple",
466
+ },
467
+ ],
468
+ stateMutability: "view",
469
+ type: "function",
470
+ },
471
+ {
472
+ inputs: [
473
+ {
474
+ components: [
475
+ { internalType: "address", name: "account", type: "address" },
476
+ { internalType: "address", name: "spender", type: "address" },
477
+ { internalType: "address", name: "token", type: "address" },
478
+ { internalType: "uint160", name: "allowance", type: "uint160" },
479
+ { internalType: "uint48", name: "period", type: "uint48" },
480
+ { internalType: "uint48", name: "start", type: "uint48" },
481
+ { internalType: "uint48", name: "end", type: "uint48" },
482
+ { internalType: "uint256", name: "salt", type: "uint256" },
483
+ { internalType: "bytes", name: "extraData", type: "bytes" },
484
+ ],
485
+ internalType: "struct SpendPermissionManager.SpendPermission",
486
+ name: "spendPermission",
487
+ type: "tuple",
488
+ },
489
+ ],
490
+ name: "getHash",
491
+ outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
492
+ stateMutability: "view",
493
+ type: "function",
494
+ },
495
+ {
496
+ inputs: [
497
+ {
498
+ components: [
499
+ { internalType: "address", name: "account", type: "address" },
500
+ { internalType: "address", name: "spender", type: "address" },
501
+ { internalType: "address", name: "token", type: "address" },
502
+ { internalType: "uint160", name: "allowance", type: "uint160" },
503
+ { internalType: "uint48", name: "period", type: "uint48" },
504
+ { internalType: "uint48", name: "start", type: "uint48" },
505
+ { internalType: "uint48", name: "end", type: "uint48" },
506
+ { internalType: "uint256", name: "salt", type: "uint256" },
507
+ { internalType: "bytes", name: "extraData", type: "bytes" },
508
+ ],
509
+ internalType: "struct SpendPermissionManager.SpendPermission",
510
+ name: "spendPermission",
511
+ type: "tuple",
512
+ },
513
+ ],
514
+ name: "getLastUpdatedPeriod",
515
+ outputs: [
516
+ {
517
+ components: [
518
+ { internalType: "uint48", name: "start", type: "uint48" },
519
+ { internalType: "uint48", name: "end", type: "uint48" },
520
+ { internalType: "uint160", name: "spend", type: "uint160" },
521
+ ],
522
+ internalType: "struct SpendPermissionManager.PeriodSpend",
523
+ name: "",
524
+ type: "tuple",
525
+ },
526
+ ],
527
+ stateMutability: "view",
528
+ type: "function",
529
+ },
530
+ {
531
+ inputs: [
532
+ {
533
+ components: [
534
+ { internalType: "address", name: "account", type: "address" },
535
+ { internalType: "address", name: "spender", type: "address" },
536
+ { internalType: "address", name: "token", type: "address" },
537
+ { internalType: "uint160", name: "allowance", type: "uint160" },
538
+ { internalType: "uint48", name: "period", type: "uint48" },
539
+ { internalType: "uint48", name: "start", type: "uint48" },
540
+ { internalType: "uint48", name: "end", type: "uint48" },
541
+ { internalType: "uint256", name: "salt", type: "uint256" },
542
+ { internalType: "bytes", name: "extraData", type: "bytes" },
543
+ ],
544
+ internalType: "struct SpendPermissionManager.SpendPermission",
545
+ name: "spendPermission",
546
+ type: "tuple",
547
+ },
548
+ ],
549
+ name: "isApproved",
550
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
551
+ stateMutability: "view",
552
+ type: "function",
553
+ },
554
+ {
555
+ inputs: [
556
+ {
557
+ components: [
558
+ { internalType: "address", name: "account", type: "address" },
559
+ { internalType: "address", name: "spender", type: "address" },
560
+ { internalType: "address", name: "token", type: "address" },
561
+ { internalType: "uint160", name: "allowance", type: "uint160" },
562
+ { internalType: "uint48", name: "period", type: "uint48" },
563
+ { internalType: "uint48", name: "start", type: "uint48" },
564
+ { internalType: "uint48", name: "end", type: "uint48" },
565
+ { internalType: "uint256", name: "salt", type: "uint256" },
566
+ { internalType: "bytes", name: "extraData", type: "bytes" },
567
+ ],
568
+ internalType: "struct SpendPermissionManager.SpendPermission",
569
+ name: "spendPermission",
570
+ type: "tuple",
571
+ },
572
+ ],
573
+ name: "isRevoked",
574
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
575
+ stateMutability: "view",
576
+ type: "function",
577
+ },
578
+ {
579
+ inputs: [
580
+ {
581
+ components: [
582
+ { internalType: "address", name: "account", type: "address" },
583
+ { internalType: "address", name: "spender", type: "address" },
584
+ { internalType: "address", name: "token", type: "address" },
585
+ { internalType: "uint160", name: "allowance", type: "uint160" },
586
+ { internalType: "uint48", name: "period", type: "uint48" },
587
+ { internalType: "uint48", name: "start", type: "uint48" },
588
+ { internalType: "uint48", name: "end", type: "uint48" },
589
+ { internalType: "uint256", name: "salt", type: "uint256" },
590
+ { internalType: "bytes", name: "extraData", type: "bytes" },
591
+ ],
592
+ internalType: "struct SpendPermissionManager.SpendPermission",
593
+ name: "spendPermission",
594
+ type: "tuple",
595
+ },
596
+ ],
597
+ name: "isValid",
598
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
599
+ stateMutability: "view",
600
+ type: "function",
601
+ },
602
+ {
603
+ inputs: [
604
+ {
605
+ components: [
606
+ { internalType: "address", name: "account", type: "address" },
607
+ { internalType: "address", name: "spender", type: "address" },
608
+ { internalType: "address", name: "token", type: "address" },
609
+ { internalType: "uint160", name: "allowance", type: "uint160" },
610
+ { internalType: "uint48", name: "period", type: "uint48" },
611
+ { internalType: "uint48", name: "start", type: "uint48" },
612
+ { internalType: "uint48", name: "end", type: "uint48" },
613
+ { internalType: "uint256", name: "salt", type: "uint256" },
614
+ { internalType: "bytes", name: "extraData", type: "bytes" },
615
+ ],
616
+ internalType: "struct SpendPermissionManager.SpendPermission",
617
+ name: "spendPermission",
618
+ type: "tuple",
619
+ },
620
+ ],
621
+ name: "revoke",
622
+ outputs: [],
623
+ stateMutability: "nonpayable",
624
+ type: "function",
625
+ },
626
+ {
627
+ inputs: [
628
+ {
629
+ components: [
630
+ { internalType: "address", name: "account", type: "address" },
631
+ { internalType: "address", name: "spender", type: "address" },
632
+ { internalType: "address", name: "token", type: "address" },
633
+ { internalType: "uint160", name: "allowance", type: "uint160" },
634
+ { internalType: "uint48", name: "period", type: "uint48" },
635
+ { internalType: "uint48", name: "start", type: "uint48" },
636
+ { internalType: "uint48", name: "end", type: "uint48" },
637
+ { internalType: "uint256", name: "salt", type: "uint256" },
638
+ { internalType: "bytes", name: "extraData", type: "bytes" },
639
+ ],
640
+ internalType: "struct SpendPermissionManager.SpendPermission",
641
+ name: "spendPermission",
642
+ type: "tuple",
643
+ },
644
+ ],
645
+ name: "revokeAsSpender",
646
+ outputs: [],
647
+ stateMutability: "nonpayable",
648
+ type: "function",
649
+ },
650
+ {
651
+ inputs: [
652
+ {
653
+ components: [
654
+ { internalType: "address", name: "account", type: "address" },
655
+ { internalType: "address", name: "spender", type: "address" },
656
+ { internalType: "address", name: "token", type: "address" },
657
+ { internalType: "uint160", name: "allowance", type: "uint160" },
658
+ { internalType: "uint48", name: "period", type: "uint48" },
659
+ { internalType: "uint48", name: "start", type: "uint48" },
660
+ { internalType: "uint48", name: "end", type: "uint48" },
661
+ { internalType: "uint256", name: "salt", type: "uint256" },
662
+ { internalType: "bytes", name: "extraData", type: "bytes" },
663
+ ],
664
+ internalType: "struct SpendPermissionManager.SpendPermission",
665
+ name: "spendPermission",
666
+ type: "tuple",
667
+ },
668
+ { internalType: "uint160", name: "value", type: "uint160" },
669
+ ],
670
+ name: "spend",
671
+ outputs: [],
672
+ stateMutability: "nonpayable",
673
+ type: "function",
674
+ },
675
+ {
676
+ inputs: [
677
+ {
678
+ components: [
679
+ { internalType: "address", name: "account", type: "address" },
680
+ { internalType: "address", name: "spender", type: "address" },
681
+ { internalType: "address", name: "token", type: "address" },
682
+ { internalType: "uint160", name: "allowance", type: "uint160" },
683
+ { internalType: "uint48", name: "period", type: "uint48" },
684
+ { internalType: "uint48", name: "start", type: "uint48" },
685
+ { internalType: "uint48", name: "end", type: "uint48" },
686
+ { internalType: "uint256", name: "salt", type: "uint256" },
687
+ { internalType: "bytes", name: "extraData", type: "bytes" },
688
+ ],
689
+ internalType: "struct SpendPermissionManager.SpendPermission",
690
+ name: "spendPermission",
691
+ type: "tuple",
692
+ },
693
+ { internalType: "uint160", name: "value", type: "uint160" },
694
+ {
695
+ components: [
696
+ { internalType: "bytes", name: "signature", type: "bytes" },
697
+ { internalType: "address", name: "asset", type: "address" },
698
+ { internalType: "uint256", name: "amount", type: "uint256" },
699
+ { internalType: "uint256", name: "nonce", type: "uint256" },
700
+ { internalType: "uint48", name: "expiry", type: "uint48" },
701
+ ],
702
+ internalType: "struct MagicSpend.WithdrawRequest",
703
+ name: "withdrawRequest",
704
+ type: "tuple",
705
+ },
706
+ ],
707
+ name: "spendWithWithdraw",
708
+ outputs: [],
709
+ stateMutability: "nonpayable",
710
+ type: "function",
711
+ },
712
+ { stateMutability: "payable", type: "receive" },
713
+ ] as const;