Commit Graph

1449 Commits

Author SHA1 Message Date
Forrest Wolf
f992a9ba04 Give bids in NewBidTable an explicit type 2022-05-25 17:16:59 -04:00
Forrest Wolf
3a9a9b1c6e Revert "Give event in Dropdown an explicit type"
This reverts commit 80604310f2.
2022-05-25 17:14:19 -04:00
Forrest Wolf
80604310f2 Give event in Dropdown an explicit type 2022-05-25 11:46:24 -04:00
Forrest Wolf
9d3c15b115 Create StripeSession type 2022-05-25 11:37:13 -04:00
Forrest Wolf
ccf8ffb0b5 Add explicit types to removeUndefinedProps 2022-05-25 11:32:26 -04:00
Forrest Wolf
40fd467f22 Give react children explicit types 2022-05-25 11:22:12 -04:00
Marshall Polaris
8ff3f8336c Correctly specify tsconfig dir name in functions eslintrc 2022-05-24 13:49:44 -07:00
Marshall Polaris
ae4b8fad51 Turn on Typescript linting in common except for no-explicit-any 2022-05-24 13:48:39 -07:00
Marshall Polaris
4696733ec6 Fix some trivial Typescript issues 2022-05-24 13:48:39 -07:00
Marshall Polaris
f2e52cfcb2 Kill dead code 2022-05-24 13:48:39 -07:00
Marshall Polaris
5f3253966e Prefer const over let over var 2022-05-24 13:48:39 -07:00
Marshall Polaris
7d1131aa6f Add tsconfig.json for common 2022-05-24 13:48:39 -07:00
Marshall Polaris
3987baa11b
Add Vercel routes for public write API (#280)
* Improve typing of client CORS helper

* Take node-fetch as a dependency

* Add explicit Firebase region into config

* Add new Vercel proxy API routes that talk to backend

* Call Vercel proxy routes from `api-call` module

* Tweak import to try to get Vercel happy

* Tidy up a tiny bit
2022-05-23 14:16:56 -07:00
Ian Philips
fb33f829cc Clean up free market countdown bugfix 2022-05-23 15:14:50 -06:00
James Grugett
2b13b1adb7 Update activity feed every hour to decrease cost 2022-05-23 15:29:18 -05:00
Ian Philips
0f01753795 Daily free market countdown fix 2022-05-23 11:26:17 -06:00
Ian Philips
d0347ff5c2
Add countdown timer for daily free market (#276)
* Add countdown timer for daily free market

* Reset example numbers

* Remove daily

* Free market reset => 4pm UTC
2022-05-23 08:43:11 -06:00
Ian Philips
355b2261a7 Show numeric bet panel between sm-xl 2022-05-23 08:04:55 -06:00
Ian Philips
e94d204a87
Simplify market creation page (#268)
* Simplify market creation page

* Minor improvements

* Prettier
2022-05-23 06:35:50 -06:00
James Grugett
fc6b36b690 Adjust numeric graph axis to use large number formatting 2022-05-22 22:05:52 -05:00
James Grugett
21527275d1 Fix numeric market embeds 2022-05-22 22:03:05 -05:00
James Grugett
1c73bba908 Show x value in numeric graph's tooltip 2022-05-22 17:48:02 -05:00
James Grugett
f85b10e517 Exclude partial day from analytics 2022-05-22 17:35:10 -05:00
Jonas Wagner
2a5b68977b
Require a minimum amount of 1 Mana per bet. (#273)
This is a hacky patch for a problem that runs more deeply: the use of
floating-point for Mana calculations, along with the associated rounding
errors.

Consider the following example:

```typescript
const balance = 1000
const bet = 5.6e-14
const newBalance = balance - bet
if (newBalance == balance) {
  alert(`I placed a bet of ${bet} without changing my balance.`)
}
```

This will actually print a message, because floating-point numbers can
only represent so many digits, and thus we get 1000.0 rather than
999.99999999999994.

This is a purely theoretical attack at this point; nobody could create
enough pico-bets to actually affect their balance using this technique.
However, I believe is worth ensuring a minimum bet amount, and might
prevent other problems such as the UI showing messages like "User Foo
bought M0 of YES", which could confuse users.

For a more definite solution, we would probably need to change some
computation to integers, where addition is always commutative and
value-preserving. This is similar to what most financial software does
(e.g., Bitcoin uses 1 Satoshi = 0.00000001 BTC as their unit).
2022-05-22 16:34:18 -05:00
Marshall Polaris
73d538c7cf
Modularize imports of hero icons in compiler (#292) 2022-05-22 12:40:34 -07:00
Marshall Polaris
d072216d2d
Kill /about page (#293) 2022-05-22 12:40:16 -07:00
Marshall Polaris
47f10301c8
Change lodash stuff so that it can be tree-shaken out of build (#233)
* Set common package.json sideEffects: false

* Configure SWC to modularize lodash imports

* Import specific lodash functions instead of _

* Add an eslint rule to avoid full lodash import
2022-05-22 01:36:05 -07:00
Marshall Polaris
0803a15902
Set up eslint for common, functions packages (#290)
* Move common dev dependencies to workspace top level

* Add .eslintrc.js for functions and common packages

* Add more linting to check workflow
2022-05-22 00:35:43 -07:00
Marshall Polaris
3061af3837
Kill Husky, lint-staged, and pretty-quick (#288) 2022-05-21 14:50:59 -07:00
Marshall Polaris
3db1de6b66
Add some useEffect dependencies (#289) 2022-05-21 14:48:15 -07:00
Marshall Polaris
cd602755be Try just killing setup-node action in check workflow 2022-05-21 14:43:43 -07:00
Marshall Polaris
f25b0d66f5 Disable Next.js telemetry in check workflow 2022-05-21 14:04:14 -07:00
Marshall Polaris
55fb59a54c
Rename static analysis job (#287)
* Rename static analysis job

* Try to colorize check workflow output
2022-05-21 14:01:29 -07:00
Marshall Polaris
7fdd8bd539 Try to make check job continue but report failure accurately 2022-05-21 13:38:21 -07:00
Marshall Polaris
1c041d74f0 Remove check workflow security events permission 2022-05-21 13:25:44 -07:00
Marshall Polaris
32284791e2 Cache subpackage node_modules in check workflow 2022-05-21 13:23:29 -07:00
Marshall Polaris
8321bc94c6 ESLint should barf on warnings in check workflow 2022-05-21 13:19:00 -07:00
Marshall Polaris
00e14ac8b2 Check workflow should continue on error 2022-05-21 13:17:28 -07:00
Marshall Polaris
9a25fd4b73 Adjust prettier check, directory switching in check workflow 2022-05-21 13:11:28 -07:00
Marshall Polaris
1be7685741 Try implementing node_modules cache in check workflow 2022-05-21 13:08:16 -07:00
Marshall Polaris
190f013a15 Yarn --prefer-offline in check workflow 2022-05-21 12:59:19 -07:00
Marshall Polaris
767ec81205 Add per-branch concurrency to check workflow 2022-05-21 12:55:20 -07:00
Marshall Polaris
1008c8a9fc Run prettier --check in check workflow 2022-05-21 12:53:24 -07:00
Marshall Polaris
d118551405 Switch check workflow to use single job 2022-05-21 12:51:31 -07:00
Marshall Polaris
c0cc9cdb7a Add runs-on field to GitHub static analysis workflow 2022-05-21 12:44:35 -07:00
Marshall Polaris
1ddfd41a18
Add GitHub 'check' workflow to do static analysis (#286) 2022-05-21 12:42:59 -07:00
James Grugett
c5660ab762 Prevent flash of "No markets found" on search load 2022-05-21 13:51:41 -04:00
James Grugett
688ebb797a Add "Last updated" sort option 2022-05-21 13:44:55 -04:00
Marshall Polaris
98c5329e03
Fix up API CORS header processing (#277)
* Fix ultra embarrassing bug not restricting CORS origins

* Put CORS origin regexps in common

* Static types so I don't muck it up again

* Fixup CORS regex to be more strict

* Fix sloppy imports to actually work
2022-05-20 19:34:26 -07:00
Marshall Polaris
540476f65a
Public API improvements (#266)
* Remove needless wrappers from API requests and responses

* Return real HTTP status codes instead of status field

* More robustly handle API errors

* Fix broken error handling in NumericResolutionPanel warmup
2022-05-20 14:58:14 -07:00