Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mstrasinskis committed Jul 19, 2024
1 parent 1e4b8b4 commit 154c6ee
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions frontend/src/lib/canisters/nns-dapp/nns-dapp.canister.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import type {
AccountDetails,
CanisterDetails,
CreateSubAccountResponse,
GetAccountResponse, ImportedToken, ImportedTokens,
GetAccountResponse,
ImportedToken,
ImportedTokens,
RegisterHardwareWalletRequest,
RegisterHardwareWalletResponse,
RenameSubAccountRequest,
Expand Down Expand Up @@ -335,20 +337,26 @@ export class NNSDappCanister {
throw new AccountNotFoundError("error__account.not_found");
}
// Edge case
throw new Error(`Error getting imported tokens ${JSON.stringify(response)}`);
throw new Error(
`Error getting imported tokens ${JSON.stringify(response)}`
);
};

public setImportedTokens = async (importedTokens: Array<ImportedToken>): Promise<void> => {
const response = await this.certifiedService.set_imported_tokens(
{ 'imported_tokens' : importedTokens }
);
public setImportedTokens = async (
importedTokens: Array<ImportedToken>
): Promise<void> => {
const response = await this.certifiedService.set_imported_tokens({
imported_tokens: importedTokens,
});
if ("Ok" in response) {
return;
}
if ("AccountNotFound" in response) {
throw new AccountNotFoundError("error__account.not_found");
}
// Edge case
throw new Error(`Error setting imported tokens ${JSON.stringify(response)}`);
throw new Error(
`Error setting imported tokens ${JSON.stringify(response)}`
);
};
}

0 comments on commit 154c6ee

Please sign in to comment.