@radix-effects/gateway 0.3.2 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +27 -25
  2. package/dist/index.js +215 -238
  3. package/package.json +2 -1
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { Effect, Schema } from "effect";
2
2
  import * as _radixdlt_babylon_gateway_api_sdk6 from "@radixdlt/babylon-gateway-api-sdk";
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";
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, TransactionPreviewOperationRequest } from "@radixdlt/babylon-gateway-api-sdk";
4
4
  import { z } from "zod";
5
5
  import { RolaError } from "@radixdlt/rola";
6
- import * as effect_Layer0 from "effect/Layer";
7
6
  import * as effect_ConfigError0 from "effect/ConfigError";
8
7
  import * as effect_Types0 from "effect/Types";
9
8
  import * as effect_Cause0 from "effect/Cause";
9
+ import * as effect_Layer0 from "effect/Layer";
10
10
  import { ParsedType, StructDefinition, StructSchema } from "sbor-ez-mode";
11
11
 
12
12
  //#region src/gatewayApiClient.d.ts
@@ -188,14 +188,12 @@ type EntityFungiblesPageInput = Omit<EntityFungiblesPageRequest['stateEntityFung
188
188
  at_ledger_state: AtLedgerState;
189
189
  };
190
190
  declare const EntityFungiblesPage_base: Effect.Service.Class<EntityFungiblesPage, "EntityFungiblesPage", {
191
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
192
191
  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>;
193
192
  }>;
194
193
  declare class EntityFungiblesPage extends EntityFungiblesPage_base {}
195
194
  //#endregion
196
195
  //#region src/state/nonFungibleData.d.ts
197
196
  declare const NonFungibleData_base: Effect.Service.Class<NonFungibleData, "NonFungibleData", {
198
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
199
197
  readonly effect: Effect.Effect<(this: unknown, input: Omit<_radixdlt_babylon_gateway_api_sdk6.StateNonFungibleDataRequest, "at_ledger_state"> & {
200
198
  at_ledger_state: AtLedgerState;
201
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>;
@@ -204,7 +202,6 @@ declare class NonFungibleData extends NonFungibleData_base {}
204
202
  //#endregion
205
203
  //#region src/state/entityNonFungiblesPage.d.ts
206
204
  declare const EntityNonFungiblesPage_base: Effect.Service.Class<EntityNonFungiblesPage, "EntityNonFungiblesPage", {
207
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
208
205
  readonly effect: Effect.Effect<(this: unknown, input: Omit<_radixdlt_babylon_gateway_api_sdk6.StateEntityNonFungiblesPageRequest, "at_ledger_state"> & {
209
206
  at_ledger_state: AtLedgerState;
210
207
  }) => 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>;
@@ -218,19 +215,18 @@ declare const ValidatorSchema: z.ZodObject<{
218
215
  lsuResourceAddress: z.ZodString;
219
216
  claimNftResourceAddress: z.ZodString;
220
217
  }, "strip", z.ZodTypeAny, {
221
- address: string;
222
218
  name: string;
219
+ address: string;
223
220
  lsuResourceAddress: string;
224
221
  claimNftResourceAddress: string;
225
222
  }, {
226
- address: string;
227
223
  name: string;
224
+ address: string;
228
225
  lsuResourceAddress: string;
229
226
  claimNftResourceAddress: string;
230
227
  }>;
231
228
  type Validator = z.infer<typeof ValidatorSchema>;
232
229
  declare const GetValidators_base: Effect.Service.Class<GetValidators, "GetValidators", {
233
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
234
230
  readonly effect: Effect.Effect<(this: unknown) => Effect.Effect<{
235
231
  address: string;
236
232
  name: string;
@@ -246,7 +242,6 @@ type GetEntityDetailsInput = GetEntityDetailsVaultAggregatedParameters[0];
246
242
  type GetEntityDetailsOptions = GetEntityDetailsVaultAggregatedParameters[1];
247
243
  type GetEntityDetailsState = GetEntityDetailsVaultAggregatedParameters[2];
248
244
  declare const GetEntityDetailsVaultAggregated_base: Effect.Service.Class<GetEntityDetailsVaultAggregated, "GetEntityDetailsVaultAggregated", {
249
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
250
245
  readonly effect: Effect.Effect<(this: unknown, input: string[], options: _radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsOptions | undefined, at_ledger_state: {
251
246
  state_version: number;
252
247
  } | {
@@ -264,7 +259,6 @@ type GetNonFungibleIdsInput = {
264
259
  cursor?: string;
265
260
  };
266
261
  declare const EntityNonFungibleIdsPage_base: Effect.Service.Class<EntityNonFungibleIdsPage, "EntityNonFungibleIdsPage", {
267
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
268
262
  readonly effect: Effect.Effect<(this: unknown, input: GetNonFungibleIdsInput) => Effect.Effect<{
269
263
  ids: string[];
270
264
  address: string;
@@ -274,7 +268,6 @@ declare class EntityNonFungibleIdsPage extends EntityNonFungibleIdsPage_base {}
274
268
  //#endregion
275
269
  //#region src/getNonFungibleLocation.d.ts
276
270
  declare const GetNonFungibleLocationService_base: Effect.Service.Class<GetNonFungibleLocationService, "GetNonFungibleLocationService", {
277
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
278
271
  readonly effect: Effect.Effect<(this: unknown, input: {
279
272
  resourceAddress: string;
280
273
  nonFungibleIds: string[];
@@ -296,7 +289,7 @@ type GetAddressByNonFungibleServiceInput = {
296
289
  at_ledger_state: AtLedgerState;
297
290
  };
298
291
  declare const GetAddressByNonFungibleService_base: Effect.Service.Class<GetAddressByNonFungibleService, "GetAddressByNonFungibleService", {
299
- readonly dependencies: readonly [effect_Layer0.Layer<GetNonFungibleLocationService, effect_ConfigError0.ConfigError, never>];
292
+ readonly dependencies: readonly [effect_Layer0.Layer<GetNonFungibleLocationService, effect_ConfigError0.ConfigError, GatewayApiClient>];
300
293
  readonly effect: Effect.Effect<(this: unknown, input: GetAddressByNonFungibleServiceInput) => Effect.Effect<{
301
294
  address: string;
302
295
  resourceAddress: string;
@@ -312,7 +305,7 @@ declare class InvalidComponentStateError {
312
305
  constructor(error: unknown);
313
306
  }
314
307
  declare const GetComponentStateService_base: Effect.Service.Class<GetComponentStateService, "GetComponentStateService", {
315
- readonly dependencies: readonly [effect_Layer0.Layer<GetEntityDetailsVaultAggregated, effect_ConfigError0.ConfigError, never>];
308
+ readonly dependencies: readonly [effect_Layer0.Layer<GetEntityDetailsVaultAggregated, effect_ConfigError0.ConfigError, GatewayApiClient>];
316
309
  readonly effect: Effect.Effect<{
317
310
  run: <T extends StructDefinition, R extends boolean>(this: unknown, input: {
318
311
  addresses: string[];
@@ -330,7 +323,6 @@ declare class GetComponentStateService extends GetComponentStateService_base {}
330
323
  //#endregion
331
324
  //#region src/state/stateEntityDetails.d.ts
332
325
  declare const StateEntityDetails_base: Effect.Service.Class<StateEntityDetails, "StateEntityDetails", {
333
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
334
326
  readonly effect: Effect.Effect<(this: unknown, input: _radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsRequest) => Effect.Effect<{
335
327
  ledger_state: _radixdlt_babylon_gateway_api_sdk6.LedgerState;
336
328
  items: _radixdlt_babylon_gateway_api_sdk6.StateEntityDetailsResponseItem[];
@@ -345,7 +337,7 @@ type GetFungibleBalanceInput = Omit<StateEntityDetailsOperationRequest['stateEnt
345
337
  options?: StateEntityDetailsOperationRequest['stateEntityDetailsRequest']['opt_ins'];
346
338
  };
347
339
  declare const GetFungibleBalance_base: Effect.Service.Class<GetFungibleBalance, "GetFungibleBalance", {
348
- readonly dependencies: readonly [effect_Layer0.Layer<EntityFungiblesPage, effect_ConfigError0.ConfigError, never>, effect_Layer0.Layer<StateEntityDetails, effect_ConfigError0.ConfigError, never>];
340
+ readonly dependencies: readonly [effect_Layer0.Layer<EntityFungiblesPage, effect_ConfigError0.ConfigError, GatewayApiClient>, effect_Layer0.Layer<StateEntityDetails, effect_ConfigError0.ConfigError, GatewayApiClient>];
349
341
  readonly effect: Effect.Effect<(this: unknown, input: GetFungibleBalanceInput) => Effect.Effect<{
350
342
  address: string;
351
343
  items: {
@@ -360,7 +352,7 @@ declare class GetFungibleBalance extends GetFungibleBalance_base {}
360
352
  //#endregion
361
353
  //#region src/keyValueStoreData.d.ts
362
354
  declare const KeyValueStoreDataService_base: Effect.Service.Class<KeyValueStoreDataService, "KeyValueStoreDataService", {
363
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
355
+ readonly dependencies: readonly [];
364
356
  readonly effect: Effect.Effect<(this: unknown, input: Omit<StateKeyValueStoreDataRequest, "at_ledger_state"> & {
365
357
  at_ledger_state: AtLedgerState;
366
358
  }) => 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>;
@@ -369,7 +361,6 @@ declare class KeyValueStoreDataService extends KeyValueStoreDataService_base {}
369
361
  //#endregion
370
362
  //#region src/keyValueStoreKeys.d.ts
371
363
  declare const KeyValueStoreKeysService_base: Effect.Service.Class<KeyValueStoreKeysService, "KeyValueStoreKeysService", {
372
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
373
364
  readonly effect: Effect.Effect<(this: unknown, input: Omit<StateKeyValueStoreKeysRequest, "at_ledger_state"> & {
374
365
  at_ledger_state: AtLedgerState;
375
366
  }) => 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>;
@@ -378,7 +369,7 @@ declare class KeyValueStoreKeysService extends KeyValueStoreKeysService_base {}
378
369
  //#endregion
379
370
  //#region src/getKeyValueStore.d.ts
380
371
  declare const GetKeyValueStoreService_base: Effect.Service.Class<GetKeyValueStoreService, "GetKeyValueStoreService", {
381
- readonly dependencies: readonly [effect_Layer0.Layer<KeyValueStoreKeysService, effect_ConfigError0.ConfigError, never>, effect_Layer0.Layer<KeyValueStoreDataService, effect_ConfigError0.ConfigError, never>];
372
+ readonly dependencies: readonly [effect_Layer0.Layer<KeyValueStoreKeysService, effect_ConfigError0.ConfigError, GatewayApiClient>, effect_Layer0.Layer<KeyValueStoreDataService, effect_ConfigError0.ConfigError, GatewayApiClient>];
382
373
  readonly effect: Effect.Effect<(this: unknown, input: {
383
374
  address: string;
384
375
  at_ledger_state: AtLedgerState;
@@ -395,7 +386,6 @@ type GetLedgerStateInput = {
395
386
  at_ledger_state: AtLedgerState;
396
387
  };
397
388
  declare const GetLedgerStateService_base: Effect.Service.Class<GetLedgerStateService, "GetLedgerStateService", {
398
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
399
389
  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>;
400
390
  }>;
401
391
  declare class GetLedgerStateService extends GetLedgerStateService_base {}
@@ -408,14 +398,14 @@ type GetNftResourceManagersInput = {
408
398
  options?: StateEntityDetailsOperationRequest['stateEntityDetailsRequest']['opt_ins'];
409
399
  };
410
400
  declare const GetNftResourceManagersService_base: Effect.Service.Class<GetNftResourceManagersService, "GetNftResourceManagersService", {
411
- 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>];
401
+ readonly dependencies: readonly [effect_Layer0.Layer<EntityNonFungiblesPage, effect_ConfigError0.ConfigError, GatewayApiClient>, effect_Layer0.Layer<EntityNonFungibleIdsPage, effect_ConfigError0.ConfigError, GatewayApiClient>];
412
402
  readonly effect: Effect.Effect<(this: unknown, input: GetNftResourceManagersInput) => Effect.Effect<{
413
403
  address: string;
414
404
  items: {
415
405
  resourceAddress: string;
416
406
  nftIds: string[];
417
407
  }[];
418
- }[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, GatewayApiClient | EntityNonFungiblesPage | EntityNonFungibleIdsPage>;
408
+ }[], AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError, never>, effect_ConfigError0.ConfigError, EntityNonFungiblesPage | GatewayApiClient | EntityNonFungibleIdsPage>;
419
409
  }>;
420
410
  declare class GetNftResourceManagersService extends GetNftResourceManagersService_base {}
421
411
  //#endregion
@@ -433,7 +423,7 @@ type GetNonFungibleBalanceInput = {
433
423
  };
434
424
  type GetNonFungibleBalanceOutput = Effect.Effect.Success<Awaited<ReturnType<(typeof GetNonFungibleBalanceService)['Service']>>>;
435
425
  declare const GetNonFungibleBalanceService_base: Effect.Service.Class<GetNonFungibleBalanceService, "GetNonFungibleBalanceService", {
436
- readonly dependencies: readonly [effect_Layer0.Layer<NonFungibleData, effect_ConfigError0.ConfigError, never>, effect_Layer0.Layer<GetNftResourceManagersService, effect_ConfigError0.ConfigError, never>];
426
+ readonly dependencies: readonly [effect_Layer0.Layer<NonFungibleData, effect_ConfigError0.ConfigError, GatewayApiClient>, effect_Layer0.Layer<GetNftResourceManagersService, effect_ConfigError0.ConfigError, GatewayApiClient>];
437
427
  readonly effect: Effect.Effect<(this: unknown, input: GetNonFungibleBalanceInput) => Effect.Effect<{
438
428
  items: {
439
429
  address: string;
@@ -453,7 +443,6 @@ declare class GetNonFungibleBalanceService extends GetNonFungibleBalanceService_
453
443
  //#endregion
454
444
  //#region src/getResourceHolders.d.ts
455
445
  declare const GetResourceHoldersService_base: Effect.Service.Class<GetResourceHoldersService, "GetResourceHoldersService", {
456
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
457
446
  readonly effect: Effect.Effect<(this: unknown, input: {
458
447
  resourceAddress: string;
459
448
  cursor?: string;
@@ -516,7 +505,6 @@ type PersonaProof = typeof PersonaProofSchema.Type;
516
505
  type AccountProof = typeof AccountProofSchema.Type;
517
506
  type RolaProof = typeof RolaProofSchema.Type;
518
507
  declare const Rola_base: Effect.Service.Class<Rola, "Rola", {
519
- readonly dependencies: readonly [effect_Layer0.Layer<GatewayApiClient, never, never>];
520
508
  readonly effect: Effect.Effect<{
521
509
  verifySignedChallenge: (input: RolaProof) => Effect.Effect<undefined, VerifyRolaProofError, never>;
522
510
  }, never, GatewayApiClient>;
@@ -693,4 +681,18 @@ interface ScryptoSborValueEnum {
693
681
  type ScryptoSborValueSchema = ScryptoSborValueBool | ScryptoSborValueString | ScryptoSborValueBytes | ScryptoSborValueDecimal | ScryptoSborValuePreciseDecimal | ScryptoSborValueReference | ScryptoSborValueOwn | ScryptoSborValueNonFungibleLocalId | ScryptoSborValueI8 | ScryptoSborValueI16 | ScryptoSborValueI32 | ScryptoSborValueI64 | ScryptoSborValueI128 | ScryptoSborValueU8 | ScryptoSborValueU16 | ScryptoSborValueU32 | ScryptoSborValueU64 | ScryptoSborValueU128 | ScryptoSborValueArray | ScryptoSborValueMap | ScryptoSborValueTuple | ScryptoSborValueEnum;
694
682
  declare const ScryptoSborValueSchema: Schema.Schema<ScryptoSborValueSchema>;
695
683
  //#endregion
696
- 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, ScryptoSborValueKind, type ScryptoSborValueMapEntry, ScryptoSborValueSchema, StateVersion, StateVersionSchema, TimestampSchema, TransactionNotFoundError, UnknownGatewayError, Validator, ValidatorSchema, VerifyRolaProofError, validateAtLedgerStateInput };
684
+ //#region src/previewTransaction.d.ts
685
+ declare const TransactionPreviewError_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 & {
686
+ readonly _tag: "TransactionPreviewError";
687
+ } & Readonly<A>;
688
+ declare class TransactionPreviewError extends TransactionPreviewError_base<{
689
+ message?: string;
690
+ }> {}
691
+ declare const PreviewTransaction_base: Effect.Service.Class<PreviewTransaction, "PreviewTransaction", {
692
+ readonly effect: Effect.Effect<(this: unknown, input: {
693
+ payload: TransactionPreviewOperationRequest["transactionPreviewRequest"];
694
+ }) => Effect.Effect<_radixdlt_babylon_gateway_api_sdk6.TransactionPreviewResponse, AccountLockerNotFoundError | InvalidRequestError | EntityNotFoundError | InternalServerError | InvalidEntityError | InvalidTransactionError | NotSyncedUpError | TransactionNotFoundError | ErrorResponse | RateLimitExceededError | ResponseError | UnknownGatewayError | TransactionPreviewError, never>, never, GatewayApiClient>;
695
+ }>;
696
+ declare class PreviewTransaction extends PreviewTransaction_base {}
697
+ //#endregion
698
+ 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, PreviewTransaction, ProofSchema, RateLimitExceededError, ResponseError, Rola, RolaProof, RolaProofSchema, ScryptoSborValueKind, type ScryptoSborValueMapEntry, ScryptoSborValueSchema, StateVersion, StateVersionSchema, TimestampSchema, TransactionNotFoundError, TransactionPreviewError, UnknownGatewayError, Validator, ValidatorSchema, VerifyRolaProofError, validateAtLedgerStateInput };
package/dist/index.js CHANGED
@@ -91,7 +91,7 @@ var GatewayApiClient = class extends Effect.Service()("GatewayApiClient", { effe
91
91
  }
92
92
  }).pipe(Effect.tapError((error) => Effect.gen(function* () {
93
93
  if (error._tag === "RateLimitExceededError") {
94
- yield* Effect.log(`Rate limit exceeded, retrying in ${error.retryAfter} seconds`);
94
+ yield* Effect.logWarning(`Rate limit exceeded, retrying in ${error.retryAfter} seconds`);
95
95
  yield* Effect.sleep(Duration.seconds(error.retryAfter));
96
96
  }
97
97
  })), Effect.retry({ while: (error) => error._tag === "RateLimitExceededError" }));
@@ -134,33 +134,30 @@ var GatewayApiClient = class extends Effect.Service()("GatewayApiClient", { effe
134
134
 
135
135
  //#endregion
136
136
  //#region src/state/entityFungiblesPage.ts
137
- var EntityFungiblesPage = class extends Effect.Service()("EntityFungiblesPage", {
138
- dependencies: [GatewayApiClient.Default],
139
- effect: Effect.gen(function* () {
140
- const gatewayClient = yield* GatewayApiClient;
141
- const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
142
- const entityFungiblesPage = Effect.fnUntraced(function* (input) {
143
- return yield* gatewayClient.state.innerClient.entityFungiblesPage({ stateEntityFungiblesPageRequest: {
137
+ var EntityFungiblesPage = class extends Effect.Service()("EntityFungiblesPage", { effect: Effect.gen(function* () {
138
+ const gatewayClient = yield* GatewayApiClient;
139
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
140
+ const entityFungiblesPage = Effect.fnUntraced(function* (input) {
141
+ return yield* gatewayClient.state.innerClient.entityFungiblesPage({ stateEntityFungiblesPageRequest: {
142
+ ...input,
143
+ limit_per_page: pageSize
144
+ } });
145
+ });
146
+ return Effect.fnUntraced(function* (input) {
147
+ const result = yield* entityFungiblesPage(input);
148
+ let nextCursor = result?.next_cursor;
149
+ const items = result?.items ?? [];
150
+ while (nextCursor) {
151
+ const result$1 = yield* entityFungiblesPage({
144
152
  ...input,
145
- limit_per_page: pageSize
146
- } });
147
- });
148
- return Effect.fnUntraced(function* (input) {
149
- const result = yield* entityFungiblesPage(input);
150
- let nextCursor = result?.next_cursor;
151
- const items = result?.items ?? [];
152
- while (nextCursor) {
153
- const result$1 = yield* entityFungiblesPage({
154
- ...input,
155
- cursor: nextCursor
156
- });
157
- nextCursor = result$1.next_cursor;
158
- items.push(...result$1.items);
159
- }
160
- return items;
161
- });
162
- })
163
- }) {};
153
+ cursor: nextCursor
154
+ });
155
+ nextCursor = result$1.next_cursor;
156
+ items.push(...result$1.items);
157
+ }
158
+ return items;
159
+ });
160
+ }) }) {};
164
161
 
165
162
  //#endregion
166
163
  //#region src/helpers/chunker.ts
@@ -175,40 +172,34 @@ const chunker = (array, size) => {
175
172
 
176
173
  //#endregion
177
174
  //#region src/state/nonFungibleData.ts
178
- var NonFungibleData = class extends Effect.Service()("NonFungibleData", {
179
- dependencies: [GatewayApiClient.Default],
180
- effect: Effect.gen(function* () {
181
- const gatewayClient = yield* GatewayApiClient;
182
- const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
183
- return Effect.fnUntraced(function* (input) {
184
- const chunks = chunker(input.non_fungible_ids, pageSize);
185
- return yield* Effect.forEach(chunks, Effect.fnUntraced(function* (chunk) {
186
- return yield* gatewayClient.state.innerClient.nonFungibleData({ stateNonFungibleDataRequest: {
187
- ...input,
188
- non_fungible_ids: chunk
189
- } });
190
- })).pipe(Effect.map((res) => {
191
- return res.flatMap((item) => item.non_fungible_ids);
192
- }));
193
- });
194
- })
195
- }) {};
175
+ var NonFungibleData = class extends Effect.Service()("NonFungibleData", { effect: Effect.gen(function* () {
176
+ const gatewayClient = yield* GatewayApiClient;
177
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
178
+ return Effect.fnUntraced(function* (input) {
179
+ const chunks = chunker(input.non_fungible_ids, pageSize);
180
+ return yield* Effect.forEach(chunks, Effect.fnUntraced(function* (chunk) {
181
+ return yield* gatewayClient.state.innerClient.nonFungibleData({ stateNonFungibleDataRequest: {
182
+ ...input,
183
+ non_fungible_ids: chunk
184
+ } });
185
+ })).pipe(Effect.map((res) => {
186
+ return res.flatMap((item) => item.non_fungible_ids);
187
+ }));
188
+ });
189
+ }) }) {};
196
190
 
197
191
  //#endregion
198
192
  //#region src/state/entityNonFungiblesPage.ts
199
- var EntityNonFungiblesPage = class extends Effect.Service()("EntityNonFungiblesPage", {
200
- dependencies: [GatewayApiClient.Default],
201
- effect: Effect.gen(function* () {
202
- const gatewayClient = yield* GatewayApiClient;
203
- const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
204
- return Effect.fnUntraced(function* (input) {
205
- return yield* gatewayClient.state.innerClient.entityNonFungiblesPage({ stateEntityNonFungiblesPageRequest: {
206
- ...input,
207
- limit_per_page: pageSize
208
- } });
209
- });
210
- })
211
- }) {};
193
+ var EntityNonFungiblesPage = class extends Effect.Service()("EntityNonFungiblesPage", { effect: Effect.gen(function* () {
194
+ const gatewayClient = yield* GatewayApiClient;
195
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
196
+ return Effect.fnUntraced(function* (input) {
197
+ return yield* gatewayClient.state.innerClient.entityNonFungiblesPage({ stateEntityNonFungiblesPageRequest: {
198
+ ...input,
199
+ limit_per_page: pageSize
200
+ } });
201
+ });
202
+ }) }) {};
212
203
 
213
204
  //#endregion
214
205
  //#region src/state/getValidators.ts
@@ -218,102 +209,90 @@ const ValidatorSchema = z.object({
218
209
  lsuResourceAddress: z.string(),
219
210
  claimNftResourceAddress: z.string()
220
211
  });
221
- var GetValidators = class extends Effect.Service()("GetValidators", {
222
- dependencies: [GatewayApiClient.Default],
223
- effect: Effect.gen(function* () {
224
- const gatewayClient = yield* GatewayApiClient;
225
- return Effect.fn(function* () {
226
- return (yield* gatewayClient.state.getValidators()).items.map((item) => {
227
- const address = item.address;
228
- const { name, lsuResourceAddress, claimNftResourceAddress } = item.metadata.items.reduce((acc, curr) => {
229
- if (curr.key === "name" && curr.value.typed.type === "String") acc.name = curr.value.typed.value;
230
- if (curr.key === "pool_unit" && curr.value.typed.type === "GlobalAddress") acc.lsuResourceAddress = curr.value.typed.value;
231
- if (curr.key === "claim_nft" && curr.value.typed.type === "GlobalAddress") acc.claimNftResourceAddress = curr.value.typed.value;
232
- return acc;
233
- }, {
234
- name: "",
235
- lsuResourceAddress: "",
236
- claimNftResourceAddress: ""
237
- });
238
- return {
239
- address,
240
- name,
241
- lsuResourceAddress,
242
- claimNftResourceAddress
243
- };
212
+ var GetValidators = class extends Effect.Service()("GetValidators", { effect: Effect.gen(function* () {
213
+ const gatewayClient = yield* GatewayApiClient;
214
+ return Effect.fn(function* () {
215
+ return (yield* gatewayClient.state.getValidators()).items.map((item) => {
216
+ const address = item.address;
217
+ const { name, lsuResourceAddress, claimNftResourceAddress } = item.metadata.items.reduce((acc, curr) => {
218
+ if (curr.key === "name" && curr.value.typed.type === "String") acc.name = curr.value.typed.value;
219
+ if (curr.key === "pool_unit" && curr.value.typed.type === "GlobalAddress") acc.lsuResourceAddress = curr.value.typed.value;
220
+ if (curr.key === "claim_nft" && curr.value.typed.type === "GlobalAddress") acc.claimNftResourceAddress = curr.value.typed.value;
221
+ return acc;
222
+ }, {
223
+ name: "",
224
+ lsuResourceAddress: "",
225
+ claimNftResourceAddress: ""
244
226
  });
227
+ return {
228
+ address,
229
+ name,
230
+ lsuResourceAddress,
231
+ claimNftResourceAddress
232
+ };
245
233
  });
246
- })
247
- }) {};
234
+ });
235
+ }) }) {};
248
236
 
249
237
  //#endregion
250
238
  //#region src/state/getEntityDetailsVaultAggregated.ts
251
- var GetEntityDetailsVaultAggregated = class extends Effect.Service()("GetEntityDetailsVaultAggregated", {
252
- dependencies: [GatewayApiClient.Default],
253
- effect: Effect.gen(function* () {
254
- const gatewayClient = yield* GatewayApiClient;
255
- const pageSize = yield* Config.number("GatewayApi__Endpoint__StateEntityDetailsPageSize").pipe(Config.withDefault(20));
256
- return Effect.fnUntraced(function* (input, options, at_ledger_state) {
257
- const chunks = chunker(input, pageSize);
258
- return yield* Effect.forEach(chunks, Effect.fn(function* (addresses) {
259
- return yield* gatewayClient.state.getEntityDetailsVaultAggregated(addresses, options, at_ledger_state);
260
- })).pipe(Effect.map((res) => res.flat()));
261
- });
262
- })
263
- }) {};
239
+ var GetEntityDetailsVaultAggregated = class extends Effect.Service()("GetEntityDetailsVaultAggregated", { effect: Effect.gen(function* () {
240
+ const gatewayClient = yield* GatewayApiClient;
241
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__StateEntityDetailsPageSize").pipe(Config.withDefault(20));
242
+ return Effect.fnUntraced(function* (input, options, at_ledger_state) {
243
+ const chunks = chunker(input, pageSize);
244
+ return yield* Effect.forEach(chunks, Effect.fn(function* (addresses) {
245
+ return yield* gatewayClient.state.getEntityDetailsVaultAggregated(addresses, options, at_ledger_state);
246
+ })).pipe(Effect.map((res) => res.flat()));
247
+ });
248
+ }) }) {};
264
249
 
265
250
  //#endregion
266
251
  //#region src/state/entityNonFungibleIdsPage.ts
267
- var EntityNonFungibleIdsPage = class extends Effect.Service()("EntityNonFungibleIdsPage", {
268
- dependencies: [GatewayApiClient.Default],
269
- effect: Effect.gen(function* () {
270
- const gatewayClient = yield* GatewayApiClient;
271
- const pageSize = yield* Config.number("GatewayApi__Endpoint__StateEntityDetailsPageSize").pipe(Config.withDefault(100));
272
- return Effect.fn(function* (input) {
273
- const makeRequest = (cursor) => gatewayClient.state.innerClient.entityNonFungibleIdsPage({ stateEntityNonFungibleIdsPageRequest: {
274
- resource_address: input.resourceAddress,
275
- vault_address: input.vaultAddress,
276
- address: input.address,
277
- at_ledger_state: input.at_ledger_state,
278
- cursor,
279
- limit_per_page: pageSize
280
- } });
281
- const result = yield* makeRequest(input.cursor);
282
- let next_cursor = result.next_cursor;
283
- const totalCount = result.total_count ?? 0;
284
- const ids = [...result.items];
285
- while (next_cursor && totalCount > 0) {
286
- const result$1 = yield* makeRequest(next_cursor);
287
- ids.push(...result$1.items);
288
- next_cursor = result$1.next_cursor;
289
- }
290
- return {
291
- ids,
292
- address: input.address
293
- };
294
- });
295
- })
296
- }) {};
252
+ var EntityNonFungibleIdsPage = class extends Effect.Service()("EntityNonFungibleIdsPage", { effect: Effect.gen(function* () {
253
+ const gatewayClient = yield* GatewayApiClient;
254
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__StateEntityDetailsPageSize").pipe(Config.withDefault(100));
255
+ return Effect.fn(function* (input) {
256
+ const makeRequest = (cursor) => gatewayClient.state.innerClient.entityNonFungibleIdsPage({ stateEntityNonFungibleIdsPageRequest: {
257
+ resource_address: input.resourceAddress,
258
+ vault_address: input.vaultAddress,
259
+ address: input.address,
260
+ at_ledger_state: input.at_ledger_state,
261
+ cursor,
262
+ limit_per_page: pageSize
263
+ } });
264
+ const result = yield* makeRequest(input.cursor);
265
+ let next_cursor = result.next_cursor;
266
+ const totalCount = result.total_count ?? 0;
267
+ const ids = [...result.items];
268
+ while (next_cursor && totalCount > 0) {
269
+ const result$1 = yield* makeRequest(next_cursor);
270
+ ids.push(...result$1.items);
271
+ next_cursor = result$1.next_cursor;
272
+ }
273
+ return {
274
+ ids,
275
+ address: input.address
276
+ };
277
+ });
278
+ }) }) {};
297
279
 
298
280
  //#endregion
299
281
  //#region src/getNonFungibleLocation.ts
300
- var GetNonFungibleLocationService = class extends Effect.Service()("GetNonFungibleLocationService", {
301
- dependencies: [GatewayApiClient.Default],
302
- effect: Effect.gen(function* () {
303
- const gatewayClient = yield* GatewayApiClient;
304
- const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
305
- return Effect.fn(function* (input) {
306
- const chunks = chunker(input.nonFungibleIds, pageSize);
307
- return yield* Effect.forEach(chunks, Effect.fn(function* (nonFungibleIds) {
308
- return yield* gatewayClient.state.innerClient.nonFungibleLocation({ stateNonFungibleLocationRequest: {
309
- non_fungible_ids: nonFungibleIds,
310
- resource_address: input.resourceAddress,
311
- at_ledger_state: input.at_ledger_state
312
- } });
313
- })).pipe(Effect.map((res) => res.flat()));
314
- });
315
- })
316
- }) {};
282
+ var GetNonFungibleLocationService = class extends Effect.Service()("GetNonFungibleLocationService", { effect: Effect.gen(function* () {
283
+ const gatewayClient = yield* GatewayApiClient;
284
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
285
+ return Effect.fn(function* (input) {
286
+ const chunks = chunker(input.nonFungibleIds, pageSize);
287
+ return yield* Effect.forEach(chunks, Effect.fn(function* (nonFungibleIds) {
288
+ return yield* gatewayClient.state.innerClient.nonFungibleLocation({ stateNonFungibleLocationRequest: {
289
+ non_fungible_ids: nonFungibleIds,
290
+ resource_address: input.resourceAddress,
291
+ at_ledger_state: input.at_ledger_state
292
+ } });
293
+ })).pipe(Effect.map((res) => res.flat()));
294
+ });
295
+ }) }) {};
317
296
 
318
297
  //#endregion
319
298
  //#region src/getAddressByNonFungible.ts
@@ -380,28 +359,25 @@ var GetComponentStateService = class extends Effect.Service()("GetComponentState
380
359
 
381
360
  //#endregion
382
361
  //#region src/state/stateEntityDetails.ts
383
- var StateEntityDetails = class extends Effect.Service()("StateEntityDetails", {
384
- dependencies: [GatewayApiClient.Default],
385
- effect: Effect.gen(function* () {
386
- const gatewayClient = yield* GatewayApiClient;
387
- const pageSize = yield* Config.number("GatewayApi__Endpoint__StateEntityDetailsPageSize").pipe(Config.withDefault(20));
388
- const concurrency = yield* Config.number("GATEWAY_STATE_ENTITY_DETAILS_CONCURRENCY").pipe(Config.withDefault(5));
389
- return Effect.fnUntraced(function* (input) {
390
- const chunks = chunker(input.addresses, pageSize);
391
- return yield* Effect.forEach(chunks, Effect.fnUntraced(function* (addresses) {
392
- return yield* gatewayClient.state.innerClient.stateEntityDetails({ stateEntityDetailsRequest: {
393
- ...input,
394
- addresses
395
- } });
396
- }), { concurrency }).pipe(Effect.map((res) => {
397
- return {
398
- ledger_state: res[0].ledger_state,
399
- items: res.flatMap((item) => item.items)
400
- };
401
- }));
402
- });
403
- })
404
- }) {};
362
+ var StateEntityDetails = class extends Effect.Service()("StateEntityDetails", { effect: Effect.gen(function* () {
363
+ const gatewayClient = yield* GatewayApiClient;
364
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__StateEntityDetailsPageSize").pipe(Config.withDefault(20));
365
+ const concurrency = yield* Config.number("GATEWAY_STATE_ENTITY_DETAILS_CONCURRENCY").pipe(Config.withDefault(5));
366
+ return Effect.fnUntraced(function* (input) {
367
+ const chunks = chunker(input.addresses, pageSize);
368
+ return yield* Effect.forEach(chunks, Effect.fnUntraced(function* (addresses) {
369
+ return yield* gatewayClient.state.innerClient.stateEntityDetails({ stateEntityDetailsRequest: {
370
+ ...input,
371
+ addresses
372
+ } });
373
+ }), { concurrency }).pipe(Effect.map((res) => {
374
+ return {
375
+ ledger_state: res[0].ledger_state,
376
+ items: res.flatMap((item) => item.items)
377
+ };
378
+ }));
379
+ });
380
+ }) }) {};
405
381
 
406
382
  //#endregion
407
383
  //#region src/getFungibleBalance.ts
@@ -454,7 +430,7 @@ var GetFungibleBalance = class extends Effect.Service()("GetFungibleBalance", {
454
430
  //#endregion
455
431
  //#region src/keyValueStoreData.ts
456
432
  var KeyValueStoreDataService = class extends Effect.Service()("KeyValueStoreDataService", {
457
- dependencies: [GatewayApiClient.Default],
433
+ dependencies: [],
458
434
  effect: Effect.gen(function* () {
459
435
  const gatewayClient = yield* GatewayApiClient;
460
436
  const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
@@ -473,19 +449,16 @@ var KeyValueStoreDataService = class extends Effect.Service()("KeyValueStoreData
473
449
 
474
450
  //#endregion
475
451
  //#region src/keyValueStoreKeys.ts
476
- var KeyValueStoreKeysService = class extends Effect.Service()("KeyValueStoreKeysService", {
477
- dependencies: [GatewayApiClient.Default],
478
- effect: Effect.gen(function* () {
479
- const gatewayClient = yield* GatewayApiClient;
480
- const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
481
- return Effect.fn(function* (input) {
482
- return yield* gatewayClient.state.innerClient.keyValueStoreKeys({ stateKeyValueStoreKeysRequest: {
483
- ...input,
484
- limit_per_page: pageSize
485
- } });
486
- });
487
- })
488
- }) {};
452
+ var KeyValueStoreKeysService = class extends Effect.Service()("KeyValueStoreKeysService", { effect: Effect.gen(function* () {
453
+ const gatewayClient = yield* GatewayApiClient;
454
+ const pageSize = yield* Config.number("GatewayApi__Endpoint__MaxPageSize").pipe(Config.withDefault(100));
455
+ return Effect.fn(function* (input) {
456
+ return yield* gatewayClient.state.innerClient.keyValueStoreKeys({ stateKeyValueStoreKeysRequest: {
457
+ ...input,
458
+ limit_per_page: pageSize
459
+ } });
460
+ });
461
+ }) }) {};
489
462
 
490
463
  //#endregion
491
464
  //#region src/getKeyValueStore.ts
@@ -528,27 +501,20 @@ var GetKeyValueStoreService = class extends Effect.Service()("GetKeyValueStoreSe
528
501
 
529
502
  //#endregion
530
503
  //#region src/getLedgerState.ts
531
- var GetLedgerStateService = class extends Effect.Service()("GetLedgerStateService", {
532
- dependencies: [GatewayApiClient.Default],
533
- effect: Effect.gen(function* () {
534
- const gatewayClient = yield* GatewayApiClient;
535
- return Effect.fn("getLedgerStateService")(function* (input) {
536
- return (yield* gatewayClient.stream.innerClient.streamTransactions({ streamTransactionsRequest: {
537
- limit_per_page: 1,
538
- at_ledger_state: input.at_ledger_state
539
- } })).ledger_state;
540
- });
541
- })
542
- }) {};
504
+ var GetLedgerStateService = class extends Effect.Service()("GetLedgerStateService", { effect: Effect.gen(function* () {
505
+ const gatewayClient = yield* GatewayApiClient;
506
+ return Effect.fn("getLedgerStateService")(function* (input) {
507
+ return (yield* gatewayClient.stream.innerClient.streamTransactions({ streamTransactionsRequest: {
508
+ limit_per_page: 1,
509
+ at_ledger_state: input.at_ledger_state
510
+ } })).ledger_state;
511
+ });
512
+ }) }) {};
543
513
 
544
514
  //#endregion
545
515
  //#region src/getNftResourceManagers.ts
546
516
  var GetNftResourceManagersService = class extends Effect.Service()("GetNftResourceManagersService", {
547
- dependencies: [
548
- GatewayApiClient.Default,
549
- EntityNonFungiblesPage.Default,
550
- EntityNonFungibleIdsPage.Default
551
- ],
517
+ dependencies: [EntityNonFungiblesPage.Default, EntityNonFungibleIdsPage.Default],
552
518
  effect: Effect.gen(function* () {
553
519
  const gatewayClient = yield* GatewayApiClient;
554
520
  const entityNonFungiblesPageService = yield* EntityNonFungiblesPage;
@@ -732,31 +698,28 @@ var GetNonFungibleBalanceService = class extends Effect.Service()("GetNonFungibl
732
698
 
733
699
  //#endregion
734
700
  //#region src/getResourceHolders.ts
735
- var GetResourceHoldersService = class extends Effect.Service()("GetResourceHoldersService", {
736
- dependencies: [GatewayApiClient.Default],
737
- effect: Effect.gen(function* () {
738
- const gatewayClient = yield* GatewayApiClient;
739
- const getResourceHolders = Effect.fn(function* (input) {
740
- return yield* gatewayClient.extensions.getResourceHolders(input.resourceAddress, input.cursor);
741
- });
742
- return Effect.fn(function* (input) {
743
- const result = yield* getResourceHolders(input);
744
- const allItems = [...result.items];
745
- let nextCursor = result.next_cursor;
746
- while (nextCursor) {
747
- const nextResult = yield* getResourceHolders({
748
- resourceAddress: input.resourceAddress,
749
- cursor: nextCursor
750
- });
751
- allItems.push(...nextResult.items);
752
- nextCursor = nextResult.next_cursor;
753
- }
754
- const holders = /* @__PURE__ */ new Map();
755
- for (const item of allItems) holders.set(item.holder_address, item);
756
- return Array.from(holders.values());
757
- });
758
- })
759
- }) {};
701
+ var GetResourceHoldersService = class extends Effect.Service()("GetResourceHoldersService", { effect: Effect.gen(function* () {
702
+ const gatewayClient = yield* GatewayApiClient;
703
+ const getResourceHolders = Effect.fn(function* (input) {
704
+ return yield* gatewayClient.extensions.getResourceHolders(input.resourceAddress, input.cursor);
705
+ });
706
+ return Effect.fn(function* (input) {
707
+ const result = yield* getResourceHolders(input);
708
+ const allItems = [...result.items];
709
+ let nextCursor = result.next_cursor;
710
+ while (nextCursor) {
711
+ const nextResult = yield* getResourceHolders({
712
+ resourceAddress: input.resourceAddress,
713
+ cursor: nextCursor
714
+ });
715
+ allItems.push(...nextResult.items);
716
+ nextCursor = nextResult.next_cursor;
717
+ }
718
+ const holders = /* @__PURE__ */ new Map();
719
+ for (const item of allItems) holders.set(item.holder_address, item);
720
+ return Array.from(holders.values());
721
+ });
722
+ }) }) {};
760
723
 
761
724
  //#endregion
762
725
  //#region src/schemas.ts
@@ -796,22 +759,23 @@ const AccountProofSchema = Schema.Struct({
796
759
  proof: ProofSchema
797
760
  });
798
761
  const RolaProofSchema = Schema.Union(PersonaProofSchema, AccountProofSchema);
799
- var Rola = class extends Effect.Service()("Rola", {
800
- dependencies: [GatewayApiClient.Default],
801
- effect: Effect.gen(function* () {
802
- const { verifySignedChallenge } = Rola$1({
803
- networkId: yield* Config.number("NETWORK_ID").pipe(Config.withDefault(1)).pipe(Effect.orDie),
804
- applicationName: yield* Config.string("APPLICATION_NAME").pipe(Config.withDefault("@radix-effects/gateway")).pipe(Effect.orDie),
805
- dAppDefinitionAddress: yield* Config.string("DAPP_DEFINITION_ADDRESS").pipe(Effect.orDie),
806
- expectedOrigin: yield* Config.string("ROLA_EXPECTED_ORIGIN").pipe(Effect.orDie),
807
- gatewayApiClient: (yield* GatewayApiClient).rawClient
808
- });
809
- return { verifySignedChallenge: (input) => Effect.gen(function* () {
810
- const result = yield* Effect.tryPromise(() => verifySignedChallenge(input)).pipe(Effect.catchTag("UnknownException", Effect.orDie));
811
- if (result.isErr()) return yield* new VerifyRolaProofError({ error: result.error });
812
- }) };
813
- })
814
- }) {};
762
+ var Rola = class extends Effect.Service()("Rola", { effect: Effect.gen(function* () {
763
+ const applicationName = yield* Config.string("APPLICATION_NAME").pipe(Config.withDefault("@radix-effects/gateway")).pipe(Effect.orDie);
764
+ const dAppDefinitionAddress = yield* Config.string("DAPP_DEFINITION_ADDRESS").pipe(Effect.orDie);
765
+ const expectedOrigin = yield* Config.string("ROLA_EXPECTED_ORIGIN").pipe(Effect.orDie);
766
+ const gatewayApiClient = yield* GatewayApiClient;
767
+ const { verifySignedChallenge } = Rola$1({
768
+ networkId: gatewayApiClient.networkId,
769
+ applicationName,
770
+ dAppDefinitionAddress,
771
+ expectedOrigin,
772
+ gatewayApiClient: gatewayApiClient.rawClient
773
+ });
774
+ return { verifySignedChallenge: (input) => Effect.gen(function* () {
775
+ const result = yield* Effect.tryPromise(() => verifySignedChallenge(input)).pipe(Effect.catchTag("UnknownException", Effect.orDie));
776
+ if (result.isErr()) return yield* new VerifyRolaProofError({ error: result.error });
777
+ }) };
778
+ }) }) {};
815
779
 
816
780
  //#endregion
817
781
  //#region src/sbor.ts
@@ -947,4 +911,17 @@ const ScryptoSborValueEnumSchema = Schema.suspend(() => Schema.Struct({
947
911
  const ScryptoSborValueSchema = Schema.Union(ScryptoSborValueBool, ScryptoSborValueString, ScryptoSborValueBytes, ScryptoSborValueDecimal, ScryptoSborValuePreciseDecimal, ScryptoSborValueReference, ScryptoSborValueOwn, ScryptoSborValueNonFungibleLocalId, ScryptoSborValueI8, ScryptoSborValueI16, ScryptoSborValueI32, ScryptoSborValueI64, ScryptoSborValueI128, ScryptoSborValueU8, ScryptoSborValueU16, ScryptoSborValueU32, ScryptoSborValueU64, ScryptoSborValueU128, ScryptoSborValueArraySchema, ScryptoSborValueMapSchema, ScryptoSborValueTupleSchema, ScryptoSborValueEnumSchema);
948
912
 
949
913
  //#endregion
950
- 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, ScryptoSborValueKind, ScryptoSborValueSchema, StateVersionSchema, TimestampSchema, TransactionNotFoundError, UnknownGatewayError, ValidatorSchema, VerifyRolaProofError, validateAtLedgerStateInput };
914
+ //#region src/previewTransaction.ts
915
+ var TransactionPreviewError = class extends Data.TaggedError("TransactionPreviewError") {};
916
+ var PreviewTransaction = class extends Effect.Service()("PreviewTransaction", { effect: Effect.gen(function* () {
917
+ const gatewayApiClient = yield* GatewayApiClient;
918
+ return Effect.fnUntraced(function* (input) {
919
+ const result = yield* gatewayApiClient.transaction.innerClient.transactionPreview({ transactionPreviewRequest: input.payload });
920
+ const receipt = result.receipt;
921
+ if (receipt.status !== "Succeeded") return yield* new TransactionPreviewError({ message: receipt.error_message });
922
+ return result;
923
+ });
924
+ }) }) {};
925
+
926
+ //#endregion
927
+ 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, PreviewTransaction, ProofSchema, RateLimitExceededError, ResponseError, Rola, RolaProofSchema, ScryptoSborValueKind, ScryptoSborValueSchema, StateVersionSchema, TimestampSchema, TransactionNotFoundError, TransactionPreviewError, UnknownGatewayError, ValidatorSchema, VerifyRolaProofError, validateAtLedgerStateInput };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radix-effects/gateway",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,6 +28,7 @@
28
28
  "bignumber.js": "^9.2.1",
29
29
  "effect": "^3.14.1",
30
30
  "zod": "^3.24.1",
31
+ "@radixdlt/babylon-core-api-sdk": "^1.2.3",
31
32
  "sbor-ez-mode": "0.2.0"
32
33
  },
33
34
  "files": [