@radix-effects/gateway 0.1.0 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { Effect } from "effect";
1
+ import { Effect, Schema } from "effect";
2
2
  import * as _radixdlt_babylon_gateway_api_sdk6 from "@radixdlt/babylon-gateway-api-sdk";
3
3
  import { AccountLockerNotFoundError as AccountLockerNotFoundError$1, EntityFungiblesPageRequest, EntityNotFoundError as EntityNotFoundError$1, ErrorResponse as ErrorResponse$1, GatewayApiClient as GatewayApiClient$1, InternalServerError as InternalServerError$1, InvalidEntityError as InvalidEntityError$1, InvalidRequestError as InvalidRequestError$1, InvalidTransactionError as InvalidTransactionError$1, NotSyncedUpError as NotSyncedUpError$1, ResourceHoldersCollectionItem, ResponseError as ResponseError$1, StateEntityDetailsOperationRequest, StateEntityDetailsVaultResponseItem, StateKeyValueStoreDataRequest, StateKeyValueStoreKeysRequest, TransactionNotFoundError as TransactionNotFoundError$1 } from "@radixdlt/babylon-gateway-api-sdk";
4
4
  import { z } from "zod";
5
- import * as effect_ConfigError11 from "effect/ConfigError";
5
+ import { RolaError } from "@radixdlt/rola";
6
6
  import * as effect_Layer0 from "effect/Layer";
7
+ import * as effect_ConfigError0 from "effect/ConfigError";
7
8
  import * as effect_Types0 from "effect/Types";
8
9
  import * as effect_Cause0 from "effect/Cause";
9
10
  import { ParsedType, StructDefinition, StructSchema } from "sbor-ez-mode";
@@ -139,7 +140,7 @@ declare const GatewayApiClient_base: Effect.Service.Class<GatewayApiClient, "Gat
139
140
  getResourceHolders: (resourceAddress: string, cursor?: string | undefined) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.ResourceHoldersResponse, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>;
140
141
  };
141
142
  rawClient: GatewayApiClient$1;
142
- }, effect_ConfigError11.ConfigError, never>;
143
+ }, never, never>;
143
144
  }>;
144
145
  declare class GatewayApiClient extends GatewayApiClient_base {}
145
146
  //#endregion
@@ -185,26 +186,26 @@ type EntityFungiblesPageInput = Omit<EntityFungiblesPageRequest['stateEntityFung
185
186
  at_ledger_state: AtLedgerState;
186
187
  };
187
188
  declare const EntityFungiblesPage_base: Effect.Service.Class<EntityFungiblesPage, "EntityFungiblesPage", {
188
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
189
- readonly effect: Effect.Effect<(this: unknown, input: EntityFungiblesPageInput) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.FungibleResourcesCollectionItem[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
189
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
190
+ readonly effect: Effect.Effect<(this: unknown, input: EntityFungiblesPageInput) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.FungibleResourcesCollectionItem[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
190
191
  }>;
191
192
  declare class EntityFungiblesPage extends EntityFungiblesPage_base {}
192
193
  //#endregion
193
194
  //#region src/state/nonFungibleData.d.ts
194
195
  declare const NonFungibleData_base: Effect.Service.Class<NonFungibleData, "NonFungibleData", {
195
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
196
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
196
197
  readonly effect: Effect.Effect<(this: unknown, input: Omit<_radixdlt_babylon_gateway_api_sdk6.StateNonFungibleDataRequest, "at_ledger_state"> & {
197
198
  at_ledger_state: AtLedgerState;
198
- }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateNonFungibleDetailsResponseItem[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
199
+ }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateNonFungibleDetailsResponseItem[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
199
200
  }>;
200
201
  declare class NonFungibleData extends NonFungibleData_base {}
201
202
  //#endregion
202
203
  //#region src/state/entityNonFungiblesPage.d.ts
203
204
  declare const EntityNonFungiblesPage_base: Effect.Service.Class<EntityNonFungiblesPage, "EntityNonFungiblesPage", {
204
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
205
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
205
206
  readonly effect: Effect.Effect<(this: unknown, input: Omit<_radixdlt_babylon_gateway_api_sdk6.StateEntityNonFungiblesPageRequest, "at_ledger_state"> & {
206
207
  at_ledger_state: AtLedgerState;
207
- }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateEntityNonFungiblesPageResponse, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
208
+ }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateEntityNonFungiblesPageResponse, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
208
209
  }>;
209
210
  declare class EntityNonFungiblesPage extends EntityNonFungiblesPage_base {}
210
211
  //#endregion
@@ -227,7 +228,7 @@ declare const ValidatorSchema: z.ZodObject<{
227
228
  }>;
228
229
  type Validator = z.infer<typeof ValidatorSchema>;
229
230
  declare const GetValidators_base: Effect.Service.Class<GetValidators, "GetValidators", {
230
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
231
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
231
232
  readonly effect: Effect.Effect<(this: unknown) => Effect.Effect<{
232
233
  address: string;
233
234
  name: string;
@@ -243,12 +244,12 @@ type GetEntityDetailsInput = GetEntityDetailsVaultAggregatedParameters[0];
243
244
  type GetEntityDetailsOptions = GetEntityDetailsVaultAggregatedParameters[1];
244
245
  type GetEntityDetailsState = GetEntityDetailsVaultAggregatedParameters[2];
245
246
  declare const GetEntityDetailsVaultAggregated_base: Effect.Service.Class<GetEntityDetailsVaultAggregated, "GetEntityDetailsVaultAggregated", {
246
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
247
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
247
248
  readonly effect: Effect.Effect<(this: unknown, input: string[], options: _radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsOptions | undefined, at_ledger_state: {
248
249
  state_version: number;
249
250
  } | {
250
251
  timestamp: Date;
251
- }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsVaultResponseItem[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
252
+ }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsVaultResponseItem[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
252
253
  }>;
253
254
  declare class GetEntityDetailsVaultAggregated extends GetEntityDetailsVaultAggregated_base {}
254
255
  //#endregion
@@ -261,22 +262,22 @@ type GetNonFungibleIdsInput = {
261
262
  cursor?: string;
262
263
  };
263
264
  declare const EntityNonFungibleIdsPage_base: Effect.Service.Class<EntityNonFungibleIdsPage, "EntityNonFungibleIdsPage", {
264
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
265
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
265
266
  readonly effect: Effect.Effect<(this: unknown, input: GetNonFungibleIdsInput) => Effect.Effect<{
266
267
  ids: string[];
267
268
  address: string;
268
- }, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
269
+ }, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
269
270
  }>;
270
271
  declare class EntityNonFungibleIdsPage extends EntityNonFungibleIdsPage_base {}
271
272
  //#endregion
272
273
  //#region src/getNonFungibleLocation.d.ts
273
274
  declare const GetNonFungibleLocationService_base: Effect.Service.Class<GetNonFungibleLocationService, "GetNonFungibleLocationService", {
274
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
275
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
275
276
  readonly effect: Effect.Effect<(this: unknown, input: {
276
277
  resourceAddress: string;
277
278
  nonFungibleIds: string[];
278
279
  at_ledger_state: AtLedgerState;
279
- }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateNonFungibleLocationResponse[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
280
+ }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateNonFungibleLocationResponse[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
280
281
  }>;
281
282
  declare class GetNonFungibleLocationService extends GetNonFungibleLocationService_base {}
282
283
  //#endregion
@@ -293,7 +294,7 @@ type GetAddressByNonFungibleServiceInput = {
293
294
  at_ledger_state: AtLedgerState;
294
295
  };
295
296
  declare const GetAddressByNonFungibleService_base: Effect.Service.Class<GetAddressByNonFungibleService, "GetAddressByNonFungibleService", {
296
- readonly dependencies: readonly [effect_Layer0.Layer<GetNonFungibleLocationService, effect_ConfigError11.ConfigError, never>];
297
+ readonly dependencies: readonly [effect_Layer0.Layer<GetNonFungibleLocationService, effect_ConfigError0.ConfigError, never>];
297
298
  readonly effect: Effect.Effect<(this: unknown, input: GetAddressByNonFungibleServiceInput) => Effect.Effect<{
298
299
  address: string;
299
300
  resourceAddress: string;
@@ -309,7 +310,7 @@ declare class InvalidComponentStateError {
309
310
  constructor(error: unknown);
310
311
  }
311
312
  declare const GetComponentStateService_base: Effect.Service.Class<GetComponentStateService, "GetComponentStateService", {
312
- readonly dependencies: readonly [effect_Layer0.Layer<GetEntityDetailsVaultAggregated, effect_ConfigError11.ConfigError, never>];
313
+ readonly dependencies: readonly [effect_Layer0.Layer<GetEntityDetailsVaultAggregated, effect_ConfigError0.ConfigError, never>];
313
314
  readonly effect: Effect.Effect<{
314
315
  run: <T extends StructDefinition, R extends boolean>(this: unknown, input: {
315
316
  addresses: string[];
@@ -327,11 +328,11 @@ declare class GetComponentStateService extends GetComponentStateService_base {}
327
328
  //#endregion
328
329
  //#region src/state/stateEntityDetails.d.ts
329
330
  declare const StateEntityDetails_base: Effect.Service.Class<StateEntityDetails, "StateEntityDetails", {
330
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
331
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
331
332
  readonly effect: Effect.Effect<(this: unknown, input: _radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsRequest) => Effect.Effect<{
332
333
  ledger_state: _radixdlt_babylon_gateway_api_sdk6.LedgerState;
333
334
  items: _radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsResponseItem[];
334
- }, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
335
+ }, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
335
336
  }>;
336
337
  declare class StateEntityDetails extends StateEntityDetails_base {}
337
338
  //#endregion
@@ -342,7 +343,7 @@ type GetFungibleBalanceInput = Omit<StateEntityDetailsOperationRequest['stateEnt
342
343
  options?: StateEntityDetailsOperationRequest['stateEntityDetailsRequest']['opt_ins'];
343
344
  };
344
345
  declare const GetFungibleBalance_base: Effect.Service.Class<GetFungibleBalance, "GetFungibleBalance", {
345
- readonly dependencies: readonly [effect_Layer0.Layer<EntityFungiblesPage, effect_ConfigError11.ConfigError, never>, effect_Layer0.Layer<StateEntityDetails, effect_ConfigError11.ConfigError, never>];
346
+ readonly dependencies: readonly [effect_Layer0.Layer<EntityFungiblesPage, effect_ConfigError0.ConfigError, never>, effect_Layer0.Layer<StateEntityDetails, effect_ConfigError0.ConfigError, never>];
346
347
  readonly effect: Effect.Effect<(this: unknown, input: GetFungibleBalanceInput) => Effect.Effect<{
347
348
  address: string;
348
349
  items: {
@@ -351,31 +352,31 @@ declare const GetFungibleBalance_base: Effect.Service.Class<GetFungibleBalance,
351
352
  explicit_metadata?: _radixdlt_babylon_gateway_api_sdk6.EntityMetadataCollection;
352
353
  last_updated_at_state_version: number;
353
354
  }[];
354
- }[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, EntityFungiblesPage | StateEntityDetails>;
355
+ }[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, EntityFungiblesPage | StateEntityDetails>;
355
356
  }>;
356
357
  declare class GetFungibleBalance extends GetFungibleBalance_base {}
357
358
  //#endregion
358
359
  //#region src/keyValueStoreData.d.ts
359
360
  declare const KeyValueStoreDataService_base: Effect.Service.Class<KeyValueStoreDataService, "KeyValueStoreDataService", {
360
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
361
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
361
362
  readonly effect: Effect.Effect<(this: unknown, input: Omit<StateKeyValueStoreDataRequest, "at_ledger_state"> & {
362
363
  at_ledger_state: AtLedgerState;
363
- }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateKeyValueStoreDataResponse[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
364
+ }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateKeyValueStoreDataResponse[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
364
365
  }>;
365
366
  declare class KeyValueStoreDataService extends KeyValueStoreDataService_base {}
366
367
  //#endregion
367
368
  //#region src/keyValueStoreKeys.d.ts
368
369
  declare const KeyValueStoreKeysService_base: Effect.Service.Class<KeyValueStoreKeysService, "KeyValueStoreKeysService", {
369
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
370
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
370
371
  readonly effect: Effect.Effect<(this: unknown, input: Omit<StateKeyValueStoreKeysRequest, "at_ledger_state"> & {
371
372
  at_ledger_state: AtLedgerState;
372
- }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateKeyValueStoreKeysResponse, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, GatewayApiClient>;
373
+ }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.StateKeyValueStoreKeysResponse, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient>;
373
374
  }>;
374
375
  declare class KeyValueStoreKeysService extends KeyValueStoreKeysService_base {}
375
376
  //#endregion
376
377
  //#region src/getKeyValueStore.d.ts
377
378
  declare const GetKeyValueStoreService_base: Effect.Service.Class<GetKeyValueStoreService, "GetKeyValueStoreService", {
378
- readonly dependencies: readonly [effect_Layer0.Layer<KeyValueStoreKeysService, effect_ConfigError11.ConfigError, never>, effect_Layer0.Layer<KeyValueStoreDataService, effect_ConfigError11.ConfigError, never>];
379
+ readonly dependencies: readonly [effect_Layer0.Layer<KeyValueStoreKeysService, effect_ConfigError0.ConfigError, never>, effect_Layer0.Layer<KeyValueStoreDataService, effect_ConfigError0.ConfigError, never>];
379
380
  readonly effect: Effect.Effect<(this: unknown, input: {
380
381
  address: string;
381
382
  at_ledger_state: AtLedgerState;
@@ -392,7 +393,7 @@ type GetLedgerStateInput = {
392
393
  at_ledger_state: AtLedgerState;
393
394
  };
394
395
  declare const GetLedgerStateService_base: Effect.Service.Class<GetLedgerStateService, "GetLedgerStateService", {
395
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
396
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
396
397
  readonly effect: Effect.Effect<(this: unknown, input: GetLedgerStateInput) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.LedgerState, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, never, GatewayApiClient>;
397
398
  }>;
398
399
  declare class GetLedgerStateService extends GetLedgerStateService_base {}
@@ -405,14 +406,14 @@ type GetNftResourceManagersInput = {
405
406
  options?: StateEntityDetailsOperationRequest['stateEntityDetailsRequest']['opt_ins'];
406
407
  };
407
408
  declare const GetNftResourceManagersService_base: Effect.Service.Class<GetNftResourceManagersService, "GetNftResourceManagersService", {
408
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>, effect_Layer0.Layer<EntityNonFungiblesPage, effect_ConfigError11.ConfigError, never>, effect_Layer0.Layer<EntityNonFungibleIdsPage, effect_ConfigError11.ConfigError, never>];
409
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>, effect_Layer0.Layer<EntityNonFungiblesPage, effect_ConfigError0.ConfigError, never>, effect_Layer0.Layer<EntityNonFungibleIdsPage, effect_ConfigError0.ConfigError, never>];
409
410
  readonly effect: Effect.Effect<(this: unknown, input: GetNftResourceManagersInput) => Effect.Effect<{
410
411
  address: string;
411
412
  items: {
412
413
  resourceAddress: string;
413
414
  nftIds: string[];
414
415
  }[];
415
- }[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, EntityNonFungiblesPage | GatewayApiClient | EntityNonFungibleIdsPage>;
416
+ }[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient | EntityNonFungiblesPage | EntityNonFungibleIdsPage>;
416
417
  }>;
417
418
  declare class GetNftResourceManagersService extends GetNftResourceManagersService_base {}
418
419
  //#endregion
@@ -430,7 +431,7 @@ type GetNonFungibleBalanceInput = {
430
431
  };
431
432
  type GetNonFungibleBalanceOutput = Effect.Effect.Success<Awaited<ReturnType<(typeof GetNonFungibleBalanceService)['Service']>>>;
432
433
  declare const GetNonFungibleBalanceService_base: Effect.Service.Class<GetNonFungibleBalanceService, "GetNonFungibleBalanceService", {
433
- readonly dependencies: readonly [effect_Layer0.Layer<NonFungibleData, effect_ConfigError11.ConfigError, never>, effect_Layer0.Layer<GetNftResourceManagersService, effect_ConfigError11.ConfigError, never>];
434
+ readonly dependencies: readonly [effect_Layer0.Layer<NonFungibleData, effect_ConfigError0.ConfigError, never>, effect_Layer0.Layer<GetNftResourceManagersService, effect_ConfigError0.ConfigError, never>];
434
435
  readonly effect: Effect.Effect<(this: unknown, input: GetNonFungibleBalanceInput) => Effect.Effect<{
435
436
  items: {
436
437
  address: string;
@@ -444,13 +445,13 @@ declare const GetNonFungibleBalanceService_base: Effect.Service.Class<GetNonFung
444
445
  }[];
445
446
  }[];
446
447
  }[];
447
- }, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError11.ConfigError, NonFungibleData | GetNftResourceManagersService>;
448
+ }, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, NonFungibleData | GetNftResourceManagersService>;
448
449
  }>;
449
450
  declare class GetNonFungibleBalanceService extends GetNonFungibleBalanceService_base {}
450
451
  //#endregion
451
452
  //#region src/getResourceHolders.d.ts
452
453
  declare const GetResourceHoldersService_base: Effect.Service.Class<GetResourceHoldersService, "GetResourceHoldersService", {
453
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, effect_ConfigError11.ConfigError, never>];
454
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
454
455
  readonly effect: Effect.Effect<(this: unknown, input: {
455
456
  resourceAddress: string;
456
457
  cursor?: string;
@@ -458,4 +459,66 @@ declare const GetResourceHoldersService_base: Effect.Service.Class<GetResourceHo
458
459
  }>;
459
460
  declare class GetResourceHoldersService extends GetResourceHoldersService_base {}
460
461
  //#endregion
461
- export { AccountLockerNotFoundError, AtLedgerState, AtLedgerStateSchema, EntityFungiblesPage, EntityNonFungibleIdsPage, EntityNonFungiblesPage, EntityNotFoundError, ErrorResponse, GatewayApiClient, GetAddressByNonFungibleService, GetAddressByNonFungibleServiceInput, GetComponentStateService, GetEntityDetailsInput, GetEntityDetailsOptions, GetEntityDetailsState, GetEntityDetailsVaultAggregated, GetEntityDetailsVaultAggregatedParameters, GetFungibleBalance, GetFungibleBalanceOutput, GetKeyValueStoreService, GetLedgerStateInput, GetLedgerStateService, GetNftResourceManagersService, GetNonFungibleBalanceOutput, GetNonFungibleBalanceService, GetNonFungibleIdsInput, GetNonFungibleLocationService, GetResourceHoldersService, GetValidators, InternalServerError, InvalidComponentStateError, InvalidEntityError, InvalidInputError, InvalidRequestError, InvalidStateInputError, InvalidTransactionError, KeyValueStoreDataService, KeyValueStoreKeysService, NonFungibleData, NotSyncedUpError, RateLimitExceededError, ResponseError, StateVersion, StateVersionSchema, TimestampSchema, TransactionNotFoundError, UnknownGatewayError, Validator, ValidatorSchema, validateAtLedgerStateInput };
462
+ //#region src/rola.d.ts
463
+ declare const VerifyRolaProofError_base: new <A extends Record<string, any> = {}>(args: effect_Types0.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P] }) => effect_Cause0.YieldableError & {
464
+ readonly _tag: "VerifyRolaProofError";
465
+ } & Readonly<A>;
466
+ declare class VerifyRolaProofError extends VerifyRolaProofError_base<{
467
+ error: RolaError;
468
+ }> {}
469
+ declare const ProofSchema: Schema.Struct<{
470
+ publicKey: typeof Schema.String;
471
+ signature: typeof Schema.String;
472
+ curve: Schema.Union<[Schema.Literal<["curve25519"]>, Schema.Literal<["secp256k1"]>]>;
473
+ }>;
474
+ declare const PersonaProofSchema: Schema.Struct<{
475
+ address: typeof Schema.String;
476
+ type: Schema.Literal<["persona"]>;
477
+ challenge: typeof Schema.String;
478
+ proof: Schema.Struct<{
479
+ publicKey: typeof Schema.String;
480
+ signature: typeof Schema.String;
481
+ curve: Schema.Union<[Schema.Literal<["curve25519"]>, Schema.Literal<["secp256k1"]>]>;
482
+ }>;
483
+ }>;
484
+ declare const AccountProofSchema: Schema.Struct<{
485
+ address: typeof Schema.String;
486
+ type: Schema.Literal<["account"]>;
487
+ challenge: typeof Schema.String;
488
+ proof: Schema.Struct<{
489
+ publicKey: typeof Schema.String;
490
+ signature: typeof Schema.String;
491
+ curve: Schema.Union<[Schema.Literal<["curve25519"]>, Schema.Literal<["secp256k1"]>]>;
492
+ }>;
493
+ }>;
494
+ declare const RolaProofSchema: Schema.Union<[Schema.Struct<{
495
+ address: typeof Schema.String;
496
+ type: Schema.Literal<["persona"]>;
497
+ challenge: typeof Schema.String;
498
+ proof: Schema.Struct<{
499
+ publicKey: typeof Schema.String;
500
+ signature: typeof Schema.String;
501
+ curve: Schema.Union<[Schema.Literal<["curve25519"]>, Schema.Literal<["secp256k1"]>]>;
502
+ }>;
503
+ }>, Schema.Struct<{
504
+ address: typeof Schema.String;
505
+ type: Schema.Literal<["account"]>;
506
+ challenge: typeof Schema.String;
507
+ proof: Schema.Struct<{
508
+ publicKey: typeof Schema.String;
509
+ signature: typeof Schema.String;
510
+ curve: Schema.Union<[Schema.Literal<["curve25519"]>, Schema.Literal<["secp256k1"]>]>;
511
+ }>;
512
+ }>]>;
513
+ type PersonaProof = typeof PersonaProofSchema.Type;
514
+ type AccountProof = typeof AccountProofSchema.Type;
515
+ type RolaProof = typeof RolaProofSchema.Type;
516
+ declare const Rola_base: Effect.Service.Class<Rola, "Rola", {
517
+ readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
518
+ readonly effect: Effect.Effect<{
519
+ verifySignedChallenge: (input: RolaProof) => Effect.Effect<undefined, VerifyRolaProofError, never>;
520
+ }, never, GatewayApiClient>;
521
+ }>;
522
+ declare class Rola extends Rola_base {}
523
+ //#endregion
524
+ export { AccountLockerNotFoundError, AccountProof, AccountProofSchema, AtLedgerState, AtLedgerStateSchema, EntityFungiblesPage, EntityNonFungibleIdsPage, EntityNonFungiblesPage, EntityNotFoundError, ErrorResponse, GatewayApiClient, GetAddressByNonFungibleService, GetAddressByNonFungibleServiceInput, GetComponentStateService, GetEntityDetailsInput, GetEntityDetailsOptions, GetEntityDetailsState, GetEntityDetailsVaultAggregated, GetEntityDetailsVaultAggregatedParameters, GetFungibleBalance, GetFungibleBalanceOutput, GetKeyValueStoreService, GetLedgerStateInput, GetLedgerStateService, GetNftResourceManagersService, GetNonFungibleBalanceOutput, GetNonFungibleBalanceService, GetNonFungibleIdsInput, GetNonFungibleLocationService, GetResourceHoldersService, GetValidators, InternalServerError, InvalidComponentStateError, InvalidEntityError, InvalidInputError, InvalidRequestError, InvalidStateInputError, InvalidTransactionError, KeyValueStoreDataService, KeyValueStoreKeysService, NonFungibleData, NotSyncedUpError, PersonaProof, PersonaProofSchema, ProofSchema, RateLimitExceededError, ResponseError, Rola, RolaProof, RolaProofSchema, StateVersion, StateVersionSchema, TimestampSchema, TransactionNotFoundError, UnknownGatewayError, Validator, ValidatorSchema, VerifyRolaProofError, validateAtLedgerStateInput };
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
- import { Config, Data, Effect } from "effect";
1
+ import { Config, Data, Effect, Schema } from "effect";
2
2
  import { GatewayApiClient as GatewayApiClient$1, ResponseError as ResponseError$1 } from "@radixdlt/babylon-gateway-api-sdk";
3
3
  import { z } from "zod";
4
4
  import { BigNumber } from "bignumber.js";
5
+ import { Rola as Rola$1 } from "@radixdlt/rola";
5
6
 
6
7
  //#region src/gatewayApiClient.ts
7
8
  var AccountLockerNotFoundError = class extends Data.TaggedError("AccountLockerNotFoundError") {};
@@ -17,10 +18,10 @@ var ErrorResponse = class extends Data.TaggedError("ErrorResponse") {};
17
18
  var RateLimitExceededError = class extends Data.TaggedError("RateLimitExceededError") {};
18
19
  var UnknownGatewayError = class extends Data.TaggedError("UnknownGatewayError") {};
19
20
  var GatewayApiClient = class extends Effect.Service()("GatewayApiClient", { effect: Effect.gen(function* () {
20
- const networkId = yield* Config.number("NETWORK_ID").pipe(Config.withDefault(1));
21
- const basePath = yield* Config.string("GATEWAY_URL").pipe(Config.withDefault(void 0));
22
- const applicationName = yield* Config.string("APPLICATION_NAME").pipe(Config.withDefault("@radix-effects/gateway"));
23
- const gatewayApiKey = yield* Config.string("GATEWAY_BASIC_AUTH").pipe(Config.withDefault(void 0));
21
+ const networkId = yield* Config.number("NETWORK_ID").pipe(Config.withDefault(1)).pipe(Effect.orDie);
22
+ const basePath = yield* Config.string("GATEWAY_URL").pipe(Config.withDefault(void 0)).pipe(Effect.orDie);
23
+ const applicationName = yield* Config.string("APPLICATION_NAME").pipe(Config.withDefault("@radix-effects/gateway")).pipe(Effect.orDie);
24
+ const gatewayApiKey = yield* Config.string("GATEWAY_BASIC_AUTH").pipe(Config.withDefault(void 0)).pipe(Effect.orDie);
24
25
  const gatewayApiClient = GatewayApiClient$1.initialize({
25
26
  networkId,
26
27
  basePath,
@@ -768,4 +769,42 @@ const validateAtLedgerStateInput = (input) => Effect.gen(function* () {
768
769
  });
769
770
 
770
771
  //#endregion
771
- export { AccountLockerNotFoundError, AtLedgerStateSchema, EntityFungiblesPage, EntityNonFungibleIdsPage, EntityNonFungiblesPage, EntityNotFoundError, ErrorResponse, GatewayApiClient, GetAddressByNonFungibleService, GetComponentStateService, GetEntityDetailsVaultAggregated, GetFungibleBalance, GetKeyValueStoreService, GetLedgerStateService, GetNftResourceManagersService, GetNonFungibleBalanceService, GetNonFungibleLocationService, GetResourceHoldersService, GetValidators, InternalServerError, InvalidComponentStateError, InvalidEntityError, InvalidInputError, InvalidRequestError, InvalidStateInputError, InvalidTransactionError, KeyValueStoreDataService, KeyValueStoreKeysService, NonFungibleData, NotSyncedUpError, RateLimitExceededError, ResponseError, StateVersionSchema, TimestampSchema, TransactionNotFoundError, UnknownGatewayError, ValidatorSchema, validateAtLedgerStateInput };
772
+ //#region src/rola.ts
773
+ var VerifyRolaProofError = class extends Data.TaggedError("VerifyRolaProofError") {};
774
+ const ProofSchema = Schema.Struct({
775
+ publicKey: Schema.String,
776
+ signature: Schema.String,
777
+ curve: Schema.Union(Schema.Literal("curve25519"), Schema.Literal("secp256k1"))
778
+ });
779
+ const PersonaProofSchema = Schema.Struct({
780
+ address: Schema.String,
781
+ type: Schema.Literal("persona"),
782
+ challenge: Schema.String,
783
+ proof: ProofSchema
784
+ });
785
+ const AccountProofSchema = Schema.Struct({
786
+ address: Schema.String,
787
+ type: Schema.Literal("account"),
788
+ challenge: Schema.String,
789
+ proof: ProofSchema
790
+ });
791
+ const RolaProofSchema = Schema.Union(PersonaProofSchema, AccountProofSchema);
792
+ var Rola = class extends Effect.Service()("Rola", {
793
+ dependencies: [GatewayApiClient.Default],
794
+ effect: Effect.gen(function* () {
795
+ const { verifySignedChallenge } = Rola$1({
796
+ networkId: yield* Config.number("NETWORK_ID").pipe(Config.withDefault(1)).pipe(Effect.orDie),
797
+ applicationName: yield* Config.string("APPLICATION_NAME").pipe(Config.withDefault("@radix-effects/gateway")).pipe(Effect.orDie),
798
+ dAppDefinitionAddress: yield* Config.string("DAPP_DEFINITION_ADDRESS").pipe(Effect.orDie),
799
+ expectedOrigin: yield* Config.string("ROLA_EXPECTED_ORIGIN").pipe(Effect.orDie),
800
+ gatewayApiClient: (yield* GatewayApiClient).rawClient
801
+ });
802
+ return { verifySignedChallenge: (input) => Effect.gen(function* () {
803
+ const result = yield* Effect.tryPromise(() => verifySignedChallenge(input)).pipe(Effect.catchTag("UnknownException", Effect.orDie));
804
+ if (result.isErr()) return yield* new VerifyRolaProofError({ error: result.error });
805
+ }) };
806
+ })
807
+ }) {};
808
+
809
+ //#endregion
810
+ export { AccountLockerNotFoundError, AccountProofSchema, AtLedgerStateSchema, EntityFungiblesPage, EntityNonFungibleIdsPage, EntityNonFungiblesPage, EntityNotFoundError, ErrorResponse, GatewayApiClient, GetAddressByNonFungibleService, GetComponentStateService, GetEntityDetailsVaultAggregated, GetFungibleBalance, GetKeyValueStoreService, GetLedgerStateService, GetNftResourceManagersService, GetNonFungibleBalanceService, GetNonFungibleLocationService, GetResourceHoldersService, GetValidators, InternalServerError, InvalidComponentStateError, InvalidEntityError, InvalidInputError, InvalidRequestError, InvalidStateInputError, InvalidTransactionError, KeyValueStoreDataService, KeyValueStoreKeysService, NonFungibleData, NotSyncedUpError, PersonaProofSchema, ProofSchema, RateLimitExceededError, ResponseError, Rola, RolaProofSchema, StateVersionSchema, TimestampSchema, TransactionNotFoundError, UnknownGatewayError, ValidatorSchema, VerifyRolaProofError, validateAtLedgerStateInput };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-effects/gateway",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -24,6 +24,7 @@
24
24
  "dependencies": {
25
25
  "@radixdlt/babylon-gateway-api-sdk": "^1.10.1",
26
26
  "@radixdlt/radix-engine-toolkit": "^1.0.5",
27
+ "@radixdlt/rola": "^2.1.0",
27
28
  "bignumber.js": "^9.2.1",
28
29
  "effect": "^3.14.1",
29
30
  "zod": "^3.24.1",