@@ -504,18 +504,20 @@ export class GatewayProcessor {
504504 * Retrieves non-fungibles items associated with specified resource address and ids.
505505 * @param resource_address Address of the non-fungible items.
506506 * @param ids Ids of the non-fungible items.
507+ * @param at_ledger_state State against which to make the query.
507508 */
508509 async getNonFungibleItemsFromIds (
509510 resource_address : ResourceAddress ,
510511 ids : string [ ] ,
512+ at_ledger_state ?: number ,
511513 ) : Promise < NonFungibleItem [ ] > {
512514 const nft_batches = divideInBatches ( ids , 100 ) ;
513515 const limit = pLimit ( this . _concurrencyLimit ) ;
514516 return (
515517 await Promise . all (
516518 nft_batches . map ( async ( batch ) => {
517519 let items_data = await limit ( async ( ) =>
518- this . getNonFungibleData ( resource_address , batch ) ,
520+ this . getNonFungibleData ( resource_address , batch , at_ledger_state ) ,
519521 ) ;
520522 return items_data . map ( ( item ) => {
521523 let description : string = "" ;
@@ -874,10 +876,19 @@ export class GatewayProcessor {
874876 private async getNonFungibleData (
875877 address : ResourceAddress ,
876878 ids : string [ ] ,
879+ at_ledger_state ?: number ,
877880 ) : Promise < StateNonFungibleDetailsResponseItem [ ] > {
878881 return withMaxLoops (
879882 async ( ) => {
880- return await this . _api . state . getNonFungibleData ( address , ids ) ;
883+ return await this . _api . state . getNonFungibleData (
884+ address ,
885+ ids ,
886+ at_ledger_state
887+ ? {
888+ state_version : at_ledger_state ,
889+ }
890+ : undefined ,
891+ ) ;
881892 } ,
882893 "Could not query non fungible data" ,
883894 this . _maxLoops ,
0 commit comments