@coinbase/cdp-sdk 1.28.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 (274) hide show
  1. package/CHANGELOG.md +16 -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 +12 -1
  5. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  6. package/_cjs/accounts/evm/toEvmSmartAccount.js +12 -1
  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 +11 -1
  11. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  12. package/_cjs/accounts/solana/toSolanaAccount.js +41 -1
  13. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
  14. package/_cjs/actions/Quote.js +106 -0
  15. package/_cjs/actions/Quote.js.map +1 -0
  16. package/_cjs/actions/evm/fund/fund.js +5 -5
  17. package/_cjs/actions/evm/fund/fund.js.map +1 -1
  18. package/_cjs/actions/evm/fund/quoteFund.js +7 -7
  19. package/_cjs/actions/evm/fund/quoteFund.js.map +1 -1
  20. package/_cjs/actions/evm/getUserOperation.js +1 -0
  21. package/_cjs/actions/evm/getUserOperation.js.map +1 -1
  22. package/_cjs/actions/evm/spend-permissions/account.use.js +33 -0
  23. package/_cjs/actions/evm/spend-permissions/account.use.js.map +1 -0
  24. package/_cjs/actions/evm/spend-permissions/smartAccount.use.js +35 -0
  25. package/_cjs/actions/evm/spend-permissions/smartAccount.use.js.map +1 -0
  26. package/_cjs/actions/evm/spend-permissions/types.js.map +1 -0
  27. package/_cjs/actions/evm/transfer/accountTransferStrategy.js +1 -0
  28. package/_cjs/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
  29. package/_cjs/actions/solana/fund/fund.js +50 -0
  30. package/_cjs/actions/solana/fund/fund.js.map +1 -0
  31. package/_cjs/actions/solana/fund/quoteFund.js +47 -0
  32. package/_cjs/actions/solana/fund/quoteFund.js.map +1 -0
  33. package/_cjs/actions/solana/sendTransaction.js +1 -0
  34. package/_cjs/actions/solana/sendTransaction.js.map +1 -1
  35. package/_cjs/actions/solana/signTransaction.js +1 -0
  36. package/_cjs/actions/solana/signTransaction.js.map +1 -1
  37. package/_cjs/actions/types.js +3 -0
  38. package/{_esm/actions/evm/fund → _cjs/actions}/types.js.map +1 -1
  39. package/_cjs/actions/{evm/fund/waitForFundOperationReceipt.js → waitForFundOperationReceipt.js} +2 -2
  40. package/_cjs/actions/waitForFundOperationReceipt.js.map +1 -0
  41. package/_cjs/auth/hooks/axios/withAuth.js +3 -0
  42. package/_cjs/auth/hooks/axios/withAuth.js.map +1 -1
  43. package/_cjs/auth/utils/http.js +2 -1
  44. package/_cjs/auth/utils/http.js.map +1 -1
  45. package/_cjs/client/evm/evm.js +51 -1
  46. package/_cjs/client/evm/evm.js.map +1 -1
  47. package/_cjs/client/solana/solana.js.map +1 -1
  48. package/_cjs/index.js +5 -1
  49. package/_cjs/index.js.map +1 -1
  50. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +54 -7
  51. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  52. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +14 -1
  53. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  54. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +76 -4
  55. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  56. package/_cjs/openapi-client/generated/index.msw.js +2 -0
  57. package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
  58. package/_cjs/openapi-client/generated/onramp/onramp.js +30 -0
  59. package/_cjs/openapi-client/generated/onramp/onramp.js.map +1 -0
  60. package/_cjs/openapi-client/generated/onramp/onramp.msw.js +98 -0
  61. package/_cjs/openapi-client/generated/onramp/onramp.msw.js.map +1 -0
  62. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js +15 -0
  63. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -0
  64. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js +69 -0
  65. package/_cjs/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js.map +1 -0
  66. package/_cjs/openapi-client/index.js +2 -0
  67. package/_cjs/openapi-client/index.js.map +1 -1
  68. package/_cjs/spend-permissions/constants.js +716 -0
  69. package/_cjs/spend-permissions/constants.js.map +1 -0
  70. package/_cjs/spend-permissions/types.js +3 -0
  71. package/_cjs/{actions/evm/fund → spend-permissions}/types.js.map +1 -1
  72. package/_cjs/version.js +1 -1
  73. package/_esm/accounts/evm/networkCapabilities.js +101 -0
  74. package/_esm/accounts/evm/networkCapabilities.js.map +1 -1
  75. package/_esm/accounts/evm/toEvmServerAccount.js +12 -1
  76. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  77. package/_esm/accounts/evm/toEvmSmartAccount.js +12 -1
  78. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  79. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +10 -0
  80. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  81. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +11 -1
  82. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  83. package/_esm/accounts/solana/toSolanaAccount.js +41 -1
  84. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
  85. package/_esm/actions/Quote.js +101 -0
  86. package/_esm/actions/Quote.js.map +1 -0
  87. package/_esm/actions/evm/fund/fund.js +5 -5
  88. package/_esm/actions/evm/fund/fund.js.map +1 -1
  89. package/_esm/actions/evm/fund/quoteFund.js +7 -7
  90. package/_esm/actions/evm/fund/quoteFund.js.map +1 -1
  91. package/_esm/actions/evm/getUserOperation.js +1 -0
  92. package/_esm/actions/evm/getUserOperation.js.map +1 -1
  93. package/_esm/actions/evm/spend-permissions/account.use.js +30 -0
  94. package/_esm/actions/evm/spend-permissions/account.use.js.map +1 -0
  95. package/_esm/actions/evm/spend-permissions/smartAccount.use.js +32 -0
  96. package/_esm/actions/evm/spend-permissions/smartAccount.use.js.map +1 -0
  97. package/_esm/actions/evm/spend-permissions/types.js.map +1 -0
  98. package/_esm/actions/evm/transfer/accountTransferStrategy.js +1 -0
  99. package/_esm/actions/evm/transfer/accountTransferStrategy.js.map +1 -1
  100. package/_esm/actions/solana/fund/fund.js +47 -0
  101. package/_esm/actions/solana/fund/fund.js.map +1 -0
  102. package/_esm/actions/solana/fund/quoteFund.js +44 -0
  103. package/_esm/actions/solana/fund/quoteFund.js.map +1 -0
  104. package/_esm/actions/solana/sendTransaction.js +1 -0
  105. package/_esm/actions/solana/sendTransaction.js.map +1 -1
  106. package/_esm/actions/solana/signTransaction.js +1 -0
  107. package/_esm/actions/solana/signTransaction.js.map +1 -1
  108. package/_esm/actions/types.js +2 -0
  109. package/_esm/actions/types.js.map +1 -0
  110. package/_esm/actions/{evm/fund/waitForFundOperationReceipt.js → waitForFundOperationReceipt.js} +2 -2
  111. package/_esm/actions/waitForFundOperationReceipt.js.map +1 -0
  112. package/_esm/auth/hooks/axios/withAuth.js +3 -0
  113. package/_esm/auth/hooks/axios/withAuth.js.map +1 -1
  114. package/_esm/auth/utils/http.js +2 -1
  115. package/_esm/auth/utils/http.js.map +1 -1
  116. package/_esm/client/evm/evm.js +51 -1
  117. package/_esm/client/evm/evm.js.map +1 -1
  118. package/_esm/client/solana/solana.js +2 -2
  119. package/_esm/client/solana/solana.js.map +1 -1
  120. package/_esm/index.js +2 -1
  121. package/_esm/index.js.map +1 -1
  122. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +52 -5
  123. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  124. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +12 -0
  125. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  126. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +73 -3
  127. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  128. package/_esm/openapi-client/generated/index.msw.js +2 -0
  129. package/_esm/openapi-client/generated/index.msw.js.map +1 -1
  130. package/_esm/openapi-client/generated/onramp/onramp.js +25 -0
  131. package/_esm/openapi-client/generated/onramp/onramp.js.map +1 -0
  132. package/_esm/openapi-client/generated/onramp/onramp.msw.js +90 -0
  133. package/_esm/openapi-client/generated/onramp/onramp.msw.js.map +1 -0
  134. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js +11 -0
  135. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.js.map +1 -0
  136. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js +63 -0
  137. package/_esm/openapi-client/generated/x402-facilitator/x402-facilitator.msw.js.map +1 -0
  138. package/_esm/openapi-client/index.js +2 -0
  139. package/_esm/openapi-client/index.js.map +1 -1
  140. package/_esm/spend-permissions/constants.js +713 -0
  141. package/_esm/spend-permissions/constants.js.map +1 -0
  142. package/_esm/spend-permissions/types.js +2 -0
  143. package/_esm/spend-permissions/types.js.map +1 -0
  144. package/_esm/version.js +1 -1
  145. package/_types/accounts/evm/networkCapabilities.d.ts +101 -0
  146. package/_types/accounts/evm/networkCapabilities.d.ts.map +1 -1
  147. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  148. package/_types/accounts/evm/toEvmSmartAccount.d.ts +1 -1
  149. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  150. package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
  151. package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
  152. package/_types/accounts/evm/types.d.ts +15 -9
  153. package/_types/accounts/evm/types.d.ts.map +1 -1
  154. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
  155. package/_types/actions/Quote.d.ts +97 -0
  156. package/_types/actions/Quote.d.ts.map +1 -0
  157. package/_types/actions/evm/fund/fund.d.ts +3 -7
  158. package/_types/actions/evm/fund/fund.d.ts.map +1 -1
  159. package/_types/actions/evm/fund/quoteFund.d.ts +4 -7
  160. package/_types/actions/evm/fund/quoteFund.d.ts.map +1 -1
  161. package/_types/actions/evm/getUserOperation.d.ts.map +1 -1
  162. package/_types/actions/evm/spend-permissions/account.use.d.ts +15 -0
  163. package/_types/actions/evm/spend-permissions/account.use.d.ts.map +1 -0
  164. package/_types/actions/evm/spend-permissions/smartAccount.use.d.ts +15 -0
  165. package/_types/actions/evm/spend-permissions/smartAccount.use.d.ts.map +1 -0
  166. package/_types/actions/evm/spend-permissions/types.d.ts +13 -0
  167. package/_types/actions/evm/spend-permissions/types.d.ts.map +1 -0
  168. package/_types/actions/evm/transfer/accountTransferStrategy.d.ts.map +1 -1
  169. package/_types/actions/evm/types.d.ts +82 -7
  170. package/_types/actions/evm/types.d.ts.map +1 -1
  171. package/_types/actions/solana/fund/fund.d.ts +19 -0
  172. package/_types/actions/solana/fund/fund.d.ts.map +1 -0
  173. package/_types/actions/solana/fund/quoteFund.d.ts +20 -0
  174. package/_types/actions/solana/fund/quoteFund.d.ts.map +1 -0
  175. package/_types/actions/solana/sendTransaction.d.ts +8 -2
  176. package/_types/actions/solana/sendTransaction.d.ts.map +1 -1
  177. package/_types/actions/solana/signTransaction.d.ts +8 -2
  178. package/_types/actions/solana/signTransaction.d.ts.map +1 -1
  179. package/_types/actions/solana/types.d.ts +99 -3
  180. package/_types/actions/solana/types.d.ts.map +1 -1
  181. package/_types/actions/types.d.ts +37 -0
  182. package/_types/actions/types.d.ts.map +1 -0
  183. package/_types/actions/{evm/fund/waitForFundOperationReceipt.d.ts → waitForFundOperationReceipt.d.ts} +2 -2
  184. package/_types/actions/waitForFundOperationReceipt.d.ts.map +1 -0
  185. package/_types/auth/hooks/axios/withAuth.d.ts.map +1 -1
  186. package/_types/auth/utils/http.d.ts.map +1 -1
  187. package/_types/client/evm/evm.d.ts +19 -1
  188. package/_types/client/evm/evm.d.ts.map +1 -1
  189. package/_types/client/evm/evm.types.d.ts +29 -2
  190. package/_types/client/evm/evm.types.d.ts.map +1 -1
  191. package/_types/client/solana/solana.d.ts +5 -3
  192. package/_types/client/solana/solana.d.ts.map +1 -1
  193. package/_types/index.d.ts +3 -1
  194. package/_types/index.d.ts.map +1 -1
  195. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +356 -20
  196. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  197. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +7 -1
  198. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
  199. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts +2 -0
  200. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -1
  201. package/_types/openapi-client/generated/index.msw.d.ts +2 -0
  202. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
  203. package/_types/openapi-client/generated/onramp/onramp.d.ts +28 -0
  204. package/_types/openapi-client/generated/onramp/onramp.d.ts.map +1 -0
  205. package/_types/openapi-client/generated/onramp/onramp.msw.d.ts +8 -0
  206. package/_types/openapi-client/generated/onramp/onramp.msw.d.ts.map +1 -0
  207. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts +20 -0
  208. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.d.ts.map +1 -0
  209. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.msw.d.ts +6 -0
  210. package/_types/openapi-client/generated/x402-facilitator/x402-facilitator.msw.d.ts.map +1 -0
  211. package/_types/openapi-client/index.d.ts +4 -0
  212. package/_types/openapi-client/index.d.ts.map +1 -1
  213. package/_types/spend-permissions/constants.d.ts +1357 -0
  214. package/_types/spend-permissions/constants.d.ts.map +1 -0
  215. package/_types/spend-permissions/types.d.ts +30 -0
  216. package/_types/spend-permissions/types.d.ts.map +1 -0
  217. package/_types/version.d.ts +1 -1
  218. package/accounts/evm/networkCapabilities.ts +101 -0
  219. package/accounts/evm/toEvmServerAccount.ts +26 -11
  220. package/accounts/evm/toEvmSmartAccount.ts +30 -15
  221. package/accounts/evm/toNetworkScopedEvmServerAccount.ts +20 -5
  222. package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +21 -6
  223. package/accounts/evm/types.ts +34 -12
  224. package/accounts/solana/toSolanaAccount.ts +58 -3
  225. package/actions/Quote.ts +154 -0
  226. package/actions/evm/fund/fund.ts +10 -14
  227. package/actions/evm/fund/quoteFund.ts +13 -16
  228. package/actions/evm/getUserOperation.ts +1 -0
  229. package/actions/evm/spend-permissions/account.use.ts +48 -0
  230. package/actions/evm/spend-permissions/smartAccount.use.ts +49 -0
  231. package/actions/evm/spend-permissions/types.ts +13 -0
  232. package/actions/evm/transfer/accountTransferStrategy.ts +2 -0
  233. package/actions/evm/types.ts +88 -7
  234. package/actions/solana/fund/fund.ts +71 -0
  235. package/actions/solana/fund/quoteFund.ts +77 -0
  236. package/actions/solana/sendTransaction.ts +10 -2
  237. package/actions/solana/signTransaction.ts +10 -2
  238. package/actions/solana/types.ts +113 -2
  239. package/actions/types.ts +39 -0
  240. package/actions/{evm/fund/waitForFundOperationReceipt.ts → waitForFundOperationReceipt.ts} +2 -2
  241. package/auth/hooks/axios/withAuth.ts +3 -0
  242. package/auth/utils/http.ts +2 -1
  243. package/client/evm/evm.ts +61 -1
  244. package/client/evm/evm.types.ts +31 -0
  245. package/client/solana/solana.ts +10 -5
  246. package/index.ts +6 -1
  247. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +400 -26
  248. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +89 -3
  249. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +23 -0
  250. package/openapi-client/generated/index.msw.ts +2 -0
  251. package/openapi-client/generated/onramp/onramp.msw.ts +135 -0
  252. package/openapi-client/generated/onramp/onramp.ts +54 -0
  253. package/openapi-client/generated/x402-facilitator/x402-facilitator.msw.ts +85 -0
  254. package/openapi-client/generated/x402-facilitator/x402-facilitator.ts +34 -0
  255. package/openapi-client/index.ts +2 -0
  256. package/package.json +1 -1
  257. package/spend-permissions/constants.ts +713 -0
  258. package/spend-permissions/types.ts +42 -0
  259. package/version.ts +1 -1
  260. package/_cjs/actions/evm/fund/Quote.js +0 -63
  261. package/_cjs/actions/evm/fund/Quote.js.map +0 -1
  262. package/_cjs/actions/evm/fund/waitForFundOperationReceipt.js.map +0 -1
  263. package/_esm/actions/evm/fund/Quote.js +0 -59
  264. package/_esm/actions/evm/fund/Quote.js.map +0 -1
  265. package/_esm/actions/evm/fund/waitForFundOperationReceipt.js.map +0 -1
  266. package/_types/actions/evm/fund/Quote.d.ts +0 -51
  267. package/_types/actions/evm/fund/Quote.d.ts.map +0 -1
  268. package/_types/actions/evm/fund/types.d.ts +0 -16
  269. package/_types/actions/evm/fund/types.d.ts.map +0 -1
  270. package/_types/actions/evm/fund/waitForFundOperationReceipt.d.ts.map +0 -1
  271. package/actions/evm/fund/Quote.ts +0 -83
  272. package/actions/evm/fund/types.ts +0 -16
  273. /package/_cjs/actions/evm/{fund → spend-permissions}/types.js +0 -0
  274. /package/_esm/actions/evm/{fund → spend-permissions}/types.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../spend-permissions/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gCAAgC,+CAA+C,CAAC;AAE7F,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAssB/B,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { Address, Hex } from "../types/misc.js";
2
+ /**
3
+ * A spend permission structure that defines authorization for spending tokens
4
+ */
5
+ export type SpendPermission = {
6
+ /** The account address that owns the tokens */
7
+ account: Address;
8
+ /** The address that is authorized to spend the tokens */
9
+ spender: Address;
10
+ /** The token contract address (use 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for ETH) */
11
+ token: Address;
12
+ /** The maximum amount that can be spent (in wei for ETH, or token's smallest unit) */
13
+ allowance: bigint;
14
+ /** Time period in seconds for the spending allowance */
15
+ period: number;
16
+ /** Start timestamp for when the permission becomes valid */
17
+ start: number;
18
+ /** End timestamp for when the permission expires */
19
+ end: number;
20
+ /** Unique salt to prevent replay attacks */
21
+ salt: bigint;
22
+ /** Additional data for the permission */
23
+ extraData: Hex;
24
+ };
25
+ /**
26
+ * Networks that the SpendPermissionManager contract supports.
27
+ * From https://github.com/coinbase/spend-permissions/blob/main/README.md#deployments
28
+ */
29
+ export type SpendPermissionNetworks = "base" | "base-sepolia" | "ethereum" | "ethereum-sepolia" | "optimism" | "optimism-sepolia" | "arbitrum" | "avalanche" | "binance" | "polygon" | "zora";
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../spend-permissions/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,yDAAyD;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,0FAA0F;IAC1F,KAAK,EAAE,OAAO,CAAC;IACf,sFAAsF;IACtF,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,SAAS,EAAE,GAAG,CAAC;CAChB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAC/B,MAAM,GACN,cAAc,GACd,UAAU,GACV,kBAAkB,GAClB,UAAU,GACV,kBAAkB,GAClB,UAAU,GACV,WAAW,GACX,SAAS,GACT,SAAS,GACT,MAAM,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "1.28.0";
1
+ export declare const version = "1.30.0";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -18,6 +18,7 @@ export const NETWORK_CAPABILITIES = {
18
18
  sendTransaction: true,
19
19
  quoteSwap: true,
20
20
  swap: true,
21
+ useSpendPermission: true,
21
22
  },
22
23
  "base-sepolia": {
23
24
  listTokenBalances: true,
@@ -29,6 +30,7 @@ export const NETWORK_CAPABILITIES = {
29
30
  sendTransaction: true,
30
31
  quoteSwap: false,
31
32
  swap: false,
33
+ useSpendPermission: true,
32
34
  },
33
35
  ethereum: {
34
36
  listTokenBalances: true,
@@ -40,6 +42,7 @@ export const NETWORK_CAPABILITIES = {
40
42
  sendTransaction: true,
41
43
  quoteSwap: true,
42
44
  swap: true,
45
+ useSpendPermission: true,
43
46
  },
44
47
  "ethereum-sepolia": {
45
48
  listTokenBalances: false,
@@ -51,6 +54,7 @@ export const NETWORK_CAPABILITIES = {
51
54
  sendTransaction: true,
52
55
  quoteSwap: false,
53
56
  swap: false,
57
+ useSpendPermission: true,
54
58
  },
55
59
  "ethereum-hoodi": {
56
60
  listTokenBalances: false,
@@ -62,6 +66,103 @@ export const NETWORK_CAPABILITIES = {
62
66
  sendTransaction: true, // Always available (uses wallet client for non-base networks)
63
67
  quoteSwap: false,
64
68
  swap: false,
69
+ useSpendPermission: false,
70
+ },
71
+ optimism: {
72
+ listTokenBalances: false,
73
+ requestFaucet: false,
74
+ quoteFund: false,
75
+ fund: false,
76
+ waitForFundOperationReceipt: false,
77
+ transfer: false,
78
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
79
+ quoteSwap: false,
80
+ swap: false,
81
+ useSpendPermission: true,
82
+ },
83
+ "optimism-sepolia": {
84
+ listTokenBalances: false,
85
+ requestFaucet: true,
86
+ quoteFund: false,
87
+ fund: false,
88
+ waitForFundOperationReceipt: false,
89
+ transfer: false,
90
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
91
+ quoteSwap: false,
92
+ swap: false,
93
+ useSpendPermission: true,
94
+ },
95
+ arbitrum: {
96
+ listTokenBalances: false,
97
+ requestFaucet: true,
98
+ quoteFund: false,
99
+ fund: false,
100
+ waitForFundOperationReceipt: false,
101
+ transfer: false,
102
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
103
+ quoteSwap: false,
104
+ swap: false,
105
+ useSpendPermission: true,
106
+ },
107
+ "arbitrum-sepolia": {
108
+ listTokenBalances: false,
109
+ requestFaucet: true,
110
+ quoteFund: false,
111
+ fund: false,
112
+ waitForFundOperationReceipt: false,
113
+ transfer: false,
114
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
115
+ quoteSwap: false,
116
+ swap: false,
117
+ useSpendPermission: true,
118
+ },
119
+ avalanche: {
120
+ listTokenBalances: false,
121
+ requestFaucet: false,
122
+ quoteFund: false,
123
+ fund: false,
124
+ waitForFundOperationReceipt: false,
125
+ transfer: false,
126
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
127
+ quoteSwap: false,
128
+ swap: false,
129
+ useSpendPermission: true,
130
+ },
131
+ binance: {
132
+ listTokenBalances: false,
133
+ requestFaucet: false,
134
+ quoteFund: false,
135
+ fund: false,
136
+ waitForFundOperationReceipt: false,
137
+ transfer: false,
138
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
139
+ quoteSwap: false,
140
+ swap: false,
141
+ useSpendPermission: true,
142
+ },
143
+ polygon: {
144
+ listTokenBalances: false,
145
+ requestFaucet: false,
146
+ quoteFund: false,
147
+ fund: false,
148
+ waitForFundOperationReceipt: false,
149
+ transfer: false,
150
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
151
+ quoteSwap: false,
152
+ swap: false,
153
+ useSpendPermission: true,
154
+ },
155
+ zora: {
156
+ listTokenBalances: false,
157
+ requestFaucet: false,
158
+ quoteFund: false,
159
+ fund: false,
160
+ waitForFundOperationReceipt: false,
161
+ transfer: false,
162
+ sendTransaction: true, // Always available (uses wallet client for non-base networks)
163
+ quoteSwap: false,
164
+ swap: false,
165
+ useSpendPermission: true,
65
166
  },
66
167
  } as const;
67
168
 
@@ -8,15 +8,8 @@ import {
8
8
  } from "viem";
9
9
 
10
10
  import { toNetworkScopedEvmServerAccount } from "./toNetworkScopedEvmServerAccount.js";
11
- import { FundOptions, fund } from "../../actions/evm/fund/fund.js";
12
- import { Quote } from "../../actions/evm/fund/Quote.js";
13
- import { QuoteFundOptions, quoteFund } from "../../actions/evm/fund/quoteFund.js";
14
- import { FundOperationResult } from "../../actions/evm/fund/types.js";
15
- import {
16
- WaitForFundOperationOptions,
17
- WaitForFundOperationResult,
18
- waitForFundOperationReceipt,
19
- } from "../../actions/evm/fund/waitForFundOperationReceipt.js";
11
+ import { EvmFundOptions, fund } from "../../actions/evm/fund/fund.js";
12
+ import { EvmQuoteFundOptions, quoteFund } from "../../actions/evm/fund/quoteFund.js";
20
13
  import {
21
14
  listTokenBalances,
22
15
  type ListTokenBalancesResult,
@@ -28,10 +21,19 @@ import {
28
21
  type RequestFaucetResult,
29
22
  } from "../../actions/evm/requestFaucet.js";
30
23
  import { sendTransaction } from "../../actions/evm/sendTransaction.js";
24
+ import { useSpendPermission } from "../../actions/evm/spend-permissions/account.use.js";
25
+ import { UseSpendPermissionOptions } from "../../actions/evm/spend-permissions/types.js";
31
26
  import { createSwapQuote } from "../../actions/evm/swap/createSwapQuote.js";
32
27
  import { sendSwapTransaction } from "../../actions/evm/swap/sendSwapTransaction.js";
33
28
  import { accountTransferStrategy } from "../../actions/evm/transfer/accountTransferStrategy.js";
34
29
  import { transfer } from "../../actions/evm/transfer/transfer.js";
30
+ import { EvmQuote } from "../../actions/Quote.js";
31
+ import { FundOperationResult } from "../../actions/types.js";
32
+ import {
33
+ WaitForFundOperationOptions,
34
+ WaitForFundOperationResult,
35
+ waitForFundOperationReceipt,
36
+ } from "../../actions/waitForFundOperationReceipt.js";
35
37
  import { Analytics } from "../../analytics.js";
36
38
 
37
39
  import type { EvmServerAccount, NetworkOrRpcUrl } from "./types.js";
@@ -189,7 +191,7 @@ export function toEvmServerAccount(
189
191
  address: this.address,
190
192
  });
191
193
  },
192
- async quoteFund(options: Omit<QuoteFundOptions, "address">): Promise<Quote> {
194
+ async quoteFund(options: Omit<EvmQuoteFundOptions, "address">): Promise<EvmQuote> {
193
195
  Analytics.trackAction({
194
196
  action: "quote_fund",
195
197
  accountType: "evm_server",
@@ -203,7 +205,7 @@ export function toEvmServerAccount(
203
205
  address: this.address,
204
206
  });
205
207
  },
206
- async fund(options: Omit<FundOptions, "address">): Promise<FundOperationResult> {
208
+ async fund(options: Omit<EvmFundOptions, "address">): Promise<FundOperationResult> {
207
209
  Analytics.trackAction({
208
210
  action: "fund",
209
211
  accountType: "evm_server",
@@ -256,6 +258,19 @@ export function toEvmServerAccount(
256
258
  taker: this.address, // Always use account's address as taker
257
259
  });
258
260
  },
261
+ async __experimental_useSpendPermission(
262
+ options: UseSpendPermissionOptions,
263
+ ): Promise<TransactionResult> {
264
+ Analytics.trackAction({
265
+ action: "use_spend_permission",
266
+ accountType: "evm_server",
267
+ properties: {
268
+ network: options.network,
269
+ },
270
+ });
271
+
272
+ return useSpendPermission(apiClient, this.address, options);
273
+ },
259
274
  name: options.account.name,
260
275
  type: "evm-server",
261
276
  policies: options.account.policies,
@@ -1,14 +1,7 @@
1
1
  import { resolveNetworkToChain } from "./networkToChainResolver.js";
2
2
  import { toNetworkScopedEvmSmartAccount } from "./toNetworkScopedEvmSmartAccount.js";
3
- import { fund, FundOptions } from "../../actions/evm/fund/fund.js";
4
- import { Quote } from "../../actions/evm/fund/Quote.js";
5
- import { quoteFund, QuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
6
- import { FundOperationResult } from "../../actions/evm/fund/types.js";
7
- import {
8
- WaitForFundOperationResult,
9
- waitForFundOperationReceipt,
10
- WaitForFundOperationOptions,
11
- } from "../../actions/evm/fund/waitForFundOperationReceipt.js";
3
+ import { fund, EvmFundOptions } from "../../actions/evm/fund/fund.js";
4
+ import { quoteFund, EvmQuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
12
5
  import { getUserOperation } from "../../actions/evm/getUserOperation.js";
13
6
  import {
14
7
  listTokenBalances,
@@ -26,6 +19,8 @@ import {
26
19
  sendUserOperation,
27
20
  } from "../../actions/evm/sendUserOperation.js";
28
21
  import { signAndWrapTypedDataForSmartAccount } from "../../actions/evm/signAndWrapTypedDataForSmartAccount.js";
22
+ import { useSpendPermission } from "../../actions/evm/spend-permissions/smartAccount.use.js";
23
+ import { UseSpendPermissionOptions } from "../../actions/evm/spend-permissions/types.js";
29
24
  import { createSwapQuote } from "../../actions/evm/swap/createSwapQuote.js";
30
25
  import { sendSwapOperation } from "../../actions/evm/swap/sendSwapOperation.js";
31
26
  import { smartAccountTransferStrategy } from "../../actions/evm/transfer/smartAccountTransferStrategy.js";
@@ -35,12 +30,23 @@ import {
35
30
  WaitForUserOperationOptions,
36
31
  WaitForUserOperationReturnType,
37
32
  } from "../../actions/evm/waitForUserOperation.js";
33
+ import { EvmQuote } from "../../actions/Quote.js";
34
+ import { FundOperationResult } from "../../actions/types.js";
35
+ import {
36
+ WaitForFundOperationResult,
37
+ waitForFundOperationReceipt,
38
+ WaitForFundOperationOptions,
39
+ } from "../../actions/waitForFundOperationReceipt.js";
38
40
  import { Analytics } from "../../analytics.js";
39
41
  import {
40
42
  GetUserOperationOptions,
41
43
  SignTypedDataOptions,
42
44
  UserOperation,
43
45
  } from "../../client/evm/evm.types.js";
46
+ import {
47
+ type CdpOpenApiClientType,
48
+ type EvmSmartAccount as EvmSmartAccountModel,
49
+ } from "../../openapi-client/index.js";
44
50
 
45
51
  import type { EvmAccount, EvmSmartAccount, KnownEvmNetworks } from "./types.js";
46
52
  import type {
@@ -49,10 +55,6 @@ import type {
49
55
  SmartAccountSwapOptions,
50
56
  SmartAccountSwapResult,
51
57
  } from "../../actions/evm/swap/types.js";
52
- import type {
53
- CdpOpenApiClientType,
54
- EvmSmartAccount as EvmSmartAccountModel,
55
- } from "../../openapi-client/index.js";
56
58
  import type { Address, Hex } from "../../types/misc.js";
57
59
 
58
60
  /**
@@ -170,7 +172,7 @@ export function toEvmSmartAccount(
170
172
  address: account.address,
171
173
  });
172
174
  },
173
- async quoteFund(options: Omit<QuoteFundOptions, "address">): Promise<Quote> {
175
+ async quoteFund(options: Omit<EvmQuoteFundOptions, "address">): Promise<EvmQuote> {
174
176
  Analytics.trackAction({
175
177
  action: "quote_fund",
176
178
  accountType: "evm_smart",
@@ -184,7 +186,7 @@ export function toEvmSmartAccount(
184
186
  address: this.address,
185
187
  });
186
188
  },
187
- async fund(options: Omit<FundOptions, "address">): Promise<FundOperationResult> {
189
+ async fund(options: Omit<EvmFundOptions, "address">): Promise<FundOperationResult> {
188
190
  Analytics.trackAction({
189
191
  action: "fund",
190
192
  accountType: "evm_smart",
@@ -258,6 +260,19 @@ export function toEvmSmartAccount(
258
260
  });
259
261
  return result.signature;
260
262
  },
263
+ async __experimental_useSpendPermission(
264
+ options: UseSpendPermissionOptions,
265
+ ): Promise<SendUserOperationReturnType> {
266
+ Analytics.trackAction({
267
+ action: "use_spend_permission",
268
+ accountType: "evm_smart",
269
+ properties: {
270
+ network: options.network,
271
+ },
272
+ });
273
+
274
+ return useSpendPermission(apiClient, account, options);
275
+ },
261
276
 
262
277
  name: options.smartAccount.name,
263
278
  type: "evm-smart",
@@ -8,21 +8,23 @@ import { transferWithViem } from "../../actions/evm/transfer/transferWithViem.js
8
8
  import { Analytics } from "../../analytics.js";
9
9
 
10
10
  import type { EvmServerAccount, NetworkScopedEvmServerAccount } from "./types.js";
11
- import type { FundOptions } from "../../actions/evm/fund/fund.js";
12
- import type { QuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
13
- import type { WaitForFundOperationOptions } from "../../actions/evm/fund/waitForFundOperationReceipt.js";
11
+ import type { EvmFundOptions } from "../../actions/evm/fund/fund.js";
12
+ import type { EvmQuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
14
13
  import type { ListTokenBalancesOptions } from "../../actions/evm/listTokenBalances.js";
15
14
  import type { RequestFaucetOptions } from "../../actions/evm/requestFaucet.js";
16
15
  import type {
17
16
  SendTransactionOptions,
18
17
  TransactionResult,
19
18
  } from "../../actions/evm/sendTransaction.js";
19
+ import type { UseSpendPermissionOptions } from "../../actions/evm/spend-permissions/types.js";
20
20
  import type { AccountQuoteSwapOptions, AccountSwapOptions } from "../../actions/evm/swap/types.js";
21
21
  import type { TransferOptions } from "../../actions/evm/transfer/types.js";
22
+ import type { WaitForFundOperationOptions } from "../../actions/waitForFundOperationReceipt.js";
22
23
  import type {
23
24
  ListEvmTokenBalancesNetwork,
24
25
  SendEvmTransactionBodyNetwork,
25
26
  } from "../../openapi-client/index.js";
27
+ import type { SpendPermissionNetworks } from "../../spend-permissions/types.js";
26
28
  import type { Address, TransactionRequestEIP1559 } from "../../types/misc.js";
27
29
 
28
30
  /**
@@ -156,7 +158,7 @@ export async function toNetworkScopedEvmServerAccount<Network extends string>(
156
158
 
157
159
  if (isMethodSupportedOnNetwork("quoteFund", resolvedNetworkName)) {
158
160
  Object.assign(account, {
159
- quoteFund: async (quoteFundOptions: Omit<QuoteFundOptions, "address">) => {
161
+ quoteFund: async (quoteFundOptions: Omit<EvmQuoteFundOptions, "address">) => {
160
162
  return options.account.quoteFund({
161
163
  ...quoteFundOptions,
162
164
  });
@@ -166,7 +168,7 @@ export async function toNetworkScopedEvmServerAccount<Network extends string>(
166
168
 
167
169
  if (isMethodSupportedOnNetwork("fund", resolvedNetworkName)) {
168
170
  Object.assign(account, {
169
- fund: async (fundOptions: Omit<FundOptions, "address">) => {
171
+ fund: async (fundOptions: Omit<EvmFundOptions, "address">) => {
170
172
  return options.account.fund({
171
173
  ...fundOptions,
172
174
  });
@@ -193,5 +195,18 @@ export async function toNetworkScopedEvmServerAccount<Network extends string>(
193
195
  });
194
196
  }
195
197
 
198
+ if (isMethodSupportedOnNetwork("useSpendPermission", resolvedNetworkName)) {
199
+ Object.assign(account, {
200
+ __experimental_useSpendPermission: async (
201
+ spendPermissionOptions: Omit<UseSpendPermissionOptions, "network">,
202
+ ) => {
203
+ return options.account.__experimental_useSpendPermission({
204
+ ...spendPermissionOptions,
205
+ network: options.network as SpendPermissionNetworks,
206
+ });
207
+ },
208
+ });
209
+ }
210
+
196
211
  return account;
197
212
  }
@@ -2,16 +2,17 @@ import { getBaseNodeRpcUrl } from "./getBaseNodeRpcUrl.js";
2
2
  import { isMethodSupportedOnNetwork } from "./networkCapabilities.js";
3
3
  import { fund } from "../../actions/evm/fund/fund.js";
4
4
  import { quoteFund } from "../../actions/evm/fund/quoteFund.js";
5
- import { waitForFundOperationReceipt } from "../../actions/evm/fund/waitForFundOperationReceipt.js";
6
5
  import { getUserOperation } from "../../actions/evm/getUserOperation.js";
7
6
  import { listTokenBalances } from "../../actions/evm/listTokenBalances.js";
8
7
  import { requestFaucet } from "../../actions/evm/requestFaucet.js";
9
8
  import { sendUserOperation } from "../../actions/evm/sendUserOperation.js";
9
+ import { UseSpendPermissionOptions } from "../../actions/evm/spend-permissions/types.js";
10
10
  import { createSwapQuote } from "../../actions/evm/swap/createSwapQuote.js";
11
11
  import { sendSwapOperation } from "../../actions/evm/swap/sendSwapOperation.js";
12
12
  import { smartAccountTransferStrategy } from "../../actions/evm/transfer/smartAccountTransferStrategy.js";
13
13
  import { transfer } from "../../actions/evm/transfer/transfer.js";
14
14
  import { waitForUserOperation } from "../../actions/evm/waitForUserOperation.js";
15
+ import { waitForFundOperationReceipt } from "../../actions/waitForFundOperationReceipt.js";
15
16
  import { Analytics } from "../../analytics.js";
16
17
 
17
18
  import type {
@@ -20,9 +21,8 @@ import type {
20
21
  KnownEvmNetworks,
21
22
  NetworkScopedEvmSmartAccount,
22
23
  } from "./types.js";
23
- import type { FundOptions } from "../../actions/evm/fund/fund.js";
24
- import type { QuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
25
- import type { WaitForFundOperationOptions } from "../../actions/evm/fund/waitForFundOperationReceipt.js";
24
+ import type { EvmFundOptions } from "../../actions/evm/fund/fund.js";
25
+ import type { EvmQuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
26
26
  import type { ListTokenBalancesOptions } from "../../actions/evm/listTokenBalances.js";
27
27
  import type { RequestFaucetOptions } from "../../actions/evm/requestFaucet.js";
28
28
  import type { SendUserOperationOptions } from "../../actions/evm/sendUserOperation.js";
@@ -33,12 +33,14 @@ import type {
33
33
  } from "../../actions/evm/swap/types.js";
34
34
  import type { SmartAccountTransferOptions } from "../../actions/evm/transfer/types.js";
35
35
  import type { WaitForUserOperationOptions } from "../../actions/evm/waitForUserOperation.js";
36
+ import type { WaitForFundOperationOptions } from "../../actions/waitForFundOperationReceipt.js";
36
37
  import type { GetUserOperationOptions } from "../../client/evm/evm.types.js";
37
38
  import type {
38
39
  CdpOpenApiClientType,
39
40
  EvmUserOperationNetwork,
40
41
  ListEvmTokenBalancesNetwork,
41
42
  } from "../../openapi-client/index.js";
43
+ import type { SpendPermissionNetworks } from "../../spend-permissions/types.js";
42
44
 
43
45
  /**
44
46
  * Options for converting a pre-existing EvmSmartAccount and owner to a NetworkScopedEvmSmartAccount
@@ -195,7 +197,7 @@ export async function toNetworkScopedEvmSmartAccount<Network extends KnownEvmNet
195
197
 
196
198
  if (isMethodSupportedOnNetwork("quoteFund", options.network)) {
197
199
  Object.assign(account, {
198
- quoteFund: async (quoteOptions: Omit<QuoteFundOptions, "address">) => {
200
+ quoteFund: async (quoteOptions: Omit<EvmQuoteFundOptions, "address">) => {
199
201
  Analytics.trackAction({
200
202
  action: "quote_fund",
201
203
  accountType: "evm_smart",
@@ -214,7 +216,7 @@ export async function toNetworkScopedEvmSmartAccount<Network extends KnownEvmNet
214
216
 
215
217
  if (isMethodSupportedOnNetwork("fund", options.network)) {
216
218
  Object.assign(account, {
217
- fund: async (fundOptions: Omit<FundOptions, "address">) => {
219
+ fund: async (fundOptions: Omit<EvmFundOptions, "address">) => {
218
220
  Analytics.trackAction({
219
221
  action: "fund",
220
222
  accountType: "evm_smart",
@@ -279,5 +281,18 @@ export async function toNetworkScopedEvmSmartAccount<Network extends KnownEvmNet
279
281
  });
280
282
  }
281
283
 
284
+ if (isMethodSupportedOnNetwork("useSpendPermission", options.network)) {
285
+ Object.assign(account, {
286
+ __experimental_useSpendPermission: async (
287
+ spendPermissionOptions: Omit<UseSpendPermissionOptions, "network">,
288
+ ) => {
289
+ return options.smartAccount.__experimental_useSpendPermission({
290
+ ...spendPermissionOptions,
291
+ network: options.network as SpendPermissionNetworks,
292
+ });
293
+ },
294
+ });
295
+ }
296
+
282
297
  return account;
283
298
  }
@@ -7,14 +7,8 @@ import {
7
7
  QuoteSwapNetworks,
8
8
  SwapNetworks,
9
9
  } from "./networkCapabilities.js";
10
- import { FundOptions } from "../../actions/evm/fund/fund.js";
11
- import { Quote } from "../../actions/evm/fund/Quote.js";
12
- import { QuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
13
- import { FundOperationResult } from "../../actions/evm/fund/types.js";
14
- import {
15
- WaitForFundOperationOptions,
16
- WaitForFundOperationResult,
17
- } from "../../actions/evm/fund/waitForFundOperationReceipt.js";
10
+ import { EvmFundOptions } from "../../actions/evm/fund/fund.js";
11
+ import { EvmQuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
18
12
  import {
19
13
  ListTokenBalancesOptions,
20
14
  ListTokenBalancesResult,
@@ -25,6 +19,7 @@ import {
25
19
  SendUserOperationOptions,
26
20
  SendUserOperationReturnType,
27
21
  } from "../../actions/evm/sendUserOperation.js";
22
+ import { UseSpendPermissionOptions } from "../../actions/evm/spend-permissions/types.js";
28
23
  import {
29
24
  AccountQuoteSwapOptions,
30
25
  AccountQuoteSwapResult,
@@ -39,13 +34,20 @@ import {
39
34
  WaitForUserOperationOptions,
40
35
  WaitForUserOperationReturnType,
41
36
  } from "../../actions/evm/waitForUserOperation.js";
37
+ import { FundOperationResult } from "../../actions/types.js";
38
+ import {
39
+ WaitForFundOperationOptions,
40
+ WaitForFundOperationResult,
41
+ } from "../../actions/waitForFundOperationReceipt.js";
42
42
  import { GetUserOperationOptions, UserOperation } from "../../client/evm/evm.types.js";
43
+ import { SpendPermissionNetworks } from "../../spend-permissions/types.js";
43
44
 
44
45
  import type {
45
46
  SmartAccountTransferOptions,
46
47
  TransferOptions,
47
48
  } from "../../actions/evm/transfer/types.js";
48
49
  import type { AccountActions, SmartAccountActions } from "../../actions/evm/types.js";
50
+ import type { EvmQuote } from "../../actions/Quote.js";
49
51
  import type { Address, Hash, Hex } from "../../types/misc.js";
50
52
  import type { Prettify } from "../../types/utils.js";
51
53
  import type {
@@ -211,13 +213,17 @@ export type NetworkSpecificSmartAccountActions<Network extends string> = Prettif
211
213
  // Conditionally include quoteFund
212
214
  (Network extends QuoteFundNetworks
213
215
  ? {
214
- quoteFund: (options: Omit<QuoteFundOptions, "address" | "network">) => Promise<Quote>;
216
+ quoteFund: (
217
+ options: Omit<EvmQuoteFundOptions, "address" | "network">,
218
+ ) => Promise<EvmQuote>;
215
219
  }
216
220
  : EmptyObject) &
217
221
  // Conditionally include fund
218
222
  (Network extends FundNetworks
219
223
  ? {
220
- fund: (options: Omit<FundOptions, "address" | "network">) => Promise<FundOperationResult>;
224
+ fund: (
225
+ options: Omit<EvmFundOptions, "address" | "network">,
226
+ ) => Promise<FundOperationResult>;
221
227
  waitForFundOperationReceipt: (
222
228
  options: Omit<WaitForFundOperationOptions, "network">,
223
229
  ) => Promise<WaitForFundOperationResult>;
@@ -238,6 +244,14 @@ export type NetworkSpecificSmartAccountActions<Network extends string> = Prettif
238
244
  options: DistributedOmit<SmartAccountSwapOptions, "network">,
239
245
  ) => Promise<SmartAccountSwapResult>;
240
246
  }
247
+ : EmptyObject) &
248
+ // Conditionally include useSpendPermission
249
+ (Network extends SpendPermissionNetworks
250
+ ? {
251
+ __experimental_useSpendPermission: (
252
+ options: Omit<UseSpendPermissionOptions, "network">,
253
+ ) => Promise<SendUserOperationReturnType>;
254
+ }
241
255
  : EmptyObject)
242
256
  >;
243
257
 
@@ -289,13 +303,13 @@ export type NetworkSpecificAccountActions<Network extends string> = Prettify<
289
303
  // Conditionally include quoteFund
290
304
  (Network extends QuoteFundNetworks
291
305
  ? {
292
- quoteFund: (options: Omit<QuoteFundOptions, "address">) => Promise<Quote>;
306
+ quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>;
293
307
  }
294
308
  : EmptyObject) &
295
309
  // Conditionally include fund
296
310
  (Network extends FundNetworks
297
311
  ? {
298
- fund: (options: Omit<FundOptions, "address">) => Promise<FundOperationResult>;
312
+ fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>;
299
313
  waitForFundOperationReceipt: (
300
314
  options: WaitForFundOperationOptions,
301
315
  ) => Promise<WaitForFundOperationResult>;
@@ -318,6 +332,14 @@ export type NetworkSpecificAccountActions<Network extends string> = Prettify<
318
332
  ? {
319
333
  swap: (options: AccountSwapOptions) => Promise<AccountSwapResult>;
320
334
  }
335
+ : EmptyObject) &
336
+ // Conditionally include useSpendPermission
337
+ (Network extends SpendPermissionNetworks
338
+ ? {
339
+ __experimental_useSpendPermission: (
340
+ options: Omit<UseSpendPermissionOptions, "network">,
341
+ ) => Promise<TransactionResult>;
342
+ }
321
343
  : EmptyObject)
322
344
  >;
323
345