Where do I put my address in?


#1

Hi everyone!

I’m doing the Craftain course about NEM Catapult and I’m filling out the file 07_aggregate_complete_transaction.ts. (It’s found in the lesson called “Aggregate Complete Transaction.”)

Here’s a screenshot of where I’m up to:

In line 20, my customer’s address is underlined with a red line which means it’s wrong. I thought the address was a string so that’s why I placed quotation marks around the address.

How do I fix this error?

Thanks!


#2

It needs to be casted as type Address.

import { Address } from  'nem2-sdk';

const address = Address.createFromRawAddress("<the address here>")

const customersAddresses: Address[] = [address]

#3

@jtey1 I’m a bit confused; do I add const address = Address.createFromRawAddress("address") to the file? Thank you!


#4

Yes


#5

Is this right?


#6

This is literal. You don’t replace address with the raw address string

const customersAddresses: Address[] = [address]

#7

Thank you very much @jtey1! I don’t have any more errors now. :slight_smile: