Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public async fetchUser(userAccount: string) {
- const result = await this._contractInstance.getUser(userAccount, {
- from: userAccount,
- });
- const newUser: User = {
- userAddress: userAccount,
- userName: result[getUserResultIndex.userName],
- };
- return newUser;
- }
- public async fetchUsers() {
- const userAddressList: string = await this._contractInstance.getUserAddressList();
- const users: User[] = [];
- for (let i = 0; i < userAddressList.length; i++) {
- const newUser = await this.fetchUser(userAddressList[i]);
- users.push(newUser);
- }
- return users;
- }
Add Comment
Please, Sign In to add comment