* 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>
* token-swap: Add token supply in invariant calculation
* Refactor state classes into curve components for future use
* Align pool initialization with Uniswap using geometric mean of token
amounts
* Fix deposit and withdraw instruction to work as a proportion of pool
tokens
* Add math utilities to calculate the geometric mean with u64
* Improve variable names
* Use a fixed starting pool size
* Run cargo fmt
* Update js tests with new pool numbers
* Run linting
* Remove math
* Fix BN type issues found by flow
* 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
* Fix local token-swap tests
* Change generation of program address to use a nonce
* Accept nonce properly in initialization
* Include nonce in TokenSwap structure
* Fixup serialization with new parameter (padding used for now)
* Update dependencies
Update toml / lock files
Fix token swap initialization end-to-end
Cleanup unit test to use `find_program_address`
Add / refactor tests
Most importantly, added a special test to make sure that
token_program_id is provided at the end of CPI instructions, since
unit testing did not pick up that problem, and it was tough to debug
during end-to-end testing
* Revert some testing changes for PR
* Update token-swap/program/src/processor.rs
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
* Integrate review comments
* Fmt and clippy
* Refactor for clippy
* Fmt again
* Fix npm lint error
* Clarify signers line as requested
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>