* Add user transfer authority to swap instruction
* Add user transfer authority to deposit all
* Add authority to withdraw all
* Add authority to deposit one
* Add authority to withdraw one
* Update fuzzer
* Add user transfer authority to JS
* Add instructions to deposit / withdraw one token
* Run cargo fmt
* Fix clippy issues
* Add JS interface
* Add tests for new instructions
* Run prettier
* Rename deposit and withdraw
* Rename withdraw -> withdraw all in program
* Rename single token instructions
* Add price parameter for flat / constant price curve
This encompasses a lot of changes to properly support the constant price
curve, and fixes some old pain points to make the whole thing easier to
use, including:
* refactor fees out of the curve
* move all fee calculations into new Fees type
* modify constraints to only care about curve types and fee
* add price parameter into constant price curve (flat curve)
* Run cargo fmt and clippy
* Revert interface changes and math update
* Run cargo fmt
* Address review feedback
* Fix fraction validation for zeros
* Add mints to swap info
* Add mints to JS
* Add fee account in SwapInfo / init
* Add test for 0 fee, init test fully
* Add withdraw command interface
* Add fee accounts to swap instruction
* Add calculations for swap and withdraw fees
* Run cargo fmt
* Add new fees to JS and test
* Review feedback: fixup instruction doc and clone
* Update order of accounts in instructions
* Run cargo fmt
* Fix owner fee pool token calculation to include trading fee
* Add owner fees to flat curve, per request
* Fix instruction comment numbering
* Add more errors types for clearer calculation errors
Add a check for withdrawing from fee account
* Cargo fmt
* Pass TokenSwap state into the constructor to simplify function calls
* WIP: Update program to return token_program_id
* Add tokenProgramId to js TokenSwapInfo object
* Address pr comments
* Remove TokenSwapInfo and use loadTokenSwap as the primary way to fetch TokenSwap metadata
* Fix module.d.ts
* Address pr comments
* Clarification on comments
Co-authored-by: Yutaro Mori <yutaro@umaproject.org>
* Fix lint check in CI
* `npm run lint` now checks that code is properly formatted, instead of
running the formatter
* Add extra commands to run the linting, include ts definitions file
* Update flow-bin, fix type errors that come up
* Clarify lint vs lint:fix as requested
* Run `pretty` properly
* Add `build:program` like for spl-token
* Add TypeScript to CI
* snake_case -> camelCase variables
* Combine transactions on swap initialization
* Make instruction functions static
* Added token-swap ts and flow bindings and build pure JS versions using rollup, to match the token program
* Added references to the built files in token-swap package.json
* Added missing Account import
* Fix flow module syntax errors