@herd-labs/sdk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/index.d.ts +3 -3
  2. package/dist/index.js +3 -3
  3. package/dist/src/config.d.ts +17 -5
  4. package/dist/src/config.js +12 -2
  5. package/dist/src/live/ActionsServiceLive.js +10 -10
  6. package/dist/src/live/AdaptersServiceLive.d.ts +2 -2
  7. package/dist/src/live/AdaptersServiceLive.js +7 -7
  8. package/dist/src/live/AgentSafesServiceLive.d.ts +2 -2
  9. package/dist/src/live/AgentSafesServiceLive.js +4 -4
  10. package/dist/src/live/AgentWalletsServiceLive.d.ts +2 -2
  11. package/dist/src/live/AgentWalletsServiceLive.js +3 -3
  12. package/dist/src/live/AgentWorkflowsServiceLive.d.ts +2 -2
  13. package/dist/src/live/AgentWorkflowsServiceLive.js +8 -8
  14. package/dist/src/live/AuthServiceLive.d.ts +2 -2
  15. package/dist/src/live/AuthServiceLive.js +8 -7
  16. package/dist/src/live/BookmarksServiceLive.d.ts +2 -2
  17. package/dist/src/live/BookmarksServiceLive.js +7 -7
  18. package/dist/src/live/CodeBlocksServiceLive.d.ts +2 -2
  19. package/dist/src/live/CodeBlocksServiceLive.js +1 -2
  20. package/dist/src/live/CollectionsServiceLive.d.ts +2 -2
  21. package/dist/src/live/CollectionsServiceLive.js +5 -5
  22. package/dist/src/live/ContractsServiceLive.d.ts +2 -2
  23. package/dist/src/live/ContractsServiceLive.js +5 -5
  24. package/dist/src/live/DocsServiceLive.d.ts +2 -2
  25. package/dist/src/live/DocsServiceLive.js +3 -3
  26. package/dist/src/live/GroupsServiceLive.d.ts +2 -2
  27. package/dist/src/live/GroupsServiceLive.js +7 -7
  28. package/dist/src/live/HalServiceLive.d.ts +2 -2
  29. package/dist/src/live/HalServiceLive.js +3 -3
  30. package/dist/src/live/TransactionsServiceLive.js +4 -4
  31. package/dist/src/live/WalletsServiceLive.d.ts +2 -2
  32. package/dist/src/live/WalletsServiceLive.js +5 -5
  33. package/dist/src/live/http.d.ts +1 -4
  34. package/dist/src/live/http.js +15 -4
  35. package/dist/src/schemas/actions.d.ts +12 -12
  36. package/dist/src/schemas/adapters.d.ts +2 -2
  37. package/dist/src/schemas/agent-wallets.d.ts +20 -20
  38. package/dist/src/schemas/auth.d.ts +22 -12
  39. package/dist/src/schemas/auth.js +16 -5
  40. package/dist/src/schemas/bookmarks.d.ts +14 -14
  41. package/dist/src/schemas/codeblocks.d.ts +2 -2
  42. package/dist/src/schemas/collections.d.ts +2 -2
  43. package/dist/src/schemas/contracts.d.ts +15 -15
  44. package/dist/src/schemas/hal.d.ts +23 -23
  45. package/dist/src/schemas/transactions.d.ts +35 -35
  46. package/dist/src/schemas/wallets.d.ts +37 -37
  47. package/dist/src/services/AuthService.d.ts +3 -2
  48. package/package.json +2 -1
@@ -11,14 +11,14 @@ const mapNotFound = (groupId) => Effect.catchAll((error) => {
11
11
  return Effect.fail(error);
12
12
  });
13
13
  const GroupsServiceLive = Layer.effect(GroupsService, Effect.gen(function* () {
14
- const { config, client } = yield* authorizedClient;
14
+ const { baseUrl, client } = yield* authorizedClient;
15
15
  return {
16
- create: ({ params }) => pipe(client.post(makeUrl(config.baseUrl, "/v1/groups"), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(CreateGroupResponse)), Effect.mapError(ensureServiceError("Failed to create group"))),
17
- list: () => pipe(client.get(makeUrl(config.baseUrl, "/v1/groups")), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(ListGroupsResponse)), Effect.mapError(ensureServiceError("Failed to list groups"))),
18
- get: ({ groupId }) => pipe(client.get(makeUrl(config.baseUrl, `/v1/groups/${groupId}`)), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(GroupDetails)), Effect.mapError(ensureServiceError("Failed to get group")), mapNotFound(groupId)),
19
- proposeMemberChange: ({ groupId, params }) => pipe(client.post(makeUrl(config.baseUrl, `/v1/groups/${groupId}/proposals/member`), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(ProposalResponse)), Effect.mapError(ensureServiceError("Failed to propose member change")), mapNotFound(groupId)),
20
- proposeQuorumChange: ({ groupId, params }) => pipe(client.post(makeUrl(config.baseUrl, `/v1/groups/${groupId}/proposals/quorum`), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(ProposalResponse)), Effect.mapError(ensureServiceError("Failed to propose quorum change")), mapNotFound(groupId)),
21
- editMetadata: ({ groupId, params }) => pipe(client.patch(makeUrl(config.baseUrl, `/v1/groups/${groupId}`), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(EditGroupMetadataResponse)), Effect.mapError(ensureServiceError("Failed to edit group metadata")), mapNotFound(groupId))
16
+ create: ({ params }) => pipe(client.post(makeUrl(baseUrl, "/v1/groups"), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(CreateGroupResponse)), Effect.mapError(ensureServiceError("Failed to create group"))),
17
+ list: () => pipe(client.get(makeUrl(baseUrl, "/v1/groups")), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(ListGroupsResponse)), Effect.mapError(ensureServiceError("Failed to list groups"))),
18
+ get: ({ groupId }) => pipe(client.get(makeUrl(baseUrl, `/v1/groups/${groupId}`)), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(GroupDetails)), Effect.mapError(ensureServiceError("Failed to get group")), mapNotFound(groupId)),
19
+ proposeMemberChange: ({ groupId, params }) => pipe(client.post(makeUrl(baseUrl, `/v1/groups/${groupId}/proposals/member`), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(ProposalResponse)), Effect.mapError(ensureServiceError("Failed to propose member change")), mapNotFound(groupId)),
20
+ proposeQuorumChange: ({ groupId, params }) => pipe(client.post(makeUrl(baseUrl, `/v1/groups/${groupId}/proposals/quorum`), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(ProposalResponse)), Effect.mapError(ensureServiceError("Failed to propose quorum change")), mapNotFound(groupId)),
21
+ editMetadata: ({ groupId, params }) => pipe(client.patch(makeUrl(baseUrl, `/v1/groups/${groupId}`), { body: jsonBody(params) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(EditGroupMetadataResponse)), Effect.mapError(ensureServiceError("Failed to edit group metadata")), mapNotFound(groupId))
22
22
  };
23
23
  }));
24
24
 
@@ -1,9 +1,9 @@
1
1
  import { HerdConfig } from "../config.js";
2
2
  import { HalService } from "../services/HalService.js";
3
3
  import { Layer } from "effect";
4
- import * as _effect_platform_HttpClient11 from "@effect/platform/HttpClient";
4
+ import * as _effect_platform_HttpClient13 from "@effect/platform/HttpClient";
5
5
 
6
6
  //#region src/live/HalServiceLive.d.ts
7
- declare const HalServiceLive: Layer.Layer<HalService, never, HerdConfig | _effect_platform_HttpClient11.HttpClient>;
7
+ declare const HalServiceLive: Layer.Layer<HalService, never, HerdConfig | _effect_platform_HttpClient13.HttpClient>;
8
8
  //#endregion
9
9
  export { HalServiceLive };
@@ -14,9 +14,9 @@ const mapSimulationError = Effect.catchAll((error) => {
14
14
  return Effect.fail(error);
15
15
  });
16
16
  const HalServiceLive = Layer.effect(HalService, Effect.gen(function* () {
17
- const { config, client } = yield* authorizedClient;
18
- const callEvaluate = (body) => pipe(client.post(makeUrl(config.baseUrl, "/v1/actions/executions/evaluate"), { body: jsonBody(body) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(EvaluateResponse)), Effect.mapError(ensureServiceError("Failed to evaluate expression")), mapSimulationError);
19
- const callEvaluateExisting = (body) => pipe(client.post(makeUrl(config.baseUrl, "/v1/actions/executions/evaluate/existing"), { body: jsonBody(body) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(EvaluateExistingResponse)), Effect.mapError(ensureServiceError("Failed to evaluate existing action")), mapSimulationError);
17
+ const { baseUrl, client } = yield* authorizedClient;
18
+ const callEvaluate = (body) => pipe(client.post(makeUrl(baseUrl, "/v1/actions/executions/evaluate"), { body: jsonBody(body) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(EvaluateResponse)), Effect.mapError(ensureServiceError("Failed to evaluate expression")), mapSimulationError);
19
+ const callEvaluateExisting = (body) => pipe(client.post(makeUrl(baseUrl, "/v1/actions/executions/evaluate/existing"), { body: jsonBody(body) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(EvaluateExistingResponse)), Effect.mapError(ensureServiceError("Failed to evaluate existing action")), mapSimulationError);
20
20
  return {
21
21
  evaluate: (params) => callEvaluate({
22
22
  expression: params.expression,
@@ -23,17 +23,17 @@ const latestTxParamsToSnakeCaseQuery = (params) => pipe({
23
23
  called_by: params?.calledBy
24
24
  }, Record.filterMap(Option.liftNullable(Function.identity)));
25
25
  const TransactionsServiceLive = Layer.effect(TransactionsService, Effect.gen(function* () {
26
- const { config, client } = yield* authorizedClient;
26
+ const { baseUrl, client } = yield* authorizedClient;
27
27
  return {
28
- getTransaction: (blockchain, txHash) => pipe(client.get(makeUrl(config.baseUrl, `/v1/transactions/${blockchain}/${txHash}`)), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(TransactionQueryResponse)), Effect.mapError(ensureServiceError("Failed to get transaction"))),
29
- getLatestFunctionTransactions: (blockchain, address, filter, params) => pipe(client.get(makeUrl(config.baseUrl, `/v1/contracts/${blockchain}/${address}/latest_function_transactions`, {
28
+ getTransaction: (blockchain, txHash) => pipe(client.get(makeUrl(baseUrl, `/v1/transactions/${blockchain}/${txHash}`)), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(TransactionQueryResponse)), Effect.mapError(ensureServiceError("Failed to get transaction"))),
29
+ getLatestFunctionTransactions: (blockchain, address, filter, params) => pipe(client.get(makeUrl(baseUrl, `/v1/contracts/${blockchain}/${address}/latest_function_transactions`, {
30
30
  ...latestTxParamsToSnakeCaseQuery(params),
31
31
  ...toOptionalQuery({
32
32
  name: filter.name,
33
33
  signature: filter.signature
34
34
  })
35
35
  })), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(LatestFunctionTransactions)), Effect.mapError(ensureServiceError("Failed to get latest function transactions"))),
36
- getLatestEventTransactions: (blockchain, address, filter, params) => pipe(client.get(makeUrl(config.baseUrl, `/v1/contracts/${blockchain}/${address}/latest_event_transactions`, {
36
+ getLatestEventTransactions: (blockchain, address, filter, params) => pipe(client.get(makeUrl(baseUrl, `/v1/contracts/${blockchain}/${address}/latest_event_transactions`, {
37
37
  ...latestTxParamsToSnakeCaseQuery(params),
38
38
  ...toOptionalQuery({
39
39
  name: filter.name,
@@ -1,9 +1,9 @@
1
1
  import { HerdConfig } from "../config.js";
2
2
  import { WalletsService } from "../services/WalletsService.js";
3
3
  import { Layer } from "effect";
4
- import * as _effect_platform_HttpClient13 from "@effect/platform/HttpClient";
4
+ import * as _effect_platform_HttpClient4 from "@effect/platform/HttpClient";
5
5
 
6
6
  //#region src/live/WalletsServiceLive.d.ts
7
- declare const WalletsServiceLive: Layer.Layer<WalletsService, never, HerdConfig | _effect_platform_HttpClient13.HttpClient>;
7
+ declare const WalletsServiceLive: Layer.Layer<WalletsService, never, HerdConfig | _effect_platform_HttpClient4.HttpClient>;
8
8
  //#endregion
9
9
  export { WalletsServiceLive };
@@ -7,15 +7,15 @@ import { HttpClientResponse } from "@effect/platform";
7
7
 
8
8
  //#region src/live/WalletsServiceLive.ts
9
9
  const WalletsServiceLive = Layer.effect(WalletsService, Effect.gen(function* () {
10
- const { config, client } = yield* authorizedClient;
10
+ const { baseUrl, client } = yield* authorizedClient;
11
11
  return {
12
- getOverview: (blockchain, address, params) => pipe(client.get(makeUrl(config.baseUrl, `/v1/wallets/${blockchain}/${address}/overview`, {
12
+ getOverview: (blockchain, address, params) => pipe(client.get(makeUrl(baseUrl, `/v1/wallets/${blockchain}/${address}/overview`, {
13
13
  before_timestamp: params?.beforeTimestamp,
14
14
  after_timestamp: params?.afterTimestamp,
15
15
  before_blocknumber: params?.beforeBlocknumber,
16
16
  after_blocknumber: params?.afterBlocknumber
17
17
  })), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(WalletOverview)), Effect.mapError(ensureServiceError("Failed to get wallet overview"))),
18
- getTokenActivity: (blockchain, address, tokenAddress, params) => pipe(client.get(makeUrl(config.baseUrl, `/v1/wallets/${blockchain}/${address}/tokens/${tokenAddress}`, {
18
+ getTokenActivity: (blockchain, address, tokenAddress, params) => pipe(client.get(makeUrl(baseUrl, `/v1/wallets/${blockchain}/${address}/tokens/${tokenAddress}`, {
19
19
  page: params?.page,
20
20
  before_timestamp: params?.beforeTimestamp,
21
21
  after_timestamp: params?.afterTimestamp,
@@ -34,13 +34,13 @@ const WalletsServiceLive = Layer.effect(WalletsService, Effect.gen(function* ()
34
34
  after_blocknumber: query.afterBlocknumber,
35
35
  success_only: query.successOnly === true ? true : void 0
36
36
  }, Record.filterMap(Option.liftNullable(Function.identity)));
37
- return pipe(client.post(makeUrl(config.baseUrl, "/v1/wallets/transaction-activity"), { body: jsonBody({
37
+ return pipe(client.post(makeUrl(baseUrl, "/v1/wallets/transaction-activity"), { body: jsonBody({
38
38
  blockchain: query.blockchain,
39
39
  page: query.page ?? 1,
40
40
  ...optionalFields
41
41
  }) }), Effect.flatMap(checkStatus), Effect.flatMap(HttpClientResponse.schemaBodyJson(TransactionActivity)), Effect.mapError(ensureServiceError("Failed to get wallet transactions")));
42
42
  },
43
- getDeployedContracts: (blockchain, address, params) => pipe(client.get(makeUrl(config.baseUrl, `/v1/wallets/${blockchain}/${address}/created_contracts`, {
43
+ getDeployedContracts: (blockchain, address, params) => pipe(client.get(makeUrl(baseUrl, `/v1/wallets/${blockchain}/${address}/created_contracts`, {
44
44
  page: params?.page,
45
45
  before_timestamp: params?.beforeTimestamp,
46
46
  after_timestamp: params?.afterTimestamp,
@@ -7,10 +7,7 @@ import * as _effect_platform_HttpClientError0 from "@effect/platform/HttpClientE
7
7
  //#region src/live/http.d.ts
8
8
  declare const makeUrl: (baseUrl: string, path: string, queryParams?: object) => string;
9
9
  declare const authorizedClient: Effect.Effect<{
10
- config: {
11
- readonly baseUrl: string;
12
- readonly accessToken: string;
13
- };
10
+ baseUrl: string;
14
11
  client: HttpClient.HttpClient.With<_effect_platform_HttpClientError0.HttpClientError, never>;
15
12
  }, never, HerdConfig | HttpClient.HttpClient>;
16
13
  declare const handleJsonResponse: <A, I, R>(schema: Schema.Schema<A, I, R>) => (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<A, ServiceError, R>;
@@ -1,6 +1,6 @@
1
1
  import { HerdConfig } from "../config.js";
2
2
  import { ServiceError } from "../errors.js";
3
- import { Effect, pipe } from "effect";
3
+ import { Effect, Either, pipe } from "effect";
4
4
  import { HttpBody, HttpClient, HttpClientRequest, HttpClientResponse } from "@effect/platform";
5
5
 
6
6
  //#region src/live/http.ts
@@ -14,10 +14,21 @@ const makeUrl = (baseUrl, path, queryParams) => {
14
14
  };
15
15
  const authorizedClient = Effect.gen(function* () {
16
16
  const config = yield* HerdConfig;
17
+ const client = yield* HttpClient.HttpClient;
18
+ const { baseUrl, authHeaders } = Either.match(config, {
19
+ onLeft: ({ baseUrl: baseUrl$1, oauthAccessToken }) => ({
20
+ baseUrl: baseUrl$1,
21
+ authHeaders: { Authorization: `Bearer ${oauthAccessToken}` }
22
+ }),
23
+ onRight: ({ baseUrl: baseUrl$1, apiKey }) => ({
24
+ baseUrl: baseUrl$1,
25
+ authHeaders: { "x-api-key": apiKey }
26
+ })
27
+ });
17
28
  return {
18
- config,
19
- client: (yield* HttpClient.HttpClient).pipe(HttpClient.mapRequest(HttpClientRequest.setHeaders({
20
- Authorization: `Bearer ${config.accessToken}`,
29
+ baseUrl,
30
+ client: client.pipe(HttpClient.mapRequest(HttpClientRequest.setHeaders({
31
+ ...authHeaders,
21
32
  "Content-Type": "application/json"
22
33
  })))
23
34
  };
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import * as effect_Brand14 from "effect/Brand";
2
+ import * as effect_Brand0 from "effect/Brand";
3
3
 
4
4
  //#region src/schemas/actions.d.ts
5
5
  declare const ActionExpression_base: Schema.Class<ActionExpression, {
@@ -26,10 +26,10 @@ declare const ActionExpression_base: Schema.Class<ActionExpression, {
26
26
  readonly id: string;
27
27
  } & {
28
28
  readonly name: string;
29
- } & {
30
- readonly intent?: string | undefined;
31
29
  } & {
32
30
  readonly expression: unknown;
31
+ } & {
32
+ readonly intent?: string | undefined;
33
33
  } & {
34
34
  readonly publishedAt?: string | null | undefined;
35
35
  }, {}, {}>;
@@ -102,10 +102,10 @@ declare const ActionVersion_base: Schema.Class<ActionVersion, {
102
102
  readonly id: string;
103
103
  } & {
104
104
  readonly name: string;
105
- } & {
106
- readonly intent?: string | undefined;
107
105
  } & {
108
106
  readonly expression: unknown;
107
+ } & {
108
+ readonly intent?: string | undefined;
109
109
  } & {
110
110
  readonly publishedAt?: string | null | undefined;
111
111
  }, {}, {}>;
@@ -127,11 +127,11 @@ declare const ActionsSearchParams_base: Schema.Class<ActionsSearchParams, {
127
127
  expressionType: Schema.optional<Schema.Literal<["action", "adapter"]>>;
128
128
  }>>;
129
129
  }>, never, {
130
- readonly limit: number;
131
- } & {
132
130
  readonly offset: number;
133
131
  } & {
134
132
  readonly scope: readonly ("yours" | "all_published" | "verified")[];
133
+ } & {
134
+ readonly limit: number;
135
135
  } & {
136
136
  readonly filters?: {
137
137
  readonly name?: string | undefined;
@@ -233,13 +233,13 @@ declare const RelatedAdaptersSearchParams_base: Schema.Class<RelatedAdaptersSear
233
233
  }>>;
234
234
  scope: Schema.Array$<Schema.Literal<["yours", "verified"]>>;
235
235
  }>, never, {
236
+ readonly scope: readonly ("yours" | "verified")[];
237
+ } & {
236
238
  readonly contracts: readonly {
237
239
  readonly blockchain?: "ethereum" | "base" | undefined;
238
- readonly address: string & effect_Brand14.Brand<"EvmAddress">;
239
240
  readonly functionSignatures?: readonly string[] | undefined;
241
+ readonly address: string & effect_Brand0.Brand<"EvmAddress">;
240
242
  }[];
241
- } & {
242
- readonly scope: readonly ("yours" | "verified")[];
243
243
  }, {}, {}>;
244
244
  declare class RelatedAdaptersSearchParams extends RelatedAdaptersSearchParams_base {}
245
245
  declare const CreateActionParams_base: Schema.Class<CreateActionParams, {
@@ -252,10 +252,10 @@ declare const CreateActionParams_base: Schema.Class<CreateActionParams, {
252
252
  expression: typeof Schema.Unknown;
253
253
  }>, never, {
254
254
  readonly name: string;
255
- } & {
256
- readonly intent?: string | undefined;
257
255
  } & {
258
256
  readonly expression: unknown;
257
+ } & {
258
+ readonly intent?: string | undefined;
259
259
  }, {}, {}>;
260
260
  declare class CreateActionParams extends CreateActionParams_base {}
261
261
  declare const CreateActionResponse_base: Schema.Class<CreateActionResponse, {
@@ -11,10 +11,10 @@ declare const CreateAdapterParams_base: Schema.Class<CreateAdapterParams, {
11
11
  expression: typeof Schema.Unknown;
12
12
  }>, never, {
13
13
  readonly name: string;
14
- } & {
15
- readonly intent?: string | undefined;
16
14
  } & {
17
15
  readonly expression: unknown;
16
+ } & {
17
+ readonly intent?: string | undefined;
18
18
  }, {}, {}>;
19
19
  declare class CreateAdapterParams extends CreateAdapterParams_base {}
20
20
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import * as effect_Brand3 from "effect/Brand";
2
+ import * as effect_Brand0 from "effect/Brand";
3
3
 
4
4
  //#region src/schemas/agent-wallets.d.ts
5
5
  declare const AgentWallet_base: Schema.Class<AgentWallet, {
@@ -16,12 +16,12 @@ declare const AgentWallet_base: Schema.Class<AgentWallet, {
16
16
  intent: Schema.NullOr<typeof Schema.String>;
17
17
  }>, never, {
18
18
  readonly id: string;
19
- } & {
20
- readonly address: string & effect_Brand3.Brand<"EvmAddress">;
21
19
  } & {
22
20
  readonly name: string | null;
23
21
  } & {
24
22
  readonly intent: string | null;
23
+ } & {
24
+ readonly address: string & effect_Brand0.Brand<"EvmAddress">;
25
25
  } & {
26
26
  readonly groupId: string;
27
27
  }, {}, {}>;
@@ -41,13 +41,13 @@ declare const AgentWalletSafe_base: Schema.Class<AgentWalletSafe, {
41
41
  isProposer: typeof Schema.Boolean;
42
42
  isSigner: typeof Schema.Boolean;
43
43
  }>, never, {
44
- readonly blockchain: "ethereum" | "base";
45
- } & {
46
44
  readonly name: string | null;
47
45
  } & {
48
46
  readonly intent: string | null;
49
47
  } & {
50
- readonly safeAddress: string & effect_Brand3.Brand<"EvmAddress">;
48
+ readonly blockchain: "ethereum" | "base";
49
+ } & {
50
+ readonly safeAddress: string & effect_Brand0.Brand<"EvmAddress">;
51
51
  } & {
52
52
  readonly isProposer: boolean;
53
53
  } & {
@@ -69,11 +69,11 @@ declare const LinkedAgentWallet_base: Schema.Class<LinkedAgentWallet, {
69
69
  isProposer: typeof Schema.Boolean;
70
70
  isSigner: typeof Schema.Boolean;
71
71
  }>, never, {
72
- readonly address: string & effect_Brand3.Brand<"EvmAddress">;
73
- } & {
74
72
  readonly name: string | null;
75
73
  } & {
76
74
  readonly intent: string | null;
75
+ } & {
76
+ readonly address: string & effect_Brand0.Brand<"EvmAddress">;
77
77
  } & {
78
78
  readonly isProposer: boolean;
79
79
  } & {
@@ -93,13 +93,13 @@ declare const AgentSafeMetadata_base: Schema.Class<AgentSafeMetadata, {
93
93
  name: Schema.NullOr<typeof Schema.String>;
94
94
  intent: Schema.NullOr<typeof Schema.String>;
95
95
  }>, never, {
96
- readonly blockchain: "ethereum" | "base";
97
- } & {
98
96
  readonly name: string | null;
99
97
  } & {
100
98
  readonly intent: string | null;
101
99
  } & {
102
- readonly safeAddress: string & effect_Brand3.Brand<"EvmAddress">;
100
+ readonly blockchain: "ethereum" | "base";
101
+ } & {
102
+ readonly safeAddress: string & effect_Brand0.Brand<"EvmAddress">;
103
103
  }, {}, {}>;
104
104
  declare class AgentSafeMetadata extends AgentSafeMetadata_base {}
105
105
  declare const AgentWalletsListParams_base: Schema.Class<AgentWalletsListParams, {
@@ -145,13 +145,13 @@ declare const AgentSafe_base: Schema.Class<AgentSafe, {
145
145
  threshold: typeof Schema.Number;
146
146
  safeUrl: typeof Schema.String;
147
147
  }>, never, {
148
- readonly blockchain: "ethereum" | "base";
149
- } & {
150
148
  readonly name: string | null;
151
149
  } & {
152
150
  readonly intent: string | null;
153
151
  } & {
154
- readonly safeAddress: string & effect_Brand3.Brand<"EvmAddress">;
152
+ readonly blockchain: "ethereum" | "base";
153
+ } & {
154
+ readonly safeAddress: string & effect_Brand0.Brand<"EvmAddress">;
155
155
  } & {
156
156
  readonly threshold: number;
157
157
  } & {
@@ -159,7 +159,7 @@ declare const AgentSafe_base: Schema.Class<AgentSafe, {
159
159
  } & {
160
160
  readonly linkedAgentWallets: readonly LinkedAgentWallet[];
161
161
  } & {
162
- readonly owners: readonly (string & effect_Brand3.Brand<"EvmAddress">)[];
162
+ readonly owners: readonly (string & effect_Brand0.Brand<"EvmAddress">)[];
163
163
  }, {}, {}>;
164
164
  declare class AgentSafe extends AgentSafe_base {}
165
165
  declare const SetSafeProposerParams_base: Schema.Class<SetSafeProposerParams, {
@@ -175,7 +175,7 @@ declare const SetSafeProposerParams_base: Schema.Class<SetSafeProposerParams, {
175
175
  } & {
176
176
  readonly intent?: string | undefined;
177
177
  } & {
178
- readonly agentWalletAddress: string & effect_Brand3.Brand<"EvmAddress">;
178
+ readonly agentWalletAddress: string & effect_Brand0.Brand<"EvmAddress">;
179
179
  }, {}, {}>;
180
180
  declare class SetSafeProposerParams extends SetSafeProposerParams_base {}
181
181
  declare const SetSafeProposerResponse_base: Schema.Class<SetSafeProposerResponse, {
@@ -195,19 +195,19 @@ declare const SetSafeProposerResponse_base: Schema.Class<SetSafeProposerResponse
195
195
  isProposer: typeof Schema.Boolean;
196
196
  isSigner: typeof Schema.Boolean;
197
197
  }>, never, {
198
- readonly blockchain: "ethereum" | "base";
199
- } & {
200
198
  readonly name: string | null;
201
199
  } & {
202
200
  readonly intent: string | null;
203
201
  } & {
204
- readonly safeAddress: string & effect_Brand3.Brand<"EvmAddress">;
202
+ readonly blockchain: "ethereum" | "base";
203
+ } & {
204
+ readonly safeAddress: string & effect_Brand0.Brand<"EvmAddress">;
205
205
  } & {
206
206
  readonly isProposer: boolean;
207
207
  } & {
208
208
  readonly isSigner: boolean;
209
209
  } & {
210
- readonly agentWalletAddress: string & effect_Brand3.Brand<"EvmAddress">;
210
+ readonly agentWalletAddress: string & effect_Brand0.Brand<"EvmAddress">;
211
211
  }, {}, {}>;
212
212
  declare class SetSafeProposerResponse extends SetSafeProposerResponse_base {}
213
213
  declare const EditAgentSafeMetadataParams_base: Schema.Class<EditAgentSafeMetadataParams, {
@@ -1,4 +1,5 @@
1
1
  import { Schema } from "effect";
2
+ import { ApiKey as ApiKey$1 } from "@better-auth/api-key/types";
2
3
 
3
4
  //#region src/schemas/auth.d.ts
4
5
  declare const FeatureFlagsSchema: Schema.Struct<{
@@ -47,17 +48,26 @@ declare const TokenResponse_base: Schema.Class<TokenResponse, {
47
48
  readonly expiresIn: number;
48
49
  }, {}, {}>;
49
50
  declare class TokenResponse extends TokenResponse_base {}
50
- declare const ApiKeyResponse_base: Schema.Class<ApiKeyResponse, {
51
- keyId: typeof Schema.String;
52
- apiKey: typeof Schema.String;
53
- }, Schema.Struct.Encoded<{
51
+ type ApiKeyType = Pick<ApiKey$1, "id" | "name" | "start" | "createdAt" | "lastRequest">;
52
+ type ApiKeyEncoded = { [K in keyof ApiKeyType]: ApiKeyType[K] extends Date ? string : ApiKeyType[K] extends Date | null ? string | null : ApiKeyType[K] };
53
+ declare const ApiKey: Schema.Schema<ApiKeyType, ApiKeyEncoded>;
54
+ declare const CreatedApiKey: Schema.Struct<{
55
+ id: typeof Schema.String;
56
+ key: typeof Schema.String;
57
+ name: Schema.NullOr<typeof Schema.String>;
58
+ }>;
59
+ type CreatedApiKeyType = typeof CreatedApiKey.Type;
60
+ declare const ApiKeyListResponse: Schema.Struct<{
61
+ apiKeys: Schema.Array$<Schema.Schema<ApiKeyType, ApiKeyEncoded, never>>;
62
+ }>;
63
+ type ApiKeyListResponseType = typeof ApiKeyListResponse.Type;
64
+ declare const CreateApiKeyParams: Schema.Struct<{
65
+ name: Schema.optional<typeof Schema.String>;
66
+ }>;
67
+ type CreateApiKeyParamsType = typeof CreateApiKeyParams.Type;
68
+ declare const DeleteApiKeyParams: Schema.Struct<{
54
69
  keyId: typeof Schema.String;
55
- apiKey: typeof Schema.String;
56
- }>, never, {
57
- readonly keyId: string;
58
- } & {
59
- readonly apiKey: string;
60
- }, {}, {}>;
61
- declare class ApiKeyResponse extends ApiKeyResponse_base {}
70
+ }>;
71
+ type DeleteApiKeyParamsType = typeof DeleteApiKeyParams.Type;
62
72
  //#endregion
63
- export { ApiKeyResponse, FeatureFlags, FeatureFlagsSchema, TokenResponse, WhoamiResponse };
73
+ export { ApiKey, ApiKeyListResponse, ApiKeyListResponseType, ApiKeyType, CreateApiKeyParams, CreateApiKeyParamsType, CreatedApiKey, CreatedApiKeyType, DeleteApiKeyParams, DeleteApiKeyParamsType, FeatureFlags, FeatureFlagsSchema, TokenResponse, WhoamiResponse };
@@ -13,10 +13,21 @@ var TokenResponse = class extends Schema.Class("TokenResponse")({
13
13
  expiresIn: Schema.Number,
14
14
  tokenType: Schema.String
15
15
  }) {};
16
- var ApiKeyResponse = class extends Schema.Class("ApiKeyResponse")({
17
- keyId: Schema.String,
18
- apiKey: Schema.String
19
- }) {};
16
+ const ApiKey = Schema.Struct({
17
+ id: Schema.String,
18
+ name: Schema.NullOr(Schema.String),
19
+ start: Schema.NullOr(Schema.String),
20
+ createdAt: Schema.DateFromString,
21
+ lastRequest: Schema.NullOr(Schema.DateFromString)
22
+ });
23
+ const CreatedApiKey = Schema.Struct({
24
+ id: Schema.String,
25
+ key: Schema.String,
26
+ name: Schema.NullOr(Schema.String)
27
+ });
28
+ const ApiKeyListResponse = Schema.Struct({ apiKeys: Schema.Array(ApiKey) });
29
+ const CreateApiKeyParams = Schema.Struct({ name: Schema.optional(Schema.String) });
30
+ const DeleteApiKeyParams = Schema.Struct({ keyId: Schema.String });
20
31
 
21
32
  //#endregion
22
- export { ApiKeyResponse, FeatureFlagsSchema, TokenResponse, WhoamiResponse };
33
+ export { ApiKey, ApiKeyListResponse, CreateApiKeyParams, CreatedApiKey, DeleteApiKeyParams, FeatureFlagsSchema, TokenResponse, WhoamiResponse };
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import * as effect_Brand0 from "effect/Brand";
2
+ import * as effect_Brand9 from "effect/Brand";
3
3
 
4
4
  //#region src/schemas/bookmarks.d.ts
5
5
  declare const BookmarkObjectType: Schema.Literal<["contract", "transaction", "wallet"]>;
@@ -62,10 +62,10 @@ declare const TransactionBookmark_base: Schema.Class<TransactionBookmark, {
62
62
  readonly createdAt: string;
63
63
  } & {
64
64
  readonly updatedAt: string;
65
- } & {
66
- readonly userLabel: string | null;
67
65
  } & {
68
66
  readonly transactionHash: string;
67
+ } & {
68
+ readonly userLabel: string | null;
69
69
  }, {}, {}>;
70
70
  declare class TransactionBookmark extends TransactionBookmark_base {}
71
71
  declare const WalletBookmark_base: Schema.Class<WalletBookmark, {
@@ -82,14 +82,14 @@ declare const WalletBookmark_base: Schema.Class<WalletBookmark, {
82
82
  updatedAt: typeof Schema.String;
83
83
  }>, never, {
84
84
  readonly id: string;
85
+ } & {
86
+ readonly walletAddress: string;
85
87
  } & {
86
88
  readonly createdAt: string;
87
89
  } & {
88
90
  readonly updatedAt: string;
89
91
  } & {
90
92
  readonly userLabel: string | null;
91
- } & {
92
- readonly walletAddress: string;
93
93
  }, {}, {}>;
94
94
  declare class WalletBookmark extends WalletBookmark_base {}
95
95
  declare const BookmarksList_base: Schema.Class<BookmarksList, {
@@ -140,9 +140,9 @@ declare const AddContractBookmarkParams_base: Schema.Class<AddContractBookmarkPa
140
140
  }>, never, {
141
141
  readonly blockchain: "ethereum" | "base";
142
142
  } & {
143
- readonly label?: string | undefined;
143
+ readonly address: string & effect_Brand9.Brand<"EvmAddress">;
144
144
  } & {
145
- readonly address: string & effect_Brand0.Brand<"EvmAddress">;
145
+ readonly label?: string | undefined;
146
146
  }, {}, {}>;
147
147
  declare class AddContractBookmarkParams extends AddContractBookmarkParams_base {}
148
148
  declare const AddTransactionBookmarkParams_base: Schema.Class<AddTransactionBookmarkParams, {
@@ -168,9 +168,9 @@ declare const AddWalletBookmarkParams_base: Schema.Class<AddWalletBookmarkParams
168
168
  address: Schema.brand<Schema.filter<typeof Schema.String>, "EvmAddress">;
169
169
  label: Schema.optional<typeof Schema.String>;
170
170
  }>, never, {
171
- readonly label?: string | undefined;
171
+ readonly address: string & effect_Brand9.Brand<"EvmAddress">;
172
172
  } & {
173
- readonly address: string & effect_Brand0.Brand<"EvmAddress">;
173
+ readonly label?: string | undefined;
174
174
  }, {}, {}>;
175
175
  declare class AddWalletBookmarkParams extends AddWalletBookmarkParams_base {}
176
176
  declare const UpdateBookmarkLabelParams_base: Schema.Class<UpdateBookmarkLabelParams, {
@@ -188,11 +188,11 @@ declare const UpdateBookmarkLabelParams_base: Schema.Class<UpdateBookmarkLabelPa
188
188
  }>, never, {
189
189
  readonly blockchain?: "ethereum" | "base" | undefined;
190
190
  } & {
191
- readonly label: string | null;
191
+ readonly address?: string | undefined;
192
192
  } & {
193
- readonly objectType: "contract" | "transaction" | "wallet";
193
+ readonly label: string | null;
194
194
  } & {
195
- readonly address?: string | undefined;
195
+ readonly objectType: "wallet" | "contract" | "transaction";
196
196
  } & {
197
197
  readonly txHash?: string | undefined;
198
198
  }, {}, {}>;
@@ -209,10 +209,10 @@ declare const DeleteBookmarkParams_base: Schema.Class<DeleteBookmarkParams, {
209
209
  blockchain: Schema.optional<Schema.Literal<["ethereum", "base"]>>;
210
210
  }>, never, {
211
211
  readonly blockchain?: "ethereum" | "base" | undefined;
212
- } & {
213
- readonly objectType: "contract" | "transaction" | "wallet";
214
212
  } & {
215
213
  readonly address?: string | undefined;
214
+ } & {
215
+ readonly objectType: "wallet" | "contract" | "transaction";
216
216
  } & {
217
217
  readonly txHash?: string | undefined;
218
218
  }, {}, {}>;
@@ -96,9 +96,9 @@ declare const CodeBlocksSearchParams_base: Schema.Class<CodeBlocksSearchParams,
96
96
  name: Schema.optional<typeof Schema.String>;
97
97
  }>>;
98
98
  }>, never, {
99
- readonly limit: number;
100
- } & {
101
99
  readonly scope: "user" | "public";
100
+ } & {
101
+ readonly limit: number;
102
102
  } & {
103
103
  readonly filters?: {
104
104
  readonly name?: string | undefined;
@@ -92,11 +92,11 @@ declare const CollectionsSearchParams_base: Schema.Class<CollectionsSearchParams
92
92
  name: Schema.optional<typeof Schema.String>;
93
93
  }>>;
94
94
  }>, never, {
95
- readonly limit: number;
96
- } & {
97
95
  readonly offset: number;
98
96
  } & {
99
97
  readonly scope?: readonly ("yours" | "verified" | "all")[] | undefined;
98
+ } & {
99
+ readonly limit: number;
100
100
  } & {
101
101
  readonly filters?: {
102
102
  readonly name?: string | undefined;