Skip to content

Commit

Permalink
Fix SDK to conform to stricter type expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed May 18, 2023
1 parent 056efd9 commit 184922e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions config/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"compilerOptions": {
"declaration": true,
"declarationDir": "../lib",
"lib": ["es2015"],
"moduleResolution": "node",
"rootDir": "../src",
"outDir": "../lib",
"target": "es5"
"target": "es6"
},
"include": ["../src"]
}
2 changes: 1 addition & 1 deletion src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class Server {
? Config.isAllowHttp()
: opts.allowHttp;

const customHeaders: object = {};
const customHeaders: Record<string, string> = {};

if (opts.appName) {
customHeaders["X-App-Name"] = opts.appName;
Expand Down
2 changes: 1 addition & 1 deletion src/stellar_toml_resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class StellarTomlResolver {
try {
const tomlObject = toml.parse(response.data);
return Promise.resolve(tomlObject);
} catch (e) {
} catch (e: any) {
return Promise.reject(
new Error(
`stellar.toml is invalid - Parsing error on line ${e.line}, column ${e.column}: ${e.message}`,
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ export namespace Utils {
let serverKP: Keypair;
try {
serverKP = Keypair.fromPublicKey(serverAccountID); // can throw 'Invalid Stellar public key'
} catch (err) {
} catch (err: any) {
throw new Error(
"Couldn't infer keypair from the provided 'serverAccountID': " +
err.message,
Expand Down Expand Up @@ -686,7 +686,7 @@ export namespace Utils {
let keypair: Keypair;
try {
keypair = Keypair.fromPublicKey(signer); // This can throw a few different errors
} catch (err) {
} catch (err: any) {
throw new InvalidSep10ChallengeError(
"Signer is not a valid address: " + err.message,
);
Expand Down

0 comments on commit 184922e

Please sign in to comment.