@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
@@ -1,6 +1,6 @@
1
+ import * as Context from "effect/Context";
1
2
  import * as Layer from "effect/Layer";
2
3
  import * as Redacted from "effect/Redacted";
3
- import * as Context from "effect/Context";
4
4
  import { ConfigError } from "@distilled.cloud/core/errors";
5
5
  export declare const DEFAULT_API_BASE_URL = "https://api.cdp.coinbase.com/platform";
6
6
  export interface Config {
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,8BA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@
1
+ import * as EffectConfig from "effect/Config";
2
+ import * as Context from "effect/Context";
1
3
  import * as Effect from "effect/Effect";
2
4
  import * as Layer from "effect/Layer";
5
+ import * as Option from "effect/Option";
3
6
  import * as Redacted from "effect/Redacted";
4
- import * as Context from "effect/Context";
5
7
  import { ConfigError } from "@distilled.cloud/core/errors";
6
8
  export const DEFAULT_API_BASE_URL = "https://api.cdp.coinbase.com/platform";
7
9
  export class Credentials extends Context.Service()("CoinbaseCredentials") {
8
10
  }
11
+ const envConfig = EffectConfig.all({
12
+ apiKeyId: EffectConfig.option(EffectConfig.string("CDP_API_KEY_ID")),
13
+ apiKeyName: EffectConfig.option(EffectConfig.string("CDP_API_KEY_NAME")),
14
+ apiKeySecret: EffectConfig.string("CDP_API_KEY_SECRET"),
15
+ walletSecret: EffectConfig.option(EffectConfig.string("CDP_WALLET_SECRET")),
16
+ });
9
17
  export const CredentialsFromEnv = Layer.effect(Credentials, Effect.gen(function* () {
10
- const apiKeyId = process.env.CDP_API_KEY_ID ?? process.env.CDP_API_KEY_NAME;
11
- const apiKeySecret = process.env.CDP_API_KEY_SECRET;
12
- const walletSecret = process.env.CDP_WALLET_SECRET;
18
+ const config = yield* envConfig.asEffect().pipe(Effect.mapError(() => new ConfigError({
19
+ message: "CDP_API_KEY_SECRET environment variable is required",
20
+ })));
21
+ const apiKeyId = Option.getOrUndefined(config.apiKeyId) ??
22
+ Option.getOrUndefined(config.apiKeyName);
13
23
  if (!apiKeyId) {
14
24
  return yield* new ConfigError({
15
25
  message: "CDP_API_KEY_ID (or CDP_API_KEY_NAME) environment variable is required",
16
26
  });
17
27
  }
18
- if (!apiKeySecret) {
19
- return yield* new ConfigError({
20
- message: "CDP_API_KEY_SECRET environment variable is required",
21
- });
22
- }
28
+ const walletSecret = Option.getOrUndefined(config.walletSecret);
23
29
  return {
24
30
  apiKeyId,
25
- apiKeySecret: Redacted.make(apiKeySecret),
31
+ apiKeySecret: Redacted.make(config.apiKeySecret),
26
32
  walletSecret: walletSecret ? Redacted.make(walletSecret) : undefined,
27
33
  apiBaseUrl: DEFAULT_API_BASE_URL,
28
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAE3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,uCAAuC,CAAC;AA4B5E,MAAM,OAAO,WAAY,SAAQ,OAAO,CAAC,OAAO,EAAuB,CACrE,qBAAqB,CACtB;CAAG;AAEJ,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,CAC5C,WAAW,EACX,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC5E,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IACpD,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAEnD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC;YAC5B,OAAO,EACL,uEAAuE;SAC1E,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC;YAC5B,OAAO,EAAE,qDAAqD;SAC/D,CAAC,CAAC;IACL,CAAC;IAED,OAAO;QACL,QAAQ;QACR,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC;QACzC,YAAY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,QAAQ,EAAE,CAAC,IAAI,CAC7C,MAAM,CAAC,QAAQ,CACb,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;QACd,OAAO,EAAE,qDAAqD;KAC/D,CAAC,CACL,CACF,CAAC;IAEF,MAAM,QAAQ,GACZ,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAE3C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC;YAC5B,OAAO,EACL,uEAAuE;SAC1E,CAAC,CAAC;IACL,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IAEhE,OAAO;QACL,QAAQ;QACR,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC;QAChD,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS;QACpE,UAAU,EAAE,oBAAoB;KACjC,CAAC;AACJ,CAAC,CAAC,CACH,CAAC"}
@@ -0,0 +1,51 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const CreateEvmEip7702DelegationWithEndUserAccountInput: Schema.Struct<{
3
+ readonly userId: Schema.String;
4
+ readonly projectID: Schema.optional<Schema.String>;
5
+ readonly address: Schema.String;
6
+ readonly network: Schema.Literals<readonly ["base-sepolia", "base", "arbitrum", "optimism", "polygon", "ethereum", "ethereum-sepolia"]>;
7
+ readonly enableSpendPermissions: Schema.optional<Schema.Boolean>;
8
+ readonly walletSecretId: Schema.optional<Schema.String>;
9
+ }>;
10
+ export type CreateEvmEip7702DelegationWithEndUserAccountInput = typeof CreateEvmEip7702DelegationWithEndUserAccountInput.Type;
11
+ export declare const CreateEvmEip7702DelegationWithEndUserAccountOutput: Schema.Struct<{
12
+ readonly delegationOperationId: Schema.String;
13
+ }>;
14
+ export type CreateEvmEip7702DelegationWithEndUserAccountOutput = typeof CreateEvmEip7702DelegationWithEndUserAccountOutput.Type;
15
+ /**
16
+ * Create EIP-7702 delegation for end user EVM account
17
+ *
18
+ * Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities.
19
+ * This endpoint:
20
+ * - Retrieves delegation artifacts from onchain
21
+ * - Signs the EIP-7702 authorization for delegation
22
+ * - Assembles and submits a Type 4 transaction
23
+ * - Creates an associated smart account object
24
+ * The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster.
25
+ *
26
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
27
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
28
+ section of our Authentication docs for more details on how to generate your Wallet Token.
29
+
30
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
31
+ When included, duplicate requests with the same key will return identical responses.
32
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
33
+
34
+ * @param userId - The ID of the end user.
35
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
36
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
37
+ section of our Authentication docs for more details on how to generate your Wallet Token.
38
+
39
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
40
+ */
41
+ export declare const createEvmEip7702DelegationWithEndUserAccount: import("@distilled.cloud/core/client").OperationMethod<{
42
+ readonly address: string;
43
+ readonly enableSpendPermissions?: boolean | undefined;
44
+ readonly network: "arbitrum" | "base" | "base-sepolia" | "ethereum" | "ethereum-sepolia" | "optimism" | "polygon";
45
+ readonly projectID?: string | undefined;
46
+ readonly userId: string;
47
+ readonly walletSecretId?: string | undefined;
48
+ }, {
49
+ readonly delegationOperationId: string;
50
+ }, never, import("../credentials.ts").Credentials>;
51
+ //# sourceMappingURL=createEvmEip7702DelegationWithEndUserAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEvmEip7702DelegationWithEndUserAccount.d.ts","sourceRoot":"","sources":["../../src/operations/createEvmEip7702DelegationWithEndUserAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,iDAAiD;;;;;;;EAqB3D,CAAC;AACJ,MAAM,MAAM,iDAAiD,GAC3D,OAAO,iDAAiD,CAAC,IAAI,CAAC;AAGhE,eAAO,MAAM,kDAAkD;;EAG3D,CAAC;AACL,MAAM,MAAM,kDAAkD,GAC5D,OAAO,kDAAkD,CAAC,IAAI,CAAC;AAGjE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,4CAA4C;;;;;;;;;kDAIpD,CAAC"}
@@ -0,0 +1,62 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const CreateEvmEip7702DelegationWithEndUserAccountInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ userId: Schema.String.pipe(T.PathParam()),
8
+ projectID: Schema.optional(Schema.String),
9
+ address: Schema.String,
10
+ network: Schema.Literals([
11
+ "base-sepolia",
12
+ "base",
13
+ "arbitrum",
14
+ "optimism",
15
+ "polygon",
16
+ "ethereum",
17
+ "ethereum-sepolia",
18
+ ]),
19
+ enableSpendPermissions: Schema.optional(Schema.Boolean),
20
+ walletSecretId: Schema.optional(Schema.String),
21
+ }).pipe(T.Http({
22
+ method: "POST",
23
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/eip7702/delegation",
24
+ }));
25
+ // Output Schema
26
+ export const CreateEvmEip7702DelegationWithEndUserAccountOutput =
27
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
28
+ delegationOperationId: Schema.String,
29
+ });
30
+ // The operation
31
+ /**
32
+ * Create EIP-7702 delegation for end user EVM account
33
+ *
34
+ * Creates an EIP-7702 delegation for an end user's EVM EOA account, upgrading it with smart account capabilities.
35
+ * This endpoint:
36
+ * - Retrieves delegation artifacts from onchain
37
+ * - Signs the EIP-7702 authorization for delegation
38
+ * - Assembles and submits a Type 4 transaction
39
+ * - Creates an associated smart account object
40
+ * The delegation allows the EVM EOA to be used as a smart account, which enables batched transactions and gas sponsorship via paymaster.
41
+ *
42
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
43
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
44
+ section of our Authentication docs for more details on how to generate your Wallet Token.
45
+
46
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
47
+ When included, duplicate requests with the same key will return identical responses.
48
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
49
+
50
+ * @param userId - The ID of the end user.
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 projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
56
+ */
57
+ export const createEvmEip7702DelegationWithEndUserAccount =
58
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
59
+ inputSchema: CreateEvmEip7702DelegationWithEndUserAccountInput,
60
+ outputSchema: CreateEvmEip7702DelegationWithEndUserAccountOutput,
61
+ }));
62
+ //# sourceMappingURL=createEvmEip7702DelegationWithEndUserAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEvmEip7702DelegationWithEndUserAccount.js","sourceRoot":"","sources":["../../src/operations/createEvmEip7702Del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jE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const GetDelegationForEndUserInput: Schema.Struct<{
3
+ readonly userId: Schema.String;
4
+ readonly projectID: Schema.optional<Schema.String>;
5
+ }>;
6
+ export type GetDelegationForEndUserInput = typeof GetDelegationForEndUserInput.Type;
7
+ export declare const GetDelegationForEndUserOutput: Schema.Struct<{
8
+ readonly expiresAt: Schema.String;
9
+ }>;
10
+ export type GetDelegationForEndUserOutput = typeof GetDelegationForEndUserOutput.Type;
11
+ /**
12
+ * Get delegation for end user
13
+ *
14
+ * Returns the active delegation for the specified end user, if one exists. This operation can be performed by the end user themselves or by a developer using their API key.
15
+ *
16
+ * @param userId - The ID of the end user.
17
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
18
+ */
19
+ export declare const getDelegationForEndUser: import("@distilled.cloud/core/client").OperationMethod<{
20
+ readonly projectID?: string | undefined;
21
+ readonly userId: string;
22
+ }, {
23
+ readonly expiresAt: string;
24
+ }, never, import("../credentials.ts").Credentials>;
25
+ //# sourceMappingURL=getDelegationForEndUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDelegationForEndUser.d.ts","sourceRoot":"","sources":["../../src/operations/getDelegationForEndUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,4BAA4B;;;EAStC,CAAC;AACJ,MAAM,MAAM,4BAA4B,GACtC,OAAO,4BAA4B,CAAC,IAAI,CAAC;AAG3C,eAAO,MAAM,6BAA6B;;EAGtC,CAAC;AACL,MAAM,MAAM,6BAA6B,GACvC,OAAO,6BAA6B,CAAC,IAAI,CAAC;AAG5C;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;;;kDAKnC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const GetDelegationForEndUserInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ userId: Schema.String.pipe(T.PathParam()),
8
+ projectID: Schema.optional(Schema.String),
9
+ }).pipe(T.Http({
10
+ method: "GET",
11
+ path: "/v2/embedded-wallet-api/end-users/{userId}/delegation",
12
+ }));
13
+ // Output Schema
14
+ export const GetDelegationForEndUserOutput =
15
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
16
+ expiresAt: Schema.String,
17
+ });
18
+ // The operation
19
+ /**
20
+ * Get delegation for end user
21
+ *
22
+ * Returns the active delegation for the specified end user, if one exists. This operation can be performed by the end user themselves or by a developer using their API key.
23
+ *
24
+ * @param userId - The ID of the end user.
25
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
26
+ */
27
+ export const getDelegationForEndUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
28
+ inputSchema: GetDelegationForEndUserInput,
29
+ outputSchema: GetDelegationForEndUserOutput,
30
+ }));
31
+ //# sourceMappingURL=getDelegationForEndUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDelegationForEndUser.js","sourceRoot":"","sources":["../../src/operations/getDelegationForEndUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,eAAe;AACf,MAAM,CAAC,MAAM,4BAA4B;AACvC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CAC1C,CAAC,CAAC,IAAI,CACL,CAAC,CAAC,IAAI,CAAC;IACL,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,uDAAuD;CAC9D,CAAC,CACH,CAAC;AAIJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,6BAA6B;AACxC,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC,MAAM;CACzB,CAAC,CAAC;AAIL,gBAAgB;AAChB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CACzE,GAAG,EAAE,CAAC,CAAC;IACL,WAAW,EAAE,4BAA4B;IACzC,YAAY,EAAE,6BAA6B;CAC5C,CAAC,CACH,CAAC"}
@@ -0,0 +1,32 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const RevokeDelegationForEndUserInput: Schema.Struct<{
3
+ readonly userId: Schema.String;
4
+ readonly walletSecretId: Schema.optional<Schema.String>;
5
+ }>;
6
+ export type RevokeDelegationForEndUserInput = typeof RevokeDelegationForEndUserInput.Type;
7
+ export declare const RevokeDelegationForEndUserOutput: Schema.Void;
8
+ export type RevokeDelegationForEndUserOutput = typeof RevokeDelegationForEndUserOutput.Type;
9
+ /**
10
+ * Revoke delegation for end user
11
+ *
12
+ * Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key.
13
+ *
14
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
15
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
16
+ section of our Authentication docs for more details on how to generate your Wallet Token.
17
+
18
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
19
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
20
+ section of our Authentication docs for more details on how to generate your Wallet Token.
21
+
22
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
23
+ When included, duplicate requests with the same key will return identical responses.
24
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
25
+
26
+ * @param userId - The ID of the end user.
27
+ */
28
+ export declare const revokeDelegationForEndUser: import("@distilled.cloud/core/client").OperationMethod<{
29
+ readonly userId: string;
30
+ readonly walletSecretId?: string | undefined;
31
+ }, void, never, import("../credentials.ts").Credentials>;
32
+ //# sourceMappingURL=revokeDelegationForEndUser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revokeDelegationForEndUser.d.ts","sourceRoot":"","sources":["../../src/operations/revokeDelegationForEndUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,+BAA+B;;;EASzC,CAAC;AACJ,MAAM,MAAM,+BAA+B,GACzC,OAAO,+BAA+B,CAAC,IAAI,CAAC;AAG9C,eAAO,MAAM,gCAAgC,aACJ,CAAC;AAC1C,MAAM,MAAM,gCAAgC,GAC1C,OAAO,gCAAgC,CAAC,IAAI,CAAC;AAG/C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,0BAA0B;;;wDAKtC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const RevokeDelegationForEndUserInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ userId: Schema.String.pipe(T.PathParam()),
8
+ walletSecretId: Schema.optional(Schema.String),
9
+ }).pipe(T.Http({
10
+ method: "DELETE",
11
+ path: "/v2/embedded-wallet-api/end-users/{userId}/delegation",
12
+ }));
13
+ // Output Schema
14
+ export const RevokeDelegationForEndUserOutput =
15
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Void;
16
+ // The operation
17
+ /**
18
+ * Revoke delegation for end user
19
+ *
20
+ * Revokes all active delegations for the specified end user. This operation can be performed by the end user themselves or by a developer using their API key.
21
+ *
22
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
23
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
24
+ section of our Authentication docs for more details on how to generate your Wallet Token.
25
+
26
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
27
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
28
+ section of our Authentication docs for more details on how to generate your Wallet Token.
29
+
30
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
31
+ When included, duplicate requests with the same key will return identical responses.
32
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
33
+
34
+ * @param userId - The ID of the end user.
35
+ */
36
+ export const revokeDelegationForEndUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
37
+ inputSchema: RevokeDelegationForEndUserInput,
38
+ outputSchema: RevokeDelegationForEndUserOutput,
39
+ }));
40
+ //# sourceMappingURL=revokeDelegationForEndUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"revokeDelegationForEndUser.js","sourceRoot":"","sources":["../../src/operations/revokeDelegationForEndUser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,eAAe;AACf,MAAM,CAAC,MAAM,+BAA+B;AAC1C,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACzC,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CAC/C,CAAC,CAAC,IAAI,CACL,CAAC,CAAC,IAAI,CAAC;IACL,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,uDAAuD;CAC9D,CAAC,CACH,CAAC;AAIJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,gCAAgC;AAC3C,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC;AAI1C,gBAAgB;AAChB;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAC5E,GAAG,EAAE,CAAC,CAAC;IACL,WAAW,EAAE,+BAA+B;IAC5C,YAAY,EAAE,gCAAgC;CAC/C,CAAC,CACH,CAAC"}
@@ -0,0 +1,58 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const SendEvmAssetWithEndUserAccountInput: Schema.Struct<{
3
+ readonly userId: Schema.String;
4
+ readonly address: Schema.String;
5
+ readonly asset: Schema.Literals<readonly ["usdc"]>;
6
+ readonly projectID: Schema.optional<Schema.String>;
7
+ readonly to: Schema.String;
8
+ readonly amount: Schema.String;
9
+ readonly network: Schema.Literals<readonly ["base", "base-sepolia", "ethereum", "ethereum-sepolia", "avalanche", "polygon", "optimism", "arbitrum", "arbitrum-sepolia", "world", "world-sepolia"]>;
10
+ readonly useCdpPaymaster: Schema.optional<Schema.Boolean>;
11
+ readonly paymasterUrl: Schema.optional<Schema.String>;
12
+ readonly walletSecretId: Schema.optional<Schema.String>;
13
+ }>;
14
+ export type SendEvmAssetWithEndUserAccountInput = typeof SendEvmAssetWithEndUserAccountInput.Type;
15
+ export declare const SendEvmAssetWithEndUserAccountOutput: Schema.Struct<{
16
+ readonly transactionHash: Schema.optional<Schema.NullOr<Schema.String>>;
17
+ readonly userOpHash: Schema.optional<Schema.NullOr<Schema.String>>;
18
+ }>;
19
+ export type SendEvmAssetWithEndUserAccountOutput = typeof SendEvmAssetWithEndUserAccountOutput.Type;
20
+ /**
21
+ * Send USDC on EVM
22
+ *
23
+ * 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.
24
+ * The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50").
25
+ *
26
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
27
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
28
+ section of our Authentication docs for more details on how to generate your Wallet Token.
29
+
30
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
31
+ When included, duplicate requests with the same key will return identical responses.
32
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
33
+
34
+ * @param userId - The ID of the end user.
35
+ * @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.
36
+ * @param asset - The asset to send. Currently only "usdc" is supported.
37
+ * @param X-Developer-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 projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
42
+ */
43
+ export declare const sendEvmAssetWithEndUserAccount: import("@distilled.cloud/core/client").OperationMethod<{
44
+ readonly address: string;
45
+ readonly amount: string;
46
+ readonly asset: "usdc";
47
+ readonly network: "arbitrum" | "arbitrum-sepolia" | "avalanche" | "base" | "base-sepolia" | "ethereum" | "ethereum-sepolia" | "optimism" | "polygon" | "world" | "world-sepolia";
48
+ readonly paymasterUrl?: string | undefined;
49
+ readonly projectID?: string | undefined;
50
+ readonly to: string;
51
+ readonly useCdpPaymaster?: boolean | undefined;
52
+ readonly userId: string;
53
+ readonly walletSecretId?: string | undefined;
54
+ }, {
55
+ readonly transactionHash?: string | null | undefined;
56
+ readonly userOpHash?: string | null | undefined;
57
+ }, never, import("../credentials.ts").Credentials>;
58
+ //# sourceMappingURL=sendEvmAssetWithEndUserAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendEvmAssetWithEndUserAccount.d.ts","sourceRoot":"","sources":["../../src/operations/sendEvmAssetWithEndUserAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,mCAAmC;;;;;;;;;;;EA6B7C,CAAC;AACJ,MAAM,MAAM,mCAAmC,GAC7C,OAAO,mCAAmC,CAAC,IAAI,CAAC;AAGlD,eAAO,MAAM,oCAAoC;;;EAI7C,CAAC;AACL,MAAM,MAAM,oCAAoC,GAC9C,OAAO,oCAAoC,CAAC,IAAI,CAAC;AAGnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;kDAItC,CAAC"}
@@ -0,0 +1,68 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const SendEvmAssetWithEndUserAccountInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ userId: Schema.String.pipe(T.PathParam()),
8
+ address: Schema.String.pipe(T.PathParam()),
9
+ asset: Schema.Literals(["usdc"]).pipe(T.PathParam()),
10
+ projectID: Schema.optional(Schema.String),
11
+ to: Schema.String,
12
+ amount: Schema.String,
13
+ network: Schema.Literals([
14
+ "base",
15
+ "base-sepolia",
16
+ "ethereum",
17
+ "ethereum-sepolia",
18
+ "avalanche",
19
+ "polygon",
20
+ "optimism",
21
+ "arbitrum",
22
+ "arbitrum-sepolia",
23
+ "world",
24
+ "world-sepolia",
25
+ ]),
26
+ useCdpPaymaster: Schema.optional(Schema.Boolean),
27
+ paymasterUrl: Schema.optional(Schema.String),
28
+ walletSecretId: Schema.optional(Schema.String),
29
+ }).pipe(T.Http({
30
+ method: "POST",
31
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/{address}/send/{asset}",
32
+ }));
33
+ // Output Schema
34
+ export const SendEvmAssetWithEndUserAccountOutput =
35
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
36
+ transactionHash: Schema.optional(Schema.NullOr(Schema.String)),
37
+ userOpHash: Schema.optional(Schema.NullOr(Schema.String)),
38
+ });
39
+ // The operation
40
+ /**
41
+ * Send USDC on EVM
42
+ *
43
+ * 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.
44
+ * The `amount` field accepts human-readable amounts as decimal strings (e.g., "1.5", "25.50").
45
+ *
46
+ * @param X-Wallet-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 X-Idempotency-Key - An optional string request header for making requests safely retryable.
51
+ When included, duplicate requests with the same key will return identical responses.
52
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
53
+
54
+ * @param userId - The ID of the end user.
55
+ * @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.
56
+ * @param asset - The asset to send. Currently only "usdc" is supported.
57
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
58
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
59
+ section of our Authentication docs for more details on how to generate your Wallet Token.
60
+
61
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
62
+ */
63
+ export const sendEvmAssetWithEndUserAccount =
64
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
65
+ inputSchema: SendEvmAssetWithEndUserAccountInput,
66
+ outputSchema: SendEvmAssetWithEndUserAccountOutput,
67
+ }));
68
+ //# sourceMappingURL=sendEvmAssetWithEndUserAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendEvmAssetWithEndUserAccount.js","sourceRoot":"","sources":["../../src/operations/sendEvmAssetWithEndUserAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAElC,eAAe;AACf,MAAM,CAAC,MAAM,mCAAmC;AAC9C,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IACpD,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC,MAAM;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC;QACvB,MAAM;QACN,cAAc;QACd,UAAU;QACV,kBAAkB;QAClB,WAAW;QACX,SAAS;QACT,UAAU;QACV,UAAU;QACV,kBAAkB;QAClB,OAAO;QACP,eAAe;KAChB,CAAC;IACF,eAAe,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC;IAChD,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5C,cAAc,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CAC/C,CAAC,CAAC,IAAI,CACL,CAAC,CAAC,IAAI,CAAC;IACL,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,uEAAuE;CAC9E,CAAC,CACH,CAAC;AAIJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC;AAC/C,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,eAAe,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CAC1D,CAAC,CAAC;AAIL,gBAAgB;AAChB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,8BAA8B;AACzC,aAAa,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC1C,WAAW,EAAE,mCAAmC;IAChD,YAAY,EAAE,oCAAoC;CACnD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,61 @@
1
+ import * as Schema from "effect/Schema";
2
+ export declare const SendEvmTransactionWithEndUserAccountInput: Schema.Struct<{
3
+ readonly userId: Schema.String;
4
+ readonly projectID: Schema.optional<Schema.String>;
5
+ readonly address: Schema.String;
6
+ readonly network: Schema.Literals<readonly ["base", "base-sepolia", "ethereum", "ethereum-sepolia", "avalanche", "polygon", "optimism", "arbitrum", "arbitrum-sepolia", "world", "world-sepolia"]>;
7
+ readonly walletSecretId: Schema.optional<Schema.String>;
8
+ readonly transaction: Schema.String;
9
+ }>;
10
+ export type SendEvmTransactionWithEndUserAccountInput = typeof SendEvmTransactionWithEndUserAccountInput.Type;
11
+ export declare const SendEvmTransactionWithEndUserAccountOutput: Schema.Struct<{
12
+ readonly transactionHash: Schema.String;
13
+ }>;
14
+ export type SendEvmTransactionWithEndUserAccountOutput = typeof SendEvmTransactionWithEndUserAccountOutput.Type;
15
+ /**
16
+ * Send a transaction with end user EVM account
17
+ *
18
+ * 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/).
19
+ * The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md).
20
+ * **Transaction fields and API behavior**
21
+ * - `to` *(Required)*: The address of the contract or account to send the transaction to.
22
+ * - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored.
23
+ * The transaction will be sent to the network indicated by the `network` field in the request body.
24
+ * - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign
25
+ * a nonce to the transaction based on the current state of the account.
26
+ * - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction.
27
+ * If not provided, the API will estimate a value based on current network conditions.
28
+ * - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction.
29
+ * If not provided, the API will estimate a value based on current network conditions.
30
+ * - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value
31
+ * based on the `to` and `data` fields of the transaction.
32
+ * - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction.
33
+ * - `data` *(Optional)*: The data to send with the transaction; only used for contract calls.
34
+ * - `accessList` *(Optional)*: The access list to use for the transaction.
35
+ *
36
+ * @param X-Wallet-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
37
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
38
+ section of our Authentication docs for more details on how to generate your Wallet Token.
39
+
40
+ * @param X-Idempotency-Key - An optional string request header for making requests safely retryable.
41
+ When included, duplicate requests with the same key will return identical responses.
42
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
43
+
44
+ * @param userId - The ID of the end user.
45
+ * @param X-Developer-Auth - A JWT signed using your Wallet Secret, encoded in base64. Refer to the
46
+ [Generate Wallet Token](https://docs.cdp.coinbase.com/api-reference/v2/authentication#2-generate-wallet-token)
47
+ section of our Authentication docs for more details on how to generate your Wallet Token.
48
+
49
+ * @param projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
50
+ */
51
+ export declare const sendEvmTransactionWithEndUserAccount: import("@distilled.cloud/core/client").OperationMethod<{
52
+ readonly address: string;
53
+ readonly network: "arbitrum" | "arbitrum-sepolia" | "avalanche" | "base" | "base-sepolia" | "ethereum" | "ethereum-sepolia" | "optimism" | "polygon" | "world" | "world-sepolia";
54
+ readonly projectID?: string | undefined;
55
+ readonly transaction: string;
56
+ readonly userId: string;
57
+ readonly walletSecretId?: string | undefined;
58
+ }, {
59
+ readonly transactionHash: string;
60
+ }, never, import("../credentials.ts").Credentials>;
61
+ //# sourceMappingURL=sendEvmTransactionWithEndUserAccount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendEvmTransactionWithEndUserAccount.d.ts","sourceRoot":"","sources":["../../src/operations/sendEvmTransactionWithEndUserAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,eAAO,MAAM,yCAAyC;;;;;;;EAyBnD,CAAC;AACJ,MAAM,MAAM,yCAAyC,GACnD,OAAO,yCAAyC,CAAC,IAAI,CAAC;AAGxD,eAAO,MAAM,0CAA0C;;EAGnD,CAAC;AACL,MAAM,MAAM,0CAA0C,GACpD,OAAO,0CAA0C,CAAC,IAAI,CAAC;AAGzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;kDAI5C,CAAC"}
@@ -0,0 +1,76 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { API } from "../client.js";
3
+ import * as T from "../traits.js";
4
+ // Input Schema
5
+ export const SendEvmTransactionWithEndUserAccountInput =
6
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
7
+ userId: Schema.String.pipe(T.PathParam()),
8
+ projectID: Schema.optional(Schema.String),
9
+ address: Schema.String,
10
+ network: Schema.Literals([
11
+ "base",
12
+ "base-sepolia",
13
+ "ethereum",
14
+ "ethereum-sepolia",
15
+ "avalanche",
16
+ "polygon",
17
+ "optimism",
18
+ "arbitrum",
19
+ "arbitrum-sepolia",
20
+ "world",
21
+ "world-sepolia",
22
+ ]),
23
+ walletSecretId: Schema.optional(Schema.String),
24
+ transaction: Schema.String,
25
+ }).pipe(T.Http({
26
+ method: "POST",
27
+ path: "/v2/embedded-wallet-api/end-users/{userId}/evm/send/transaction",
28
+ }));
29
+ // Output Schema
30
+ export const SendEvmTransactionWithEndUserAccountOutput =
31
+ /*@__PURE__*/ /*#__PURE__*/ Schema.Struct({
32
+ transactionHash: Schema.String,
33
+ });
34
+ // The operation
35
+ /**
36
+ * Send a transaction with end user EVM account
37
+ *
38
+ * 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/).
39
+ * The transaction must be an [EIP-1559 dynamic fee transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md).
40
+ * **Transaction fields and API behavior**
41
+ * - `to` *(Required)*: The address of the contract or account to send the transaction to.
42
+ * - `chainId` *(Ignored)*: The value of the `chainId` field in the transaction is ignored.
43
+ * The transaction will be sent to the network indicated by the `network` field in the request body.
44
+ * - `nonce` *(Optional)*: The nonce to use for the transaction. If not provided, the API will assign
45
+ * a nonce to the transaction based on the current state of the account.
46
+ * - `maxPriorityFeePerGas` *(Optional)*: The maximum priority fee per gas to use for the transaction.
47
+ * If not provided, the API will estimate a value based on current network conditions.
48
+ * - `maxFeePerGas` *(Optional)*: The maximum fee per gas to use for the transaction.
49
+ * If not provided, the API will estimate a value based on current network conditions.
50
+ * - `gasLimit` *(Optional)*: The gas limit to use for the transaction. If not provided, the API will estimate a value
51
+ * based on the `to` and `data` fields of the transaction.
52
+ * - `value` *(Optional)*: The amount of ETH, in wei, to send with the transaction.
53
+ * - `data` *(Optional)*: The data to send with the transaction; only used for contract calls.
54
+ * - `accessList` *(Optional)*: The access list to use for the transaction.
55
+ *
56
+ * @param X-Wallet-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 X-Idempotency-Key - An optional string request header for making requests safely retryable.
61
+ When included, duplicate requests with the same key will return identical responses.
62
+ Refer to our [Idempotency docs](https://docs.cdp.coinbase.com/api-reference/v2/idempotency) for more information on using idempotency keys.
63
+
64
+ * @param userId - The ID of the end user.
65
+ * @param X-Developer-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 projectID - The ID of the CDP Project. Required for end users authenticated using custom auth (i.e. a non-CDP JWT provider).
70
+ */
71
+ export const sendEvmTransactionWithEndUserAccount =
72
+ /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
73
+ inputSchema: SendEvmTransactionWithEndUserAccountInput,
74
+ outputSchema: SendEvmTransactionWithEndUserAccountOutput,
75
+ }));
76
+ //# sourceMappingURL=sendEvmTransactionWithEndUserAccount.js.map