@distilled.cloud/coinbase 0.17.0 → 0.18.1

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 (71) hide show
  1. package/lib/credentials.d.ts +1 -1
  2. package/lib/credentials.d.ts.map +1 -1
  3. package/lib/credentials.js +16 -10
  4. package/lib/credentials.js.map +1 -1
  5. package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.d.ts +51 -0
  6. package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.d.ts.map +1 -0
  7. package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.js +62 -0
  8. package/lib/operations/createEvmEip7702DelegationWithEndUserAccount.js.map +1 -0
  9. package/lib/operations/getDelegationForEndUser.d.ts +25 -0
  10. package/lib/operations/getDelegationForEndUser.d.ts.map +1 -0
  11. package/lib/operations/getDelegationForEndUser.js +31 -0
  12. package/lib/operations/getDelegationForEndUser.js.map +1 -0
  13. package/lib/operations/revokeDelegationForEndUser.d.ts +32 -0
  14. package/lib/operations/revokeDelegationForEndUser.d.ts.map +1 -0
  15. package/lib/operations/revokeDelegationForEndUser.js +40 -0
  16. package/lib/operations/revokeDelegationForEndUser.js.map +1 -0
  17. package/lib/operations/sendEvmAssetWithEndUserAccount.d.ts +58 -0
  18. package/lib/operations/sendEvmAssetWithEndUserAccount.d.ts.map +1 -0
  19. package/lib/operations/sendEvmAssetWithEndUserAccount.js +68 -0
  20. package/lib/operations/sendEvmAssetWithEndUserAccount.js.map +1 -0
  21. package/lib/operations/sendEvmTransactionWithEndUserAccount.d.ts +61 -0
  22. package/lib/operations/sendEvmTransactionWithEndUserAccount.d.ts.map +1 -0
  23. package/lib/operations/sendEvmTransactionWithEndUserAccount.js +76 -0
  24. package/lib/operations/sendEvmTransactionWithEndUserAccount.js.map +1 -0
  25. package/lib/operations/sendSolanaAssetWithEndUserAccount.d.ts +57 -0
  26. package/lib/operations/sendSolanaAssetWithEndUserAccount.d.ts.map +1 -0
  27. package/lib/operations/sendSolanaAssetWithEndUserAccount.js +56 -0
  28. package/lib/operations/sendSolanaAssetWithEndUserAccount.js.map +1 -0
  29. package/lib/operations/sendSolanaTransactionWithEndUserAccount.d.ts +60 -0
  30. package/lib/operations/sendSolanaTransactionWithEndUserAccount.d.ts.map +1 -0
  31. package/lib/operations/sendSolanaTransactionWithEndUserAccount.js +62 -0
  32. package/lib/operations/sendSolanaTransactionWithEndUserAccount.js.map +1 -0
  33. package/lib/operations/sendUserOperationWithEndUserAccount.d.ts +100 -0
  34. package/lib/operations/sendUserOperationWithEndUserAccount.d.ts.map +1 -0
  35. package/lib/operations/sendUserOperationWithEndUserAccount.js +105 -0
  36. package/lib/operations/sendUserOperationWithEndUserAccount.js.map +1 -0
  37. package/lib/operations/signEvmMessageWithEndUserAccount.d.ts +44 -0
  38. package/lib/operations/signEvmMessageWithEndUserAccount.d.ts.map +1 -0
  39. package/lib/operations/signEvmMessageWithEndUserAccount.js +48 -0
  40. package/lib/operations/signEvmMessageWithEndUserAccount.js.map +1 -0
  41. package/lib/operations/signEvmTransactionWithEndUserAccount.d.ts +45 -0
  42. package/lib/operations/signEvmTransactionWithEndUserAccount.d.ts.map +1 -0
  43. package/lib/operations/signEvmTransactionWithEndUserAccount.js +49 -0
  44. package/lib/operations/signEvmTransactionWithEndUserAccount.js.map +1 -0
  45. package/lib/operations/signEvmTypedDataWithEndUserAccount.d.ts +65 -0
  46. package/lib/operations/signEvmTypedDataWithEndUserAccount.d.ts.map +1 -0
  47. package/lib/operations/signEvmTypedDataWithEndUserAccount.js +58 -0
  48. package/lib/operations/signEvmTypedDataWithEndUserAccount.js.map +1 -0
  49. package/lib/operations/signSolanaMessageWithEndUserAccount.d.ts +44 -0
  50. package/lib/operations/signSolanaMessageWithEndUserAccount.d.ts.map +1 -0
  51. package/lib/operations/signSolanaMessageWithEndUserAccount.js +48 -0
  52. package/lib/operations/signSolanaMessageWithEndUserAccount.js.map +1 -0
  53. package/lib/operations/signSolanaTransactionWithEndUserAccount.d.ts +49 -0
  54. package/lib/operations/signSolanaTransactionWithEndUserAccount.d.ts.map +1 -0
  55. package/lib/operations/signSolanaTransactionWithEndUserAccount.js +53 -0
  56. package/lib/operations/signSolanaTransactionWithEndUserAccount.js.map +1 -0
  57. package/package.json +2 -2
  58. package/src/credentials.ts +24 -10
  59. package/src/operations/createEvmEip7702DelegationWithEndUserAccount.ts +70 -0
  60. package/src/operations/getDelegationForEndUser.ts +41 -0
  61. package/src/operations/revokeDelegationForEndUser.ts +50 -0
  62. package/src/operations/sendEvmAssetWithEndUserAccount.ts +76 -0
  63. package/src/operations/sendEvmTransactionWithEndUserAccount.ts +84 -0
  64. package/src/operations/sendSolanaAssetWithEndUserAccount.ts +64 -0
  65. package/src/operations/sendSolanaTransactionWithEndUserAccount.ts +70 -0
  66. package/src/operations/sendUserOperationWithEndUserAccount.ts +123 -0
  67. package/src/operations/signEvmMessageWithEndUserAccount.ts +56 -0
  68. package/src/operations/signEvmTransactionWithEndUserAccount.ts +57 -0
  69. package/src/operations/signEvmTypedDataWithEndUserAccount.ts +66 -0
  70. package/src/operations/signSolanaMessageWithEndUserAccount.ts +56 -0
  71. package/src/operations/signSolanaTransactionWithEndUserAccount.ts +61 -0
@@ -0,0 +1,76 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SendEvmAssetWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ address: Schema.String.pipe(T.PathParam()),
10
+ asset: Schema.Literals(["usdc"]).pipe(T.PathParam()),
11
+ projectID: Schema.optional(Schema.String),
12
+ to: Schema.String,
13
+ amount: Schema.String,
14
+ network: Schema.Literals([
15
+ "base",
16
+ "base-sepolia",
17
+ "ethereum",
18
+ "ethereum-sepolia",
19
+ "avalanche",
20
+ "polygon",
21
+ "optimism",
22
+ "arbitrum",
23
+ "arbitrum-sepolia",
24
+ "world",
25
+ "world-sepolia",
26
+ ]),
27
+ useCdpPaymaster: Schema.optional(Schema.Boolean),
28
+ paymasterUrl: Schema.optional(Schema.String),
29
+ walletSecretId: Schema.optional(Schema.String),
30
+ }).pipe(
31
+ T.Http({
32
+ method: "POST",
33
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/{address}/send/{asset}",
34
+ }),
35
+ );
36
+ export type SendEvmAssetWithEndUserAccountInput =
37
+ typeof SendEvmAssetWithEndUserAccountInput.Type;
38
+
39
+ // Output Schema
40
+ export const SendEvmAssetWithEndUserAccountOutput =
41
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
42
+ transactionHash: Schema.optional(Schema.NullOr(Schema.String)),
43
+ userOpHash: Schema.optional(Schema.NullOr(Schema.String)),
44
+ });
45
+ export type SendEvmAssetWithEndUserAccountOutput =
46
+ typeof SendEvmAssetWithEndUserAccountOutput.Type;
47
+
48
+ // The operation
49
+ /**
50
+ * Send USDC on EVM
51
+ *
52
+ * Sends USDC from an end user's EVM account (EOA or Smart Account) to a recipient address on a supported EVM network. This endpoint simplifies USDC transfers by automatically handling contract resolution, decimal conversion, gas estimation, and transaction encoding.
53
+ * The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50").
54
+ *
55
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
56
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
57
+ section of our Authentication docs for more details on how to generate your Wallet Token.
58
+
59
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
60
+ When included, duplicate requests with the same key will return identical responses.
61
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
62
+
63
+ * @param userId - The ID of the end user.
64
+ * @param address - The 0x-prefixed address of the EVM account (EOA or Smart Account) to send USDC from. The address does not need to be checksummed.
65
+ * @param asset - The asset to send. Currently only "usdc" is supported.
66
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
67
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
68
+ section of our Authentication docs for more details on how to generate your Wallet Token.
69
+
70
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
71
+ */
72
+ export const sendEvmAssetWithEndUserAccount =
73
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
74
+ inputSchema: SendEvmAssetWithEndUserAccountInput,
75
+ outputSchema: SendEvmAssetWithEndUserAccountOutput,
76
+ }));
@@ -0,0 +1,84 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SendEvmTransactionWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ projectID: Schema.optional(Schema.String),
10
+ address: Schema.String,
11
+ network: Schema.Literals([
12
+ "base",
13
+ "base-sepolia",
14
+ "ethereum",
15
+ "ethereum-sepolia",
16
+ "avalanche",
17
+ "polygon",
18
+ "optimism",
19
+ "arbitrum",
20
+ "arbitrum-sepolia",
21
+ "world",
22
+ "world-sepolia",
23
+ ]),
24
+ walletSecretId: Schema.optional(Schema.String),
25
+ transaction: Schema.String,
26
+ }).pipe(
27
+ T.Http({
28
+ method: "POST",
29
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/send/transaction",
30
+ }),
31
+ );
32
+ export type SendEvmTransactionWithEndUserAccountInput =
33
+ typeof SendEvmTransactionWithEndUserAccountInput.Type;
34
+
35
+ // Output Schema
36
+ export const SendEvmTransactionWithEndUserAccountOutput =
37
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
38
+ transactionHash: Schema.String,
39
+ });
40
+ export type SendEvmTransactionWithEndUserAccountOutput =
41
+ typeof SendEvmTransactionWithEndUserAccountOutput.Type;
42
+
43
+ // The operation
44
+ /**
45
+ * Send a transaction with end user EVM account
46
+ *
47
+ * Signs a transaction with the given end user EVM account and sends it to the indicated supported network. This API handles nonce management and gas estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction. The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/).
48
+ * The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md).
49
+ * **Transaction fields and API behavior**
50
+ * - `to` *(Required)*: The address of the contract or account to send the transaction to.
51
+ * - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored.
52
+ * The transaction will be sent to the network indicated by the `network` field in the request body.
53
+ * - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign
54
+ * a nonce to the transaction based on the current state of the account.
55
+ * - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction.
56
+ * If not provided, the API will estimate a value based on current network conditions.
57
+ * - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction.
58
+ * If not provided, the API will estimate a value based on current network conditions.
59
+ * - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value
60
+ * based on the `to` and `data` fields of the transaction.
61
+ * - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction.
62
+ * - `data` *(Optional)*: The data to send with the transaction; only used for contract calls.
63
+ * - `accessList` *(Optional)*: The access list to use for the transaction.
64
+ *
65
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
66
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
67
+ section of our Authentication docs for more details on how to generate your Wallet Token.
68
+
69
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
70
+ When included, duplicate requests with the same key will return identical responses.
71
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
72
+
73
+ * @param userId - The ID of the end user.
74
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
75
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
76
+ section of our Authentication docs for more details on how to generate your Wallet Token.
77
+
78
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
79
+ */
80
+ export const sendEvmTransactionWithEndUserAccount =
81
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
82
+ inputSchema: SendEvmTransactionWithEndUserAccountInput,
83
+ outputSchema: SendEvmTransactionWithEndUserAccountOutput,
84
+ }));
@@ -0,0 +1,64 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SendSolanaAssetWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ address: Schema.String.pipe(T.PathParam()),
10
+ asset: Schema.Literals(["usdc"]).pipe(T.PathParam()),
11
+ projectID: Schema.optional(Schema.String),
12
+ to: Schema.String,
13
+ amount: Schema.String,
14
+ network: Schema.Literals(["solana", "solana-devnet"]),
15
+ createRecipientAta: Schema.optional(Schema.Boolean),
16
+ walletSecretId: Schema.optional(Schema.String),
17
+ useCdpSponsor: Schema.optional(Schema.Boolean),
18
+ }).pipe(
19
+ T.Http({
20
+ method: "POST",
21
+ path: "/v2/embedded-wallet-api/end-users/{userId}/solana/{address}/send/{asset}",
22
+ }),
23
+ );
24
+ export type SendSolanaAssetWithEndUserAccountInput =
25
+ typeof SendSolanaAssetWithEndUserAccountInput.Type;
26
+
27
+ // Output Schema
28
+ export const SendSolanaAssetWithEndUserAccountOutput =
29
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
30
+ transactionSignature: Schema.String,
31
+ });
32
+ export type SendSolanaAssetWithEndUserAccountOutput =
33
+ typeof SendSolanaAssetWithEndUserAccountOutput.Type;
34
+
35
+ // The operation
36
+ /**
37
+ * Send USDC on Solana
38
+ *
39
+ * Sends USDC from an end user's Solana account to a recipient address on the Solana network. This endpoint simplifies USDC transfers by automatically handling mint resolution, Associated Token Account (ATA) creation, decimal conversion, and transaction encoding.
40
+ * The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50").
41
+ * Use the optional `createRecipientAta` parameter to control whether the sender pays for creating the recipient's Associated Token Account if it doesn't exist.
42
+ *
43
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
44
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
45
+ section of our Authentication docs for more details on how to generate your Wallet Token.
46
+
47
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
48
+ When included, duplicate requests with the same key will return identical responses.
49
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
50
+
51
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
52
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
53
+ section of our Authentication docs for more details on how to generate your Wallet Token.
54
+
55
+ * @param userId - The ID of the end user.
56
+ * @param address - The base58 encoded address of the Solana account to send USDC from.
57
+ * @param asset - The asset to send. Currently only "usdc" is supported.
58
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
59
+ */
60
+ export const sendSolanaAssetWithEndUserAccount =
61
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
62
+ inputSchema: SendSolanaAssetWithEndUserAccountInput,
63
+ outputSchema: SendSolanaAssetWithEndUserAccountOutput,
64
+ }));
@@ -0,0 +1,70 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SendSolanaTransactionWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ projectID: Schema.optional(Schema.String),
10
+ address: Schema.String,
11
+ network: Schema.Literals(["solana", "solana-devnet"]),
12
+ walletSecretId: Schema.optional(Schema.String),
13
+ transaction: Schema.String,
14
+ useCdpSponsor: Schema.optional(Schema.Boolean),
15
+ }).pipe(
16
+ T.Http({
17
+ method: "POST",
18
+ path: "/v2/embedded-wallet-api/end-users/{userId}/solana/send/transaction",
19
+ }),
20
+ );
21
+ export type SendSolanaTransactionWithEndUserAccountInput =
22
+ typeof SendSolanaTransactionWithEndUserAccountInput.Type;
23
+
24
+ // Output Schema
25
+ export const SendSolanaTransactionWithEndUserAccountOutput =
26
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
27
+ transactionSignature: Schema.String,
28
+ });
29
+ export type SendSolanaTransactionWithEndUserAccountOutput =
30
+ typeof SendSolanaTransactionWithEndUserAccountOutput.Type;
31
+
32
+ // The operation
33
+ /**
34
+ * Send a transaction with end user Solana account
35
+ *
36
+ * Signs a transaction with the given end user Solana account and sends it to the indicated supported network.
37
+ * The API handles recent blockhash management and fee estimation, leaving the developer to provide only the minimal set of fields necessary to send the transaction.
38
+ * The unsigned transaction should be serialized into a byte array and then encoded as base64.
39
+ * **Transaction types**
40
+ * The following transaction types are supported:
41
+ * * [Legacy transactions](https://solana.com/developers/guides/advanced/versions#current-transaction-versions)
42
+ * * [Versioned transactions](https://solana.com/developers/guides/advanced/versions)
43
+ * **Instruction Batching**
44
+ * To batch multiple operations, include multiple instructions within a single transaction. All instructions within a transaction are executed atomically - if any instruction fails, the entire transaction fails and is rolled back.
45
+ * **Network Support**
46
+ * The following Solana networks are supported:
47
+ * * `solana` - Solana Mainnet
48
+ * * `solana-devnet` - Solana Devnet
49
+ * The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction.
50
+ *
51
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
52
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
53
+ section of our Authentication docs for more details on how to generate your Wallet Token.
54
+
55
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
56
+ When included, duplicate requests with the same key will return identical responses.
57
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
58
+
59
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
60
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
61
+ section of our Authentication docs for more details on how to generate your Wallet Token.
62
+
63
+ * @param userId - The ID of the end user.
64
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
65
+ */
66
+ export const sendSolanaTransactionWithEndUserAccount =
67
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
68
+ inputSchema: SendSolanaTransactionWithEndUserAccountInput,
69
+ outputSchema: SendSolanaTransactionWithEndUserAccountOutput,
70
+ }));
@@ -0,0 +1,123 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SendUserOperationWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ address: Schema.String.pipe(T.PathParam()),
10
+ projectID: Schema.optional(Schema.String),
11
+ network: Schema.Literals([
12
+ "base-sepolia",
13
+ "base",
14
+ "arbitrum",
15
+ "optimism",
16
+ "zora",
17
+ "polygon",
18
+ "bnb",
19
+ "avalanche",
20
+ "ethereum",
21
+ "ethereum-sepolia",
22
+ ]),
23
+ calls: Schema.Array(
24
+ Schema.Struct({
25
+ to: Schema.String,
26
+ value: Schema.String,
27
+ data: Schema.String,
28
+ overrideGasLimit: Schema.optional(Schema.String),
29
+ }),
30
+ ),
31
+ useCdpPaymaster: Schema.Boolean,
32
+ paymasterUrl: Schema.optional(Schema.String),
33
+ walletSecretId: Schema.optional(Schema.String),
34
+ dataSuffix: Schema.optional(Schema.String),
35
+ }).pipe(
36
+ T.Http({
37
+ method: "POST",
38
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/smart-accounts/{address}/send",
39
+ }),
40
+ );
41
+ export type SendUserOperationWithEndUserAccountInput =
42
+ typeof SendUserOperationWithEndUserAccountInput.Type;
43
+
44
+ // Output Schema
45
+ export const SendUserOperationWithEndUserAccountOutput =
46
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
47
+ network: Schema.Literals([
48
+ "base-sepolia",
49
+ "base",
50
+ "arbitrum",
51
+ "optimism",
52
+ "zora",
53
+ "polygon",
54
+ "bnb",
55
+ "avalanche",
56
+ "ethereum",
57
+ "ethereum-sepolia",
58
+ ]),
59
+ userOpHash: Schema.String,
60
+ calls: Schema.Array(
61
+ Schema.Struct({
62
+ to: Schema.String,
63
+ value: Schema.String,
64
+ data: Schema.String,
65
+ overrideGasLimit: Schema.optional(Schema.String),
66
+ }),
67
+ ),
68
+ status: Schema.Literals([
69
+ "pending",
70
+ "signed",
71
+ "broadcast",
72
+ "complete",
73
+ "dropped",
74
+ "failed",
75
+ ]),
76
+ transactionHash: Schema.optional(Schema.String),
77
+ receipts: Schema.optional(
78
+ Schema.Array(
79
+ Schema.Struct({
80
+ revert: Schema.optional(
81
+ Schema.Struct({
82
+ data: Schema.String,
83
+ message: Schema.String,
84
+ }),
85
+ ),
86
+ transactionHash: Schema.optional(Schema.String),
87
+ blockHash: Schema.optional(Schema.String),
88
+ blockNumber: Schema.optional(Schema.Number),
89
+ gasUsed: Schema.optional(Schema.String),
90
+ }),
91
+ ),
92
+ ),
93
+ });
94
+ export type SendUserOperationWithEndUserAccountOutput =
95
+ typeof SendUserOperationWithEndUserAccountOutput.Type;
96
+
97
+ // The operation
98
+ /**
99
+ * Send a user operation for end user Smart Account
100
+ *
101
+ * Prepares, signs, and sends a user operation for an end user's Smart Account.
102
+ *
103
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
104
+ When included, duplicate requests with the same key will return identical responses.
105
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
106
+
107
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
108
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
109
+ section of our Authentication docs for more details on how to generate your Wallet Token.
110
+
111
+ * @param userId - The ID of the end user.
112
+ * @param address - The address of the EVM Smart Account to execute the user operation from.
113
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
114
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
115
+ section of our Authentication docs for more details on how to generate your Wallet Token.
116
+
117
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
118
+ */
119
+ export const sendUserOperationWithEndUserAccount =
120
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
121
+ inputSchema: SendUserOperationWithEndUserAccountInput,
122
+ outputSchema: SendUserOperationWithEndUserAccountOutput,
123
+ }));
@@ -0,0 +1,56 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SignEvmMessageWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ projectID: Schema.optional(Schema.String),
10
+ address: Schema.String,
11
+ message: Schema.String,
12
+ walletSecretId: Schema.optional(Schema.String),
13
+ }).pipe(
14
+ T.Http({
15
+ method: "POST",
16
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/sign/message",
17
+ }),
18
+ );
19
+ export type SignEvmMessageWithEndUserAccountInput =
20
+ typeof SignEvmMessageWithEndUserAccountInput.Type;
21
+
22
+ // Output Schema
23
+ export const SignEvmMessageWithEndUserAccountOutput =
24
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
25
+ signature: Schema.String,
26
+ });
27
+ export type SignEvmMessageWithEndUserAccountOutput =
28
+ typeof SignEvmMessageWithEndUserAccountOutput.Type;
29
+
30
+ // The operation
31
+ /**
32
+ * Sign an EIP-191 message with end user EVM account
33
+ *
34
+ * Signs an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) message with the given end user EVM account.
35
+ * Per the specification, the message in the request body is prepended with `0x19 <0x45 (E)> <thereum Signed Message:\\n" + len(message)>` before being signed.
36
+ *
37
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
38
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
39
+ section of our Authentication docs for more details on how to generate your Wallet Token.
40
+
41
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
42
+ When included, duplicate requests with the same key will return identical responses.
43
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
44
+
45
+ * @param userId - The ID of the end user.
46
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
47
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
48
+ section of our Authentication docs for more details on how to generate your Wallet Token.
49
+
50
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
51
+ */
52
+ export const signEvmMessageWithEndUserAccount =
53
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
54
+ inputSchema: SignEvmMessageWithEndUserAccountInput,
55
+ outputSchema: SignEvmMessageWithEndUserAccountOutput,
56
+ }));
@@ -0,0 +1,57 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SignEvmTransactionWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ projectID: Schema.optional(Schema.String),
10
+ address: Schema.String,
11
+ transaction: Schema.String,
12
+ walletSecretId: Schema.optional(Schema.String),
13
+ }).pipe(
14
+ T.Http({
15
+ method: "POST",
16
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/sign/transaction",
17
+ }),
18
+ );
19
+ export type SignEvmTransactionWithEndUserAccountInput =
20
+ typeof SignEvmTransactionWithEndUserAccountInput.Type;
21
+
22
+ // Output Schema
23
+ export const SignEvmTransactionWithEndUserAccountOutput =
24
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
25
+ signedTransaction: Schema.String,
26
+ });
27
+ export type SignEvmTransactionWithEndUserAccountOutput =
28
+ typeof SignEvmTransactionWithEndUserAccountOutput.Type;
29
+
30
+ // The operation
31
+ /**
32
+ * Sign a transaction with end user EVM account
33
+ *
34
+ * Signs a transaction with the given end user EVM account.
35
+ * The transaction should be serialized as a hex string using [RLP](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/).
36
+ * The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md). The developer is responsible for ensuring that the unsigned transaction is valid, as the API will not validate the transaction.
37
+ *
38
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
39
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
40
+ section of our Authentication docs for more details on how to generate your Wallet Token.
41
+
42
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
43
+ When included, duplicate requests with the same key will return identical responses.
44
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
45
+
46
+ * @param userId - The ID of the end user.
47
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
48
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
49
+ section of our Authentication docs for more details on how to generate your Wallet Token.
50
+
51
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
52
+ */
53
+ export const signEvmTransactionWithEndUserAccount =
54
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
55
+ inputSchema: SignEvmTransactionWithEndUserAccountInput,
56
+ outputSchema: SignEvmTransactionWithEndUserAccountOutput,
57
+ }));
@@ -0,0 +1,66 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SignEvmTypedDataWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ projectID: Schema.optional(Schema.String),
10
+ address: Schema.String,
11
+ typedData: Schema.Struct({
12
+ domain: Schema.Struct({
13
+ name: Schema.optional(Schema.String),
14
+ version: Schema.optional(Schema.String),
15
+ chainId: Schema.optional(Schema.Number),
16
+ verifyingContract: Schema.optional(Schema.String),
17
+ salt: Schema.optional(Schema.String),
18
+ }),
19
+ types: Schema.Unknown,
20
+ primaryType: Schema.String,
21
+ message: Schema.Unknown,
22
+ }),
23
+ walletSecretId: Schema.optional(Schema.String),
24
+ }).pipe(
25
+ T.Http({
26
+ method: "POST",
27
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/sign/typed-data",
28
+ }),
29
+ );
30
+ export type SignEvmTypedDataWithEndUserAccountInput =
31
+ typeof SignEvmTypedDataWithEndUserAccountInput.Type;
32
+
33
+ // Output Schema
34
+ export const SignEvmTypedDataWithEndUserAccountOutput =
35
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
36
+ signature: Schema.String,
37
+ });
38
+ export type SignEvmTypedDataWithEndUserAccountOutput =
39
+ typeof SignEvmTypedDataWithEndUserAccountOutput.Type;
40
+
41
+ // The operation
42
+ /**
43
+ * Sign EIP-712 typed data with end user EVM account
44
+ *
45
+ * Signs [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data with the given end user EVM account.
46
+ *
47
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
48
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
49
+ section of our Authentication docs for more details on how to generate your Wallet Token.
50
+
51
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
52
+ When included, duplicate requests with the same key will return identical responses.
53
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
54
+
55
+ * @param userId - The ID of the end user.
56
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
57
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
58
+ section of our Authentication docs for more details on how to generate your Wallet Token.
59
+
60
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
61
+ */
62
+ export const signEvmTypedDataWithEndUserAccount =
63
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
64
+ inputSchema: SignEvmTypedDataWithEndUserAccountInput,
65
+ outputSchema: SignEvmTypedDataWithEndUserAccountOutput,
66
+ }));
@@ -0,0 +1,56 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.ts";
3
+ import * as T from "../traits.ts";
4
+
5
+ // Input Schema
6
+ export const SignSolanaMessageWithEndUserAccountInput =
7
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
8
+ userId: Schema.String.pipe(T.PathParam()),
9
+ projectID: Schema.optional(Schema.String),
10
+ address: Schema.String,
11
+ message: Schema.String,
12
+ walletSecretId: Schema.optional(Schema.String),
13
+ }).pipe(
14
+ T.Http({
15
+ method: "POST",
16
+ path: "/v2/embedded-wallet-api/end-users/{userId}/solana/sign/message",
17
+ }),
18
+ );
19
+ export type SignSolanaMessageWithEndUserAccountInput =
20
+ typeof SignSolanaMessageWithEndUserAccountInput.Type;
21
+
22
+ // Output Schema
23
+ export const SignSolanaMessageWithEndUserAccountOutput =
24
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
25
+ signature: Schema.String,
26
+ });
27
+ export type SignSolanaMessageWithEndUserAccountOutput =
28
+ typeof SignSolanaMessageWithEndUserAccountOutput.Type;
29
+
30
+ // The operation
31
+ /**
32
+ * Sign a Base64 encoded message
33
+ *
34
+ * Signs an arbitrary Base64 encoded message with the given Solana account.
35
+ * **WARNING:** Never sign a message that you didn't generate as it may put your funds at risk.
36
+ *
37
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
38
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
39
+ section of our Authentication docs for more details on how to generate your Wallet Token.
40
+
41
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
42
+ When included, duplicate requests with the same key will return identical responses.
43
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
44
+
45
+ * @param userId - The ID of the end user.
46
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
47
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
48
+ section of our Authentication docs for more details on how to generate your Wallet Token.
49
+
50
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
51
+ */
52
+ export const signSolanaMessageWithEndUserAccount =
53
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
54
+ inputSchema: SignSolanaMessageWithEndUserAccountInput,
55
+ outputSchema: SignSolanaMessageWithEndUserAccountOutput,
56
+ }));