1414 * limitations under the License.
1515 */
1616
17- import { sha3_256 } from 'js-sha3' ;
1817import { Observable } from 'rxjs/internal/Observable' ;
1918import { KeyPair , MerkleHashBuilder , SHA3Hasher , SignSchema } from '../../core/crypto' ;
20- import { Convert , RawArray } from '../../core/format' ;
19+ import { Convert } from '../../core/format' ;
2120import { AggregateBondedTransactionBuilder } from '../../infrastructure/catbuffer/AggregateBondedTransactionBuilder' ;
2221import { AggregateCompleteTransactionBuilder } from '../../infrastructure/catbuffer/AggregateCompleteTransactionBuilder' ;
2322import { AmountDto } from '../../infrastructure/catbuffer/AmountDto' ;
@@ -42,6 +41,8 @@ import {Transaction} from './Transaction';
4241import { TransactionInfo } from './TransactionInfo' ;
4342import { TransactionType } from './TransactionType' ;
4443import { TransactionVersion } from './TransactionVersion' ;
44+ import { of , from } from 'rxjs' ;
45+ import { map , mergeMap , toArray } from 'rxjs/operators' ;
4546
4647/**
4748 * Aggregate innerTransactions contain multiple innerTransactions that can be initiated by different accounts.
@@ -409,6 +410,24 @@ export class AggregateTransaction extends Transaction {
409410 * @returns {TransferTransaction }
410411 */
411412 resolveAliases ( receiptHttp : ReceiptHttp ) : Observable < AggregateTransaction > {
412- throw new Error ( 'Not implemented' ) ;
413+ return from ( this . innerTransactions ) . pipe (
414+ mergeMap ( ( transaction ) => transaction . resolveAliases ( receiptHttp ) ) ,
415+ map ( ( transaction ) => transaction as InnerTransaction ) ,
416+ toArray ( ) ,
417+ ) . pipe (
418+ map ( ( innerTransactions ) => new AggregateTransaction (
419+ this . networkType ,
420+ this . type ,
421+ this . version ,
422+ this . deadline ,
423+ this . maxFee ,
424+ innerTransactions ,
425+ this . cosignatures ,
426+ this . signature ,
427+ this . signer ,
428+ this . transactionInfo ,
429+ ) ,
430+ ) ,
431+ ) ;
413432 }
414433}
0 commit comments