@herd-labs/sdk 0.1.0 → 0.3.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 (47) 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.js +7 -7
  17. package/dist/src/live/CodeBlocksServiceLive.d.ts +2 -2
  18. package/dist/src/live/CodeBlocksServiceLive.js +1 -2
  19. package/dist/src/live/CollectionsServiceLive.d.ts +2 -2
  20. package/dist/src/live/CollectionsServiceLive.js +5 -5
  21. package/dist/src/live/ContractsServiceLive.d.ts +2 -2
  22. package/dist/src/live/ContractsServiceLive.js +5 -5
  23. package/dist/src/live/DocsServiceLive.d.ts +2 -2
  24. package/dist/src/live/DocsServiceLive.js +3 -3
  25. package/dist/src/live/GroupsServiceLive.js +7 -7
  26. package/dist/src/live/HalServiceLive.d.ts +2 -2
  27. package/dist/src/live/HalServiceLive.js +4 -4
  28. package/dist/src/live/TransactionsServiceLive.d.ts +2 -2
  29. package/dist/src/live/TransactionsServiceLive.js +4 -4
  30. package/dist/src/live/WalletsServiceLive.d.ts +2 -2
  31. package/dist/src/live/WalletsServiceLive.js +5 -5
  32. package/dist/src/live/http.d.ts +1 -4
  33. package/dist/src/live/http.js +15 -4
  34. package/dist/src/schemas/actions.d.ts +13 -13
  35. package/dist/src/schemas/agent-wallets.d.ts +20 -20
  36. package/dist/src/schemas/auth.d.ts +22 -12
  37. package/dist/src/schemas/auth.js +16 -5
  38. package/dist/src/schemas/bookmarks.d.ts +8 -8
  39. package/dist/src/schemas/codeblocks.d.ts +9 -9
  40. package/dist/src/schemas/collections.d.ts +7 -7
  41. package/dist/src/schemas/contracts.d.ts +13 -13
  42. package/dist/src/schemas/hal.d.ts +19 -17
  43. package/dist/src/schemas/hal.js +1 -1
  44. package/dist/src/schemas/transactions.d.ts +29 -29
  45. package/dist/src/schemas/wallets.d.ts +22 -22
  46. package/dist/src/services/AuthService.d.ts +3 -2
  47. package/package.json +2 -1
@@ -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_HttpClient6 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_HttpClient6.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,
@@ -28,7 +28,7 @@ const HalServiceLive = Layer.effect(HalService, Effect.gen(function* () {
28
28
  }),
29
29
  evaluateExisting: (params) => callEvaluateExisting({
30
30
  actionId: params.actionId,
31
- version: params.version,
31
+ actionExpressionId: params.actionExpressionId,
32
32
  walletAddress: params.walletAddress,
33
33
  inputValues: params.inputValues ?? {},
34
34
  simulationBalanceFunding: params.simulationBalanceFunding ?? [],
@@ -1,9 +1,9 @@
1
1
  import { HerdConfig } from "../config.js";
2
2
  import { TransactionsService } from "../services/TransactionsService.js";
3
3
  import { Layer } from "effect";
4
- import * as _effect_platform_HttpClient12 from "@effect/platform/HttpClient";
4
+ import * as _effect_platform_HttpClient7 from "@effect/platform/HttpClient";
5
5
 
6
6
  //#region src/live/TransactionsServiceLive.d.ts
7
- declare const TransactionsServiceLive: Layer.Layer<TransactionsService, never, HerdConfig | _effect_platform_HttpClient12.HttpClient>;
7
+ declare const TransactionsServiceLive: Layer.Layer<TransactionsService, never, HerdConfig | _effect_platform_HttpClient7.HttpClient>;
8
8
  //#endregion
9
9
  export { TransactionsServiceLive };
@@ -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_HttpClient8 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_HttpClient8.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
  };
@@ -28,10 +28,10 @@ declare const ActionExpression_base: Schema.Class<ActionExpression, {
28
28
  readonly name: string;
29
29
  } & {
30
30
  readonly intent?: string | undefined;
31
- } & {
32
- readonly expression: unknown;
33
31
  } & {
34
32
  readonly publishedAt?: string | null | undefined;
33
+ } & {
34
+ readonly expression: unknown;
35
35
  }, {}, {}>;
36
36
  declare class ActionExpression extends ActionExpression_base {}
37
37
  declare const Action_base: Schema.Class<Action, {
@@ -104,10 +104,10 @@ declare const ActionVersion_base: Schema.Class<ActionVersion, {
104
104
  readonly name: string;
105
105
  } & {
106
106
  readonly intent?: string | undefined;
107
- } & {
108
- readonly expression: unknown;
109
107
  } & {
110
108
  readonly publishedAt?: string | null | undefined;
109
+ } & {
110
+ readonly expression: unknown;
111
111
  }, {}, {}>;
112
112
  declare class ActionVersion extends ActionVersion_base {}
113
113
  declare const ActionsSearchParams_base: Schema.Class<ActionsSearchParams, {
@@ -129,14 +129,14 @@ declare const ActionsSearchParams_base: Schema.Class<ActionsSearchParams, {
129
129
  }>, never, {
130
130
  readonly limit: number;
131
131
  } & {
132
- readonly offset: number;
133
- } & {
134
- readonly scope: readonly ("yours" | "all_published" | "verified")[];
132
+ readonly scope: readonly ("yours" | "verified" | "all_published")[];
135
133
  } & {
136
134
  readonly filters?: {
137
135
  readonly name?: string | undefined;
138
136
  readonly expressionType?: "action" | "adapter" | undefined;
139
137
  } | undefined;
138
+ } & {
139
+ readonly offset: number;
140
140
  }, {}, {}>;
141
141
  declare class ActionsSearchParams extends ActionsSearchParams_base {}
142
142
  declare const ActionsSearchResponse_base: Schema.Class<ActionsSearchResponse, {
@@ -149,10 +149,10 @@ declare const ActionsSearchResponse_base: Schema.Class<ActionsSearchResponse, {
149
149
  nextCursor: Schema.optional<Schema.NullOr<typeof Schema.String>>;
150
150
  }>, never, {
151
151
  readonly items: readonly Action[];
152
- } & {
153
- readonly totalCount?: number | undefined;
154
152
  } & {
155
153
  readonly nextCursor?: string | null | undefined;
154
+ } & {
155
+ readonly totalCount?: number | undefined;
156
156
  }, {}, {}>;
157
157
  declare class ActionsSearchResponse extends ActionsSearchResponse_base {}
158
158
  declare const ActionVersionsResponse_base: Schema.Class<ActionVersionsResponse, {
@@ -210,9 +210,9 @@ declare const RelatedAdaptersContract_base: Schema.Class<RelatedAdaptersContract
210
210
  contractAddress: typeof Schema.String;
211
211
  functionSignatures: Schema.Array$<typeof RelatedAdaptersFunctionSignature>;
212
212
  }>, never, {
213
- readonly contractAddress: string;
214
- } & {
215
213
  readonly blockchain: string | null;
214
+ } & {
215
+ readonly contractAddress: string;
216
216
  } & {
217
217
  readonly functionSignatures: readonly RelatedAdaptersFunctionSignature[];
218
218
  }, {}, {}>;
@@ -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
240
  readonly address: string & effect_Brand14.Brand<"EvmAddress">;
239
241
  readonly functionSignatures?: readonly string[] | undefined;
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, {
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect";
2
- import * as effect_Brand3 from "effect/Brand";
2
+ import * as effect_Brand5 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_Brand5.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_Brand5.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_Brand5.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_Brand5.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_Brand5.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_Brand5.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_Brand5.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_Brand5.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_Brand5.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 };
@@ -24,10 +24,10 @@ declare const ContractBookmark_base: Schema.Class<ContractBookmark, {
24
24
  updatedAt: typeof Schema.String;
25
25
  }>, never, {
26
26
  readonly id: string;
27
- } & {
28
- readonly contractAddress: string;
29
27
  } & {
30
28
  readonly blockchain: string;
29
+ } & {
30
+ readonly contractAddress: string;
31
31
  } & {
32
32
  readonly createdAt: string;
33
33
  } & {
@@ -154,11 +154,11 @@ declare const AddTransactionBookmarkParams_base: Schema.Class<AddTransactionBook
154
154
  blockchain: Schema.Literal<["ethereum", "base"]>;
155
155
  label: Schema.optional<typeof Schema.String>;
156
156
  }>, never, {
157
+ readonly txHash: string;
158
+ } & {
157
159
  readonly blockchain: "ethereum" | "base";
158
160
  } & {
159
161
  readonly label?: string | undefined;
160
- } & {
161
- readonly txHash: string;
162
162
  }, {}, {}>;
163
163
  declare class AddTransactionBookmarkParams extends AddTransactionBookmarkParams_base {}
164
164
  declare const AddWalletBookmarkParams_base: Schema.Class<AddWalletBookmarkParams, {
@@ -186,6 +186,8 @@ declare const UpdateBookmarkLabelParams_base: Schema.Class<UpdateBookmarkLabelPa
186
186
  blockchain: Schema.optional<Schema.Literal<["ethereum", "base"]>>;
187
187
  label: Schema.NullOr<typeof Schema.String>;
188
188
  }>, never, {
189
+ readonly txHash?: string | undefined;
190
+ } & {
189
191
  readonly blockchain?: "ethereum" | "base" | undefined;
190
192
  } & {
191
193
  readonly label: string | null;
@@ -193,8 +195,6 @@ declare const UpdateBookmarkLabelParams_base: Schema.Class<UpdateBookmarkLabelPa
193
195
  readonly objectType: "contract" | "transaction" | "wallet";
194
196
  } & {
195
197
  readonly address?: string | undefined;
196
- } & {
197
- readonly txHash?: string | undefined;
198
198
  }, {}, {}>;
199
199
  declare class UpdateBookmarkLabelParams extends UpdateBookmarkLabelParams_base {}
200
200
  declare const DeleteBookmarkParams_base: Schema.Class<DeleteBookmarkParams, {
@@ -208,13 +208,13 @@ declare const DeleteBookmarkParams_base: Schema.Class<DeleteBookmarkParams, {
208
208
  txHash: Schema.optional<typeof Schema.String>;
209
209
  blockchain: Schema.optional<Schema.Literal<["ethereum", "base"]>>;
210
210
  }>, never, {
211
+ readonly txHash?: string | undefined;
212
+ } & {
211
213
  readonly blockchain?: "ethereum" | "base" | undefined;
212
214
  } & {
213
215
  readonly objectType: "contract" | "transaction" | "wallet";
214
216
  } & {
215
217
  readonly address?: string | undefined;
216
- } & {
217
- readonly txHash?: string | undefined;
218
218
  }, {}, {}>;
219
219
  declare class DeleteBookmarkParams extends DeleteBookmarkParams_base {}
220
220
  //#endregion
@@ -23,14 +23,14 @@ declare const CodeBlockCode_base: Schema.Class<CodeBlockCode, {
23
23
  readonly name: string;
24
24
  } & {
25
25
  readonly intent: string;
26
- } & {
27
- readonly publishedAt: string | null;
28
26
  } & {
29
27
  readonly code: string;
30
28
  } & {
31
29
  readonly valTownFileUrl: string;
32
30
  } & {
33
31
  readonly arguments?: unknown;
32
+ } & {
33
+ readonly publishedAt: string | null;
34
34
  }, {}, {}>;
35
35
  declare class CodeBlockCode extends CodeBlockCode_base {}
36
36
  declare const CodeBlockVersion_base: Schema.Class<CodeBlockVersion, {
@@ -99,12 +99,12 @@ declare const CodeBlocksSearchParams_base: Schema.Class<CodeBlocksSearchParams,
99
99
  readonly limit: number;
100
100
  } & {
101
101
  readonly scope: "user" | "public";
102
+ } & {
103
+ readonly cursor?: string | undefined;
102
104
  } & {
103
105
  readonly filters?: {
104
106
  readonly name?: string | undefined;
105
107
  } | undefined;
106
- } & {
107
- readonly cursor?: string | undefined;
108
108
  }, {}, {}>;
109
109
  declare class CodeBlocksSearchParams extends CodeBlocksSearchParams_base {}
110
110
  declare const CodeBlocksSearchResponse_base: Schema.Class<CodeBlocksSearchResponse, {
@@ -172,9 +172,9 @@ declare const CodeBlockLogEntry_base: Schema.Class<CodeBlockLogEntry, {
172
172
  message: typeof Schema.String;
173
173
  time: typeof Schema.String;
174
174
  }>, never, {
175
- readonly message: string;
176
- } & {
177
175
  readonly level: string;
176
+ } & {
177
+ readonly message: string;
178
178
  } & {
179
179
  readonly time: string;
180
180
  }, {}, {}>;
@@ -204,8 +204,8 @@ declare const CodeBlockExecuteResponse_base: Schema.Class<CodeBlockExecuteRespon
204
204
  } & {
205
205
  readonly error?: {
206
206
  readonly message: string;
207
- readonly body?: unknown;
208
207
  readonly status?: number | undefined;
208
+ readonly body?: unknown;
209
209
  } | undefined;
210
210
  } & {
211
211
  readonly logs?: readonly CodeBlockLogEntry[] | undefined;
@@ -263,12 +263,12 @@ declare const CreateCodeVersionResponse_base: Schema.Class<CreateCodeVersionResp
263
263
  readonly name: string;
264
264
  } & {
265
265
  readonly intent: string;
266
- } & {
267
- readonly publishedAt: string | null;
268
266
  } & {
269
267
  readonly code: string;
270
268
  } & {
271
269
  readonly valTownFileUrl: string;
270
+ } & {
271
+ readonly publishedAt: string | null;
272
272
  }, {}, {}>;
273
273
  declare class CreateCodeVersionResponse extends CreateCodeVersionResponse_base {}
274
274
  declare const UpdateCodeBlockMetadataParams_base: Schema.Class<UpdateCodeBlockMetadataParams, {
@@ -11,10 +11,10 @@ declare const CollectionSpecItem_base: Schema.Class<CollectionSpecItem, {
11
11
  expressionRef: typeof Schema.String;
12
12
  }>, never, {
13
13
  readonly id: string;
14
- } & {
15
- readonly type: "action" | "adapter";
16
14
  } & {
17
15
  readonly expressionRef: string;
16
+ } & {
17
+ readonly type: "action" | "adapter";
18
18
  }, {}, {}>;
19
19
  declare class CollectionSpecItem extends CollectionSpecItem_base {}
20
20
  declare const CollectionSpec_base: Schema.Class<CollectionSpec, {
@@ -94,13 +94,13 @@ declare const CollectionsSearchParams_base: Schema.Class<CollectionsSearchParams
94
94
  }>, never, {
95
95
  readonly limit: number;
96
96
  } & {
97
- readonly offset: number;
98
- } & {
99
- readonly scope?: readonly ("yours" | "verified" | "all")[] | undefined;
97
+ readonly scope?: readonly ("yours" | "all" | "verified")[] | undefined;
100
98
  } & {
101
99
  readonly filters?: {
102
100
  readonly name?: string | undefined;
103
101
  } | undefined;
102
+ } & {
103
+ readonly offset: number;
104
104
  }, {}, {}>;
105
105
  declare class CollectionsSearchParams extends CollectionsSearchParams_base {}
106
106
  declare const CollectionsSearchResponse_base: Schema.Class<CollectionsSearchResponse, {
@@ -149,8 +149,8 @@ declare const CreateCollectionParams_base: Schema.Class<CreateCollectionParams,
149
149
  readonly spec: {
150
150
  readonly items: readonly {
151
151
  readonly id: string;
152
- readonly type: "action" | "adapter";
153
152
  readonly expressionRef: string;
153
+ readonly type: "action" | "adapter";
154
154
  }[];
155
155
  readonly version: "1.0";
156
156
  };
@@ -230,8 +230,8 @@ declare const UpdateCollectionParams_base: Schema.Class<UpdateCollectionParams,
230
230
  readonly spec?: {
231
231
  readonly items: readonly {
232
232
  readonly id: string;
233
- readonly type: "action" | "adapter";
234
233
  readonly expressionRef: string;
234
+ readonly type: "action" | "adapter";
235
235
  }[];
236
236
  readonly version: "1.0";
237
237
  } | undefined;