@@ -29,11 +29,9 @@ import {
2929} from "@radixdlt/radix-engine-toolkit" ;
3030import { divideInBatches , parseNonFungibleData , withMaxLoops } from "./Utils" ;
3131import {
32- ComponentAddress ,
3332 FungibleResource ,
3433 NonFungibleItem ,
3534 NonFungibleResource ,
36- ResourceAddress ,
3735 ResourceInformation ,
3836} from "../Types/RadixTypes" ;
3937import pLimit from "p-limit" ;
@@ -273,10 +271,10 @@ export class GatewayProcessor {
273271 * @returns A promise resolving to a map containing resource addresses as keys and Resource objects as values.
274272 */
275273 async getResourcesInformation (
276- resource_addresses : ResourceAddress [ ] ,
274+ resource_addresses : string [ ] ,
277275 additional_metadata ?: string [ ] ,
278- ) : Promise < Map < ResourceAddress , ResourceInformation > > {
279- let resource_map = new Map < ResourceAddress , ResourceInformation > ( ) ;
276+ ) : Promise < Map < string , ResourceInformation > > {
277+ let resource_map = new Map < string , ResourceInformation > ( ) ;
280278 const batches = divideInBatches ( resource_addresses , 20 ) ;
281279 const limit = pLimit ( this . _concurrencyLimit ) ;
282280 await Promise . all (
@@ -297,14 +295,14 @@ export class GatewayProcessor {
297295 * @param entity Address of the component.
298296 */
299297 async getFungibleResourcesHeldBy (
300- entity : ComponentAddress ,
298+ entity : string ,
301299 ) : Promise < FungibleResource [ ] > {
302300 const resp = await this . entityDetails ( [ entity ] ) ;
303301 const entityState = resp . items [ 0 ] ;
304302 let held_resources : FungibleResource [ ] = [ ] ;
305303
306- let amount_map = new Map < ResourceAddress , number > ( ) ;
307- let resources : ResourceAddress [ ] = [ ] ;
304+ let amount_map = new Map < string , number > ( ) ;
305+ let resources : string [ ] = [ ] ;
308306
309307 if ( entityState . fungible_resources ) {
310308 entityState . fungible_resources . items . forEach ( ( resource ) => {
@@ -343,7 +341,7 @@ export class GatewayProcessor {
343341 * @param entity Address of the entity.
344342 */
345343 async getNonFungibleResourcesHeldBy (
346- entity : ComponentAddress ,
344+ entity : string ,
347345 ) : Promise < NonFungibleResource [ ] > {
348346 const ledger_state = await this . ledgerState ( ) ;
349347
@@ -421,8 +419,8 @@ export class GatewayProcessor {
421419 * @param non_fungible_resource Address of the non-fungible resource.
422420 */
423421 async getNonFungibleIdsHeldBy (
424- entity : ComponentAddress ,
425- non_fungible_resource : ResourceAddress ,
422+ entity : string ,
423+ non_fungible_resource : string ,
426424 ) : Promise < string [ ] > {
427425 const ledger_state = await this . ledgerState ( ) ;
428426
@@ -478,7 +476,7 @@ export class GatewayProcessor {
478476 * @param at_ledger_state Optional ledger state when to make the query.
479477 */
480478 async getAllNonFungibleIds (
481- resource_address : ResourceAddress ,
479+ resource_address : string ,
482480 at_ledger_state ?: number ,
483481 ) : Promise < string [ ] > {
484482 const state_version = at_ledger_state
@@ -507,7 +505,7 @@ export class GatewayProcessor {
507505 * @param at_ledger_state State against which to make the query.
508506 */
509507 async getNonFungibleItemsFromIds (
510- resource_address : ResourceAddress ,
508+ resource_address : string ,
511509 ids : string [ ] ,
512510 at_ledger_state ?: number ,
513511 ) : Promise < NonFungibleItem [ ] > {
@@ -585,7 +583,7 @@ export class GatewayProcessor {
585583 * @param resource_address Address of the non-fungible items.
586584 * @param ids Ids of the non-fungible items.
587585 */
588- async getNftOwners ( resource_address : ResourceAddress , ids : string [ ] ) {
586+ async getNftOwners ( resource_address : string , ids : string [ ] ) {
589587 const nft_batches = divideInBatches ( ids , 100 ) ;
590588 const limit = pLimit ( this . _concurrencyLimit ) ;
591589 let return_map = new Map < string , string > ( ) ;
@@ -611,10 +609,10 @@ export class GatewayProcessor {
611609 * Takes up to 20 resource addresses as input
612610 */
613611 private async limitedResourcesInformation (
614- resource_addresses : ResourceAddress [ ] ,
612+ resource_addresses : string [ ] ,
615613 additional_metadata ?: string [ ] ,
616- ) : Promise < Map < ResourceAddress , ResourceInformation > > {
617- let resource_map = new Map < ResourceAddress , ResourceInformation > ( ) ;
614+ ) : Promise < Map < string , ResourceInformation > > {
615+ let resource_map = new Map < string , ResourceInformation > ( ) ;
618616
619617 let resp = await this . entityDetails ( resource_addresses ) ;
620618 resp . items . forEach ( ( item ) => {
@@ -802,7 +800,7 @@ export class GatewayProcessor {
802800 ) ;
803801 }
804802 private async nonFungibleIds (
805- resource_address : ResourceAddress ,
803+ resource_address : string ,
806804 at_ledger_state : number ,
807805 cursor ?: string ,
808806 ) : Promise < StateNonFungibleIdsResponse > {
@@ -874,7 +872,7 @@ export class GatewayProcessor {
874872 }
875873
876874 private async getNonFungibleData (
877- address : ResourceAddress ,
875+ address : string ,
878876 ids : string [ ] ,
879877 at_ledger_state ?: number ,
880878 ) : Promise < StateNonFungibleDetailsResponseItem [ ] > {
@@ -896,7 +894,7 @@ export class GatewayProcessor {
896894 }
897895
898896 private async getEntityLocation (
899- address : ResourceAddress ,
897+ address : string ,
900898 ids : string [ ] ,
901899 ) : Promise < StateNonFungibleLocationResponseItem [ ] > {
902900 return withMaxLoops (
0 commit comments