Skip to content

Commit

Permalink
fixes some api issues causing the wallet to fail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Snider committed Apr 23, 2022
1 parent 286641e commit e3ca3b1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/app/modules/chain/blockchain.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class BlockchainService {
startDaemon() {
const options = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/json'
}),
responseType: 'text' as 'json',
};
Expand All @@ -35,7 +35,7 @@ export class BlockchainService {
exportChain() {
const options = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/json'
}),
responseType: 'text' as 'json'
};
Expand All @@ -56,7 +56,7 @@ export class BlockchainService {
importChain() {
const options = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/json'
}),
responseType: 'text' as 'json'
};
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/console/console.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ConsoleComponent implements OnInit, AfterViewInit, OnDestroy {
if (ev.keyCode === 13) {

//console.log(`cmd:letheand:${this.command.join('')}`)
that.ws.sendMessage(`cmd:letheand:${this.command.join('')}`)
that.ws.sendMessage(`cmd:${this.attach}:${this.command.join('')}`)
this.command = []
this.terminal.underlying.writeln("\r\n");
this.ref.detectChanges();
Expand Down
4 changes: 2 additions & 2 deletions src/app/modules/wallet/components/open.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export class OpenComponent implements OnInit {
/**
* get list of filesystem wallets
*/
ngOnInit(): void {
this.wallets = this.wallet.getWalletList()
async ngOnInit() {
this.wallets = await this.wallet.getWalletList()
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/app/modules/wallet/wallet.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ <h4 *ngIf="wallet.balance.unlocked_balance != wallet.balance.balance">Locked Bal
<lthn-wallet-transfer></lthn-wallet-transfer>
</div>
</ngx-tab>
<ngx-tab label="Accounts">
<div *ngxIfTabActive></div>
<ngx-tab label="Console">
<div *ngxIfTabActive>
<lthn-console attach="lethean-wallet-rpc"></lthn-console>
</div>
</ngx-tab>
</ngx-tabs>
</ngx-section>
Expand Down
4 changes: 3 additions & 1 deletion src/app/modules/wallet/wallet.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {DetailsComponent} from '@module/wallet/components/details.component';
import {AddComponent} from '@module/wallet/components/add.component';
import {OpenComponent} from '@module/wallet/components/open.component';
import { TransferComponent } from './components/transfer/transfer.component';
import {ConsoleModule} from '@module/console/console.module';



Expand Down Expand Up @@ -67,7 +68,8 @@ import { TransferComponent } from './components/transfer/transfer.component';
TabsModule,
SectionModule,
CardModule,
NgxUIModule
NgxUIModule,
ConsoleModule
]
})
export class WalletModule {}
6 changes: 4 additions & 2 deletions src/app/modules/wallet/wallet.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,18 @@ export class WalletService {
* Gets the list of known wallets from the file system
*/
getWalletList() {
this.fs.listFiles('/wallets').then((data) => {
return this.fs.listFiles('/wallets').then((data) => {
console.log(data)
if (data.length > 0) {
for (let dat of data) {
if (!this.wallets.includes(dat) && !dat.endsWith('.keys') && !dat.endsWith('.txt')) {
this.wallets.push(dat);
}
}
}

return this.wallets
});
return this.wallets
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/filesystem/file-system-web.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class FileSystemWebService implements FileSystemInterface {
public async list(dirname) {
const options = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/json'
}),
responseType: 'text' as 'json'
};
Expand Down Expand Up @@ -57,7 +57,7 @@ export class FileSystemWebService implements FileSystemInterface {

const options = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/json'
})
};

Expand Down
2 changes: 1 addition & 1 deletion src/app/services/wallet.rpc.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class WalletRpcService {
startWalletService() {
const options = {
headers: new HttpHeaders({
'Content-Type': 'application/x-www-form-urlencoded'
'Content-Type': 'application/json'
}),
responseType: 'text' as 'json'
};
Expand Down

0 comments on commit e3ca3b1

Please sign in to comment.