Skip to content

Commit

Permalink
Upgrade TypeScript to 4.4 (#215)
Browse files Browse the repository at this point in the history
* Upgrade Typescript to 4.4

* Fix types
  • Loading branch information
macalinao committed Aug 29, 2021
1 parent f6b6523 commit abfe64c
Show file tree
Hide file tree
Showing 6 changed files with 371 additions and 340 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -17,7 +17,7 @@
"lint-staged": ">=11.1.1",
"prettier": "^2.3.2",
"size-limit": "^5.0.3",
"typescript": "^4.3.5"
"typescript": "^4.4.2"
},
"scripts": {
"build": "lerna run build",
Expand Down
6 changes: 3 additions & 3 deletions packages/stableswap-sdk/package.json
Expand Up @@ -24,16 +24,16 @@
"@types/bs58": "^4.0.1",
"@types/jest": "^27.0.1",
"@types/lodash.mapvalues": "^4.6.6",
"@types/node": "^16.4.12",
"@types/node": "^16.7.5",
"b58": "^4.0.3",
"eslint": "^7.32.0",
"husky": ">=7",
"jest": "^27.0.6",
"jest": "^27.1.0",
"lint-staged": ">=11.1.1",
"lodash.mapvalues": "^4.6.0",
"prettier": "^2.3.2",
"ts-node": "^10.1.0",
"typescript": "^4.3.5"
"typescript": "^4.4.2"
},
"dependencies": {
"@saberhq/token-utils": "^0.14.2",
Expand Down
37 changes: 15 additions & 22 deletions packages/stableswap-sdk/src/entities/exchange.ts
Expand Up @@ -117,28 +117,21 @@ export const loadExchangeInfo = async (
throw new Error("Swap program id mismatch");
}

let reserveA;
let reserveB;
let poolMint;
try {
reserveA = await loadProgramAccount(
connection,
swap.state.tokenA.reserve,
swap.config.tokenProgramID
);
reserveB = await loadProgramAccount(
connection,
swap.state.tokenB.reserve,
swap.config.tokenProgramID
);
poolMint = await loadProgramAccount(
connection,
swap.state.poolTokenMint,
swap.config.tokenProgramID
);
} catch (e) {
throw new Error(e);
}
const reserveA = await loadProgramAccount(
connection,
swap.state.tokenA.reserve,
swap.config.tokenProgramID
);
const reserveB = await loadProgramAccount(
connection,
swap.state.tokenB.reserve,
swap.config.tokenProgramID
);
const poolMint = await loadProgramAccount(
connection,
swap.state.poolTokenMint,
swap.config.tokenProgramID
);
return makeExchangeInfo({
swap,
exchange,
Expand Down
2 changes: 1 addition & 1 deletion packages/token-utils/package.json
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@saberhq/solana-contrib": "^0.14.2",
"@solana/spl-token": "^0.1.5",
"@solana/spl-token-registry": "^0.2.210",
"@solana/spl-token-registry": "^0.2.223",
"@solana/web3.js": "^1.23.0",
"@ubeswap/token-math": "^4.1.0",
"buffer-layout": "^1.2.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/use-solana/src/adapters/ledger/index.tsx
Expand Up @@ -100,7 +100,7 @@ export class LedgerWalletAdapter extends EventEmitter implements WalletAdapter {
this.emit("connect", this._publicKey);
} catch (error) {
await this.disconnect();
throw new LedgerError(error);
throw new LedgerError(error as Error);
} finally {
this._connecting = false;
}
Expand Down Expand Up @@ -154,7 +154,7 @@ export class LedgerWalletAdapter extends EventEmitter implements WalletAdapter {
}
return ret;
} catch (error) {
throw new LedgerError(error);
throw new LedgerError(error as Error);
} finally {
await transport?.close();
}
Expand Down

1 comment on commit abfe64c

@vercel
Copy link

@vercel vercel bot commented on abfe64c Aug 29, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.