@coinbase/cdp-sdk 1.38.3 → 1.38.5

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 (195) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +24 -0
  3. package/_cjs/accounts/evm/toEvmServerAccount.js +0 -36
  4. package/_cjs/accounts/evm/toEvmServerAccount.js.map +1 -1
  5. package/_cjs/accounts/evm/toEvmSmartAccount.js +0 -36
  6. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  7. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +0 -42
  8. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  9. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +0 -42
  10. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  11. package/_cjs/accounts/solana/toSolanaAccount.js +0 -30
  12. package/_cjs/accounts/solana/toSolanaAccount.js.map +1 -1
  13. package/_cjs/actions/evm/sendUserOperation.js +2 -0
  14. package/_cjs/actions/evm/sendUserOperation.js.map +1 -1
  15. package/_cjs/actions/solana/rpc.js +16 -0
  16. package/_cjs/actions/solana/rpc.js.map +1 -0
  17. package/_cjs/actions/solana/transfer.js +74 -48
  18. package/_cjs/actions/solana/transfer.js.map +1 -1
  19. package/_cjs/actions/solana/utils.js +4 -6
  20. package/_cjs/actions/solana/utils.js.map +1 -1
  21. package/_cjs/auth/utils/http.js +5 -2
  22. package/_cjs/auth/utils/http.js.map +1 -1
  23. package/_cjs/auth/utils/jwt.js +1 -1
  24. package/_cjs/auth/utils/jwt.js.map +1 -1
  25. package/_cjs/client/evm/evm.js +49 -0
  26. package/_cjs/client/evm/evm.js.map +1 -1
  27. package/_cjs/openapi-client/cdpApiClient.js +4 -0
  28. package/_cjs/openapi-client/cdpApiClient.js.map +1 -1
  29. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +6 -41
  30. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  31. package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js +10 -1
  32. package/_cjs/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
  33. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +14 -1
  34. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  35. package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +14 -1
  36. package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -1
  37. package/_cjs/openapi-client/index.js +0 -3
  38. package/_cjs/openapi-client/index.js.map +1 -1
  39. package/_cjs/version.js +1 -1
  40. package/_esm/accounts/evm/toEvmServerAccount.js +0 -36
  41. package/_esm/accounts/evm/toEvmServerAccount.js.map +1 -1
  42. package/_esm/accounts/evm/toEvmSmartAccount.js +0 -36
  43. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  44. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +0 -42
  45. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  46. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +0 -42
  47. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  48. package/_esm/accounts/solana/toSolanaAccount.js +0 -30
  49. package/_esm/accounts/solana/toSolanaAccount.js.map +1 -1
  50. package/_esm/actions/evm/sendUserOperation.js +2 -0
  51. package/_esm/actions/evm/sendUserOperation.js.map +1 -1
  52. package/_esm/actions/solana/rpc.js +13 -0
  53. package/_esm/actions/solana/rpc.js.map +1 -0
  54. package/_esm/actions/solana/transfer.js +72 -48
  55. package/_esm/actions/solana/transfer.js.map +1 -1
  56. package/_esm/actions/solana/utils.js +4 -6
  57. package/_esm/actions/solana/utils.js.map +1 -1
  58. package/_esm/auth/utils/http.js +5 -2
  59. package/_esm/auth/utils/http.js.map +1 -1
  60. package/_esm/auth/utils/jwt.js +1 -1
  61. package/_esm/auth/utils/jwt.js.map +1 -1
  62. package/_esm/client/evm/evm.js +49 -0
  63. package/_esm/client/evm/evm.js.map +1 -1
  64. package/_esm/openapi-client/cdpApiClient.js +4 -0
  65. package/_esm/openapi-client/cdpApiClient.js.map +1 -1
  66. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +5 -39
  67. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  68. package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js +8 -0
  69. package/_esm/openapi-client/generated/end-user-accounts/end-user-accounts.js.map +1 -1
  70. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +12 -0
  71. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
  72. package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +12 -0
  73. package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -1
  74. package/_esm/openapi-client/index.js +0 -3
  75. package/_esm/openapi-client/index.js.map +1 -1
  76. package/_esm/version.js +1 -1
  77. package/_types/accounts/evm/toEvmServerAccount.d.ts.map +1 -1
  78. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  79. package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
  80. package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
  81. package/_types/accounts/evm/types.d.ts +3 -18
  82. package/_types/accounts/evm/types.d.ts.map +1 -1
  83. package/_types/accounts/solana/toSolanaAccount.d.ts.map +1 -1
  84. package/_types/actions/evm/sendUserOperation.d.ts +11 -0
  85. package/_types/actions/evm/sendUserOperation.d.ts.map +1 -1
  86. package/_types/actions/evm/types.d.ts +1 -66
  87. package/_types/actions/evm/types.d.ts.map +1 -1
  88. package/_types/actions/solana/rpc.d.ts +10 -0
  89. package/_types/actions/solana/rpc.d.ts.map +1 -0
  90. package/_types/actions/solana/transfer.d.ts +37 -1
  91. package/_types/actions/solana/transfer.d.ts.map +1 -1
  92. package/_types/actions/solana/types.d.ts +1 -62
  93. package/_types/actions/solana/types.d.ts.map +1 -1
  94. package/_types/actions/solana/utils.d.ts +4 -6
  95. package/_types/actions/solana/utils.d.ts.map +1 -1
  96. package/_types/auth/utils/http.d.ts.map +1 -1
  97. package/_types/client/evm/evm.d.ts +29 -2
  98. package/_types/client/evm/evm.d.ts.map +1 -1
  99. package/_types/client/evm/evm.types.d.ts +20 -2
  100. package/_types/client/evm/evm.types.d.ts.map +1 -1
  101. package/_types/openapi-client/cdpApiClient.d.ts.map +1 -1
  102. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +44 -246
  103. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  104. package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts +8 -1
  105. package/_types/openapi-client/generated/end-user-accounts/end-user-accounts.d.ts.map +1 -1
  106. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +7 -1
  107. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
  108. package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts +11 -0
  109. package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts.map +1 -1
  110. package/_types/openapi-client/index.d.ts +3 -6
  111. package/_types/openapi-client/index.d.ts.map +1 -1
  112. package/_types/types/calls.d.ts +1 -0
  113. package/_types/types/calls.d.ts.map +1 -1
  114. package/_types/version.d.ts +1 -1
  115. package/accounts/evm/toEvmServerAccount.ts +0 -47
  116. package/accounts/evm/toEvmSmartAccount.ts +0 -47
  117. package/accounts/evm/toNetworkScopedEvmServerAccount.ts +0 -50
  118. package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +0 -49
  119. package/accounts/evm/types.ts +5 -49
  120. package/accounts/solana/toSolanaAccount.ts +0 -41
  121. package/actions/evm/sendUserOperation.ts +14 -0
  122. package/actions/evm/types.ts +1 -74
  123. package/actions/solana/rpc.ts +17 -0
  124. package/actions/solana/transfer.ts +115 -84
  125. package/actions/solana/types.ts +1 -70
  126. package/actions/solana/utils.ts +4 -6
  127. package/auth/utils/http.ts +5 -2
  128. package/auth/utils/jwt.ts +1 -1
  129. package/client/evm/evm.ts +61 -0
  130. package/client/evm/evm.types.ts +23 -0
  131. package/openapi-client/cdpApiClient.ts +5 -0
  132. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +53 -289
  133. package/openapi-client/generated/end-user-accounts/end-user-accounts.ts +14 -0
  134. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +23 -0
  135. package/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts +13 -0
  136. package/openapi-client/index.ts +0 -3
  137. package/package.json +5 -6
  138. package/types/calls.ts +1 -0
  139. package/version.ts +1 -1
  140. package/_cjs/actions/Quote.js +0 -106
  141. package/_cjs/actions/Quote.js.map +0 -1
  142. package/_cjs/actions/evm/fund/fund.js +0 -50
  143. package/_cjs/actions/evm/fund/fund.js.map +0 -1
  144. package/_cjs/actions/evm/fund/quoteFund.js +0 -47
  145. package/_cjs/actions/evm/fund/quoteFund.js.map +0 -1
  146. package/_cjs/actions/solana/fund/fund.js +0 -50
  147. package/_cjs/actions/solana/fund/fund.js.map +0 -1
  148. package/_cjs/actions/solana/fund/quoteFund.js +0 -47
  149. package/_cjs/actions/solana/fund/quoteFund.js.map +0 -1
  150. package/_cjs/actions/types.js +0 -3
  151. package/_cjs/actions/types.js.map +0 -1
  152. package/_cjs/actions/waitForFundOperationReceipt.js +0 -64
  153. package/_cjs/actions/waitForFundOperationReceipt.js.map +0 -1
  154. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.js +0 -50
  155. package/_cjs/openapi-client/generated/payments-alpha/payments-alpha.js.map +0 -1
  156. package/_esm/actions/Quote.js +0 -101
  157. package/_esm/actions/Quote.js.map +0 -1
  158. package/_esm/actions/evm/fund/fund.js +0 -47
  159. package/_esm/actions/evm/fund/fund.js.map +0 -1
  160. package/_esm/actions/evm/fund/quoteFund.js +0 -44
  161. package/_esm/actions/evm/fund/quoteFund.js.map +0 -1
  162. package/_esm/actions/solana/fund/fund.js +0 -47
  163. package/_esm/actions/solana/fund/fund.js.map +0 -1
  164. package/_esm/actions/solana/fund/quoteFund.js +0 -44
  165. package/_esm/actions/solana/fund/quoteFund.js.map +0 -1
  166. package/_esm/actions/types.js +0 -2
  167. package/_esm/actions/types.js.map +0 -1
  168. package/_esm/actions/waitForFundOperationReceipt.js +0 -61
  169. package/_esm/actions/waitForFundOperationReceipt.js.map +0 -1
  170. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.js +0 -42
  171. package/_esm/openapi-client/generated/payments-alpha/payments-alpha.js.map +0 -1
  172. package/_types/actions/Quote.d.ts +0 -97
  173. package/_types/actions/Quote.d.ts.map +0 -1
  174. package/_types/actions/evm/fund/fund.d.ts +0 -21
  175. package/_types/actions/evm/fund/fund.d.ts.map +0 -1
  176. package/_types/actions/evm/fund/quoteFund.d.ts +0 -22
  177. package/_types/actions/evm/fund/quoteFund.d.ts.map +0 -1
  178. package/_types/actions/solana/fund/fund.d.ts +0 -19
  179. package/_types/actions/solana/fund/fund.d.ts.map +0 -1
  180. package/_types/actions/solana/fund/quoteFund.d.ts +0 -20
  181. package/_types/actions/solana/fund/quoteFund.d.ts.map +0 -1
  182. package/_types/actions/types.d.ts +0 -37
  183. package/_types/actions/types.d.ts.map +0 -1
  184. package/_types/actions/waitForFundOperationReceipt.d.ts +0 -68
  185. package/_types/actions/waitForFundOperationReceipt.d.ts.map +0 -1
  186. package/_types/openapi-client/generated/payments-alpha/payments-alpha.d.ts +0 -42
  187. package/_types/openapi-client/generated/payments-alpha/payments-alpha.d.ts.map +0 -1
  188. package/actions/Quote.ts +0 -154
  189. package/actions/evm/fund/fund.ts +0 -73
  190. package/actions/evm/fund/quoteFund.ts +0 -79
  191. package/actions/solana/fund/fund.ts +0 -71
  192. package/actions/solana/fund/quoteFund.ts +0 -77
  193. package/actions/types.ts +0 -39
  194. package/actions/waitForFundOperationReceipt.ts +0 -118
  195. package/openapi-client/generated/payments-alpha/payments-alpha.ts +0 -96
@@ -8,8 +8,6 @@ import { transferWithViem } from "../../actions/evm/transfer/transferWithViem.js
8
8
  import { Analytics } from "../../analytics.js";
9
9
 
10
10
  import type { EvmServerAccount, NetworkScopedEvmServerAccount, DistributedOmit } from "./types.js";
11
- import type { EvmFundOptions } from "../../actions/evm/fund/fund.js";
12
- import type { EvmQuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
13
11
  import type { ListTokenBalancesOptions } from "../../actions/evm/listTokenBalances.js";
14
12
  import type { RequestFaucetOptions } from "../../actions/evm/requestFaucet.js";
15
13
  import type {
@@ -19,7 +17,6 @@ import type {
19
17
  import type { UseSpendPermissionOptions } from "../../actions/evm/spend-permissions/types.js";
20
18
  import type { AccountQuoteSwapOptions, AccountSwapOptions } from "../../actions/evm/swap/types.js";
21
19
  import type { TransferOptions } from "../../actions/evm/transfer/types.js";
22
- import type { WaitForFundOperationOptions } from "../../actions/waitForFundOperationReceipt.js";
23
20
  import type { EvmSwapsNetwork } from "../../openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js";
24
21
  import type {
25
22
  ListEvmTokenBalancesNetwork,
@@ -178,53 +175,6 @@ export async function toNetworkScopedEvmServerAccount<Network extends string>(
178
175
  });
179
176
  }
180
177
 
181
- if (isMethodSupportedOnNetwork("quoteFund", resolvedNetworkName)) {
182
- Object.assign(account, {
183
- quoteFund: async (quoteFundOptions: Omit<EvmQuoteFundOptions, "address">) => {
184
- Analytics.trackAction({
185
- action: "quote_fund",
186
- accountType: "evm_server",
187
- properties: {
188
- managed: true,
189
- },
190
- });
191
-
192
- return options.account.quoteFund({
193
- ...quoteFundOptions,
194
- });
195
- },
196
- });
197
- }
198
-
199
- if (isMethodSupportedOnNetwork("fund", resolvedNetworkName)) {
200
- Object.assign(account, {
201
- fund: async (fundOptions: Omit<EvmFundOptions, "address">) => {
202
- Analytics.trackAction({
203
- action: "fund",
204
- accountType: "evm_server",
205
- properties: {
206
- managed: true,
207
- },
208
- });
209
-
210
- return options.account.fund({
211
- ...fundOptions,
212
- });
213
- },
214
- waitForFundOperationReceipt: async (waitOptions: WaitForFundOperationOptions) => {
215
- Analytics.trackAction({
216
- action: "wait_for_fund_operation_receipt",
217
- accountType: "evm_server",
218
- properties: {
219
- managed: true,
220
- },
221
- });
222
-
223
- return options.account.waitForFundOperationReceipt(waitOptions);
224
- },
225
- });
226
- }
227
-
228
178
  if (isMethodSupportedOnNetwork("quoteSwap", resolvedNetworkName)) {
229
179
  Object.assign(account, {
230
180
  quoteSwap: async (quoteSwapOptions: DistributedOmit<AccountQuoteSwapOptions, "network">) => {
@@ -1,7 +1,5 @@
1
1
  import { getBaseNodeRpcUrl } from "./getBaseNodeRpcUrl.js";
2
2
  import { isMethodSupportedOnNetwork } from "./networkCapabilities.js";
3
- import { fund } from "../../actions/evm/fund/fund.js";
4
- import { quoteFund } from "../../actions/evm/fund/quoteFund.js";
5
3
  import { getUserOperation } from "../../actions/evm/getUserOperation.js";
6
4
  import { listTokenBalances } from "../../actions/evm/listTokenBalances.js";
7
5
  import { requestFaucet } from "../../actions/evm/requestFaucet.js";
@@ -12,7 +10,6 @@ import { sendSwapOperation } from "../../actions/evm/swap/sendSwapOperation.js";
12
10
  import { smartAccountTransferStrategy } from "../../actions/evm/transfer/smartAccountTransferStrategy.js";
13
11
  import { transfer } from "../../actions/evm/transfer/transfer.js";
14
12
  import { waitForUserOperation } from "../../actions/evm/waitForUserOperation.js";
15
- import { waitForFundOperationReceipt } from "../../actions/waitForFundOperationReceipt.js";
16
13
  import { Analytics } from "../../analytics.js";
17
14
 
18
15
  import type {
@@ -22,8 +19,6 @@ import type {
22
19
  NetworkScopedEvmSmartAccount,
23
20
  DistributedOmit,
24
21
  } from "./types.js";
25
- import type { EvmFundOptions } from "../../actions/evm/fund/fund.js";
26
- import type { EvmQuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
27
22
  import type { ListTokenBalancesOptions } from "../../actions/evm/listTokenBalances.js";
28
23
  import type { RequestFaucetOptions } from "../../actions/evm/requestFaucet.js";
29
24
  import type { SendUserOperationOptions } from "../../actions/evm/sendUserOperation.js";
@@ -34,7 +29,6 @@ import type {
34
29
  } from "../../actions/evm/swap/types.js";
35
30
  import type { SmartAccountTransferOptions } from "../../actions/evm/transfer/types.js";
36
31
  import type { WaitForUserOperationOptions } from "../../actions/evm/waitForUserOperation.js";
37
- import type { WaitForFundOperationOptions } from "../../actions/waitForFundOperationReceipt.js";
38
32
  import type { GetUserOperationOptions } from "../../client/evm/evm.types.js";
39
33
  import type {
40
34
  CdpOpenApiClientType,
@@ -206,49 +200,6 @@ export async function toNetworkScopedEvmSmartAccount<Network extends KnownEvmNet
206
200
  });
207
201
  }
208
202
 
209
- if (isMethodSupportedOnNetwork("quoteFund", options.network)) {
210
- Object.assign(account, {
211
- quoteFund: async (quoteOptions: Omit<EvmQuoteFundOptions, "address">) => {
212
- Analytics.trackAction({
213
- action: "quote_fund",
214
- accountType: "evm_smart",
215
- properties: {
216
- network: options.network,
217
- managed: true,
218
- },
219
- });
220
-
221
- return quoteFund(apiClient, {
222
- ...quoteOptions,
223
- address: options.smartAccount.address,
224
- });
225
- },
226
- });
227
- }
228
-
229
- if (isMethodSupportedOnNetwork("fund", options.network)) {
230
- Object.assign(account, {
231
- fund: async (fundOptions: Omit<EvmFundOptions, "address">) => {
232
- Analytics.trackAction({
233
- action: "fund",
234
- accountType: "evm_smart",
235
- properties: {
236
- network: options.network,
237
- managed: true,
238
- },
239
- });
240
-
241
- return fund(apiClient, {
242
- ...fundOptions,
243
- address: options.smartAccount.address,
244
- });
245
- },
246
- waitForFundOperationReceipt: async (waitOptions: WaitForFundOperationOptions) => {
247
- return waitForFundOperationReceipt(apiClient, waitOptions);
248
- },
249
- });
250
- }
251
-
252
203
  if (isMethodSupportedOnNetwork("quoteSwap", options.network)) {
253
204
  Object.assign(account, {
254
205
  quoteSwap: async (
@@ -5,14 +5,10 @@
5
5
  import {
6
6
  ListTokenBalancesNetworks,
7
7
  RequestFaucetNetworks,
8
- QuoteFundNetworks,
9
- FundNetworks,
10
8
  TransferNetworks,
11
- QuoteSwapNetworks,
12
9
  SwapNetworks,
10
+ QuoteSwapNetworks,
13
11
  } from "./networkCapabilities.js";
14
- import { EvmFundOptions } from "../../actions/evm/fund/fund.js";
15
- import { EvmQuoteFundOptions } from "../../actions/evm/fund/quoteFund.js";
16
12
  import {
17
13
  ListTokenBalancesOptions,
18
14
  ListTokenBalancesResult,
@@ -25,24 +21,19 @@ import {
25
21
  } from "../../actions/evm/sendUserOperation.js";
26
22
  import { UseSpendPermissionOptions } from "../../actions/evm/spend-permissions/types.js";
27
23
  import {
28
- AccountQuoteSwapOptions,
29
- AccountQuoteSwapResult,
30
24
  AccountSwapOptions,
31
25
  AccountSwapResult,
26
+ AccountQuoteSwapOptions,
27
+ AccountQuoteSwapResult,
32
28
  SmartAccountQuoteSwapOptions,
33
- SmartAccountQuoteSwapResult,
34
29
  SmartAccountSwapOptions,
35
30
  SmartAccountSwapResult,
31
+ SmartAccountQuoteSwapResult,
36
32
  } from "../../actions/evm/swap/types.js";
37
33
  import {
38
34
  WaitForUserOperationOptions,
39
35
  WaitForUserOperationReturnType,
40
36
  } from "../../actions/evm/waitForUserOperation.js";
41
- import { FundOperationResult } from "../../actions/types.js";
42
- import {
43
- WaitForFundOperationOptions,
44
- WaitForFundOperationResult,
45
- } from "../../actions/waitForFundOperationReceipt.js";
46
37
  import { GetUserOperationOptions, UserOperation } from "../../client/evm/evm.types.js";
47
38
  import { SpendPermissionNetwork } from "../../openapi-client/index.js";
48
39
 
@@ -51,7 +42,6 @@ import type {
51
42
  TransferOptions,
52
43
  } from "../../actions/evm/transfer/types.js";
53
44
  import type { AccountActions, SmartAccountActions } from "../../actions/evm/types.js";
54
- import type { EvmQuote } from "../../actions/Quote.js";
55
45
  import type { Address, Hash, Hex } from "../../types/misc.js";
56
46
  import type { Prettify } from "../../types/utils.js";
57
47
  import type {
@@ -220,30 +210,11 @@ export type NetworkSpecificSmartAccountActions<Network extends string> = Prettif
220
210
  ) => Promise<RequestFaucetResult>;
221
211
  }
222
212
  : EmptyObject) &
223
- // Conditionally include quoteFund
224
- (Network extends QuoteFundNetworks
225
- ? {
226
- quoteFund: (
227
- options: Omit<EvmQuoteFundOptions, "address" | "network">,
228
- ) => Promise<EvmQuote>;
229
- }
230
- : EmptyObject) &
231
- // Conditionally include fund
232
- (Network extends FundNetworks
233
- ? {
234
- fund: (
235
- options: Omit<EvmFundOptions, "address" | "network">,
236
- ) => Promise<FundOperationResult>;
237
- waitForFundOperationReceipt: (
238
- options: Omit<WaitForFundOperationOptions, "network">,
239
- ) => Promise<WaitForFundOperationResult>;
240
- }
241
- : EmptyObject) &
242
213
  // Conditionally include quoteSwap
243
214
  (Network extends QuoteSwapNetworks
244
215
  ? {
245
216
  quoteSwap: (
246
- options: Omit<SmartAccountQuoteSwapOptions, "network">,
217
+ options: DistributedOmit<SmartAccountQuoteSwapOptions, "network">,
247
218
  ) => Promise<SmartAccountQuoteSwapResult>;
248
219
  }
249
220
  : EmptyObject) &
@@ -314,21 +285,6 @@ export type NetworkSpecificAccountActions<Network extends string> = Prettify<
314
285
  ) => Promise<RequestFaucetResult>;
315
286
  }
316
287
  : EmptyObject) &
317
- // Conditionally include quoteFund
318
- (Network extends QuoteFundNetworks
319
- ? {
320
- quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>;
321
- }
322
- : EmptyObject) &
323
- // Conditionally include fund
324
- (Network extends FundNetworks
325
- ? {
326
- fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>;
327
- waitForFundOperationReceipt: (
328
- options: WaitForFundOperationOptions,
329
- ) => Promise<WaitForFundOperationResult>;
330
- }
331
- : EmptyObject) &
332
288
  // Conditionally include transfer
333
289
  (Network extends TransferNetworks
334
290
  ? {
@@ -1,18 +1,9 @@
1
1
  import { Account, SolanaAccount } from "./types.js";
2
- import { SolanaQuote } from "../../actions/Quote.js";
3
- import { SolanaFundOptions, fund } from "../../actions/solana/fund/fund.js";
4
- import { SolanaQuoteFundOptions, quoteFund } from "../../actions/solana/fund/quoteFund.js";
5
2
  import { requestFaucet } from "../../actions/solana/requestFaucet.js";
6
3
  import { sendTransaction, SendTransactionResult } from "../../actions/solana/sendTransaction.js";
7
4
  import { signMessage } from "../../actions/solana/signMessage.js";
8
5
  import { signTransaction, SignTransactionResult } from "../../actions/solana/signTransaction.js";
9
6
  import { transfer, type TransferOptions } from "../../actions/solana/transfer.js";
10
- import { FundOperationResult } from "../../actions/types.js";
11
- import {
12
- WaitForFundOperationOptions,
13
- WaitForFundOperationResult,
14
- waitForFundOperationReceipt,
15
- } from "../../actions/waitForFundOperationReceipt.js";
16
7
  import { Analytics } from "../../analytics.js";
17
8
  import {
18
9
  RequestFaucetOptions,
@@ -108,38 +99,6 @@ export function toSolanaAccount(
108
99
  from: account.address,
109
100
  });
110
101
  },
111
- async quoteFund(options: Omit<SolanaQuoteFundOptions, "address">): Promise<SolanaQuote> {
112
- Analytics.trackAction({
113
- action: "quote_fund",
114
- accountType: "solana",
115
- });
116
-
117
- return quoteFund(apiClient, {
118
- ...options,
119
- address: account.address,
120
- });
121
- },
122
- async fund(options: Omit<SolanaFundOptions, "address">): Promise<FundOperationResult> {
123
- Analytics.trackAction({
124
- action: "fund",
125
- accountType: "solana",
126
- });
127
-
128
- return fund(apiClient, {
129
- ...options,
130
- address: account.address,
131
- });
132
- },
133
- async waitForFundOperationReceipt(
134
- options: WaitForFundOperationOptions,
135
- ): Promise<WaitForFundOperationResult> {
136
- Analytics.trackAction({
137
- action: "wait_for_fund_operation_receipt",
138
- accountType: "solana",
139
- });
140
-
141
- return waitForFundOperationReceipt(apiClient, options);
142
- },
143
102
  };
144
103
 
145
104
  return account;
@@ -63,6 +63,18 @@ export type SendUserOperationReturnType = {
63
63
  userOpHash: Hex;
64
64
  };
65
65
 
66
+ /**
67
+ * Return type for the prepareAndSendUserOperation function.
68
+ */
69
+ export type PrepareAndSendUserOperationReturnType = {
70
+ /** The address of the smart wallet. */
71
+ smartAccountAddress: Address;
72
+ /** The status of the user operation. */
73
+ status: typeof EvmUserOperationStatus.broadcast;
74
+ /** The hash of the user operation. This is not the transaction hash which is only available after the operation is completed.*/
75
+ userOpHash: Hex;
76
+ };
77
+
66
78
  /**
67
79
  * Sends a user operation to the network.
68
80
  *
@@ -132,6 +144,7 @@ export async function sendUserOperation<T extends readonly unknown[]>(
132
144
  args: call.args,
133
145
  }),
134
146
  value,
147
+ overrideGasLimit: call.overrideGasLimit,
135
148
  };
136
149
  }
137
150
 
@@ -139,6 +152,7 @@ export async function sendUserOperation<T extends readonly unknown[]>(
139
152
  to: call.to,
140
153
  data: call.data ?? "0x",
141
154
  value,
155
+ overrideGasLimit: call.overrideGasLimit,
142
156
  };
143
157
  });
144
158
 
@@ -2,14 +2,8 @@
2
2
  * @module Actions
3
3
  */
4
4
 
5
- import { FundOperationResult } from "../types.js";
6
- import {
7
- WaitForFundOperationOptions,
8
- WaitForFundOperationResult,
9
- } from "../waitForFundOperationReceipt.js";
10
- import { EvmFundOptions } from "./fund/fund.js";
11
- import { EvmQuoteFundOptions } from "./fund/quoteFund.js";
12
5
  import { SendUserOperationOptions, SendUserOperationReturnType } from "./sendUserOperation.js";
6
+ import { UseSpendPermissionOptions } from "./spend-permissions/types.js";
13
7
  import { KnownEvmNetworks } from "../../accounts/evm/types.js";
14
8
  import {
15
9
  GetUserOperationOptions,
@@ -17,8 +11,6 @@ import {
17
11
  UserOperation,
18
12
  } from "../../client/evm/evm.types.js";
19
13
  import { Hex } from "../../types/misc.js";
20
- import { EvmQuote } from "../Quote.js";
21
- import { UseSpendPermissionOptions } from "./spend-permissions/types.js";
22
14
 
23
15
  import type { ListTokenBalancesOptions, ListTokenBalancesResult } from "./listTokenBalances.js";
24
16
  import type { RequestFaucetOptions, RequestFaucetResult } from "./requestFaucet.js";
@@ -78,71 +70,6 @@ export type Actions = {
78
70
  * ```
79
71
  */
80
72
  requestFaucet: (options: Omit<RequestFaucetOptions, "address">) => Promise<RequestFaucetResult>;
81
-
82
- /**
83
- * Gets a quote to fund an EVM account.
84
- *
85
- * @param options - The options for the quote fund.
86
- * @param options.network - The network to fund the account on.
87
- * @param options.token - The token to fund the account with.
88
- * @param options.amount - The amount of the token to fund represented as an atomic unit.
89
- * It's common to use `parseUnits` utils from viem to convert to atomic units.
90
- * Otherwise, you can pass atomic units directly.
91
- *
92
- * @returns A promise that resolves to a Quote object containing details about the funding operation.
93
- *
94
- * @example
95
- * ```ts
96
- * const quote = await account.quoteFund({
97
- * network: "base",
98
- * token: "usdc",
99
- * amount: 1000000n,
100
- * });
101
- * ```
102
- */
103
- quoteFund: (options: Omit<EvmQuoteFundOptions, "address">) => Promise<EvmQuote>;
104
-
105
- /**
106
- * Funds an EVM account with the specified token amount.
107
- *
108
- * @param options - The options for the fund operation.
109
- * @param options.network - The network to fund the account on.
110
- * @param options.token - The token to fund the account with (e.g., 'usdc').
111
- * @param options.amount - The amount of the token to fund represented as an atomic unit.
112
- * It's common to use `parseUnits` utils from viem to convert to atomic units.
113
- * Otherwise, you can pass atomic units directly.
114
- *
115
- * @returns A promise that resolves to the fund operation result containing the transfer details.
116
- *
117
- * @example
118
- * ```ts
119
- * const fundOperation = await account.fund({
120
- * network: "base",
121
- * token: "usdc",
122
- * amount: 1000000n,
123
- * });
124
- * ```
125
- */
126
- fund: (options: Omit<EvmFundOptions, "address">) => Promise<FundOperationResult>;
127
-
128
- /**
129
- * Waits for a fund operation to complete and returns the transfer receipt.
130
- *
131
- * @param options - The options for the wait for fund operation.
132
- * @param options.transferId - The ID of the transfer to wait for.
133
- *
134
- * @returns A promise that resolves to the completed transfer receipt containing details about the funding operation.
135
- *
136
- * @example
137
- * ```ts
138
- * const completedTransfer = await account.waitForFundOperationReceipt({
139
- * transferId: "transfer_123",
140
- * });
141
- * ```
142
- */
143
- waitForFundOperationReceipt(
144
- options: WaitForFundOperationOptions,
145
- ): Promise<WaitForFundOperationResult>;
146
73
  };
147
74
 
148
75
  export type AccountActions = Actions & {
@@ -0,0 +1,17 @@
1
+ import { createSolanaRpc } from "@solana/kit";
2
+
3
+ import type { Network } from "./utils.js";
4
+
5
+ /**
6
+ * Create a Solana RPC client for the given network
7
+ *
8
+ * @param network - The network to connect to
9
+ *
10
+ * @returns The RPC client
11
+ */
12
+ export function createRpcClient(network: Network) {
13
+ const endpoint =
14
+ network === "mainnet" ? "https://api.mainnet-beta.solana.com" : "https://api.devnet.solana.com";
15
+
16
+ return createSolanaRpc(endpoint);
17
+ }