Commit Graph

2181 Commits

Author SHA1 Message Date
Ikko Ashimine 0655bd7dd1
Fix typo in account.rs (#2651)
insted -> instead
2021-12-18 10:08:40 -07:00
Phạm Văn Dũng a6a1ce4290
fix account list in token_swap instructions docs (#2648) 2021-12-17 13:05:23 +01:00
Jack May 14fd41336b
Bump instruction count limit (#2647) 2021-12-16 13:49:43 -08:00
Jon Cinque 5aa3b98f2c
stake-pool-cli: Add next fees in verbose mode, fix mapping (#2645) 2021-12-16 14:46:01 +01:00
Jordan Sexton fef4438cd1 fix test 2021-12-14 16:49:30 -06:00
Jordan Sexton 4179acbf8b
Rewrite spl-token-js in TypeScript (#2539)
* first draft

* restructuring

* fix imports

* move errors to constants

* fmt

* fix ata

* finish core implementation

* don't export internal utils

* rename internal util files

* token account is owned by token program

* docs

* docs

* port example

* add basic tests from current implementation

* enable es6 features in lint config

* don't build tests into lib dir

* doc tweaks

* add preinstall script

* add types, don't postinstall

* allow keypairs to create accounts, and default to using ATAs

* add explicit enum values

* remove unused dependency

* expose allowOwnerOffCurve option to getOrCreateAssociatedTokenAccount action

* make multisigners optional

* WIP, undo

* update buffer-layout and buffer-layout-utils from npm

* update dev dependencies
2021-12-14 16:47:57 -06:00
Jon Cinque 2cd68d3f5c
token-2022: Add transfer fee types and instructions (#2608)
* token-2022: Add transfer fee accounts and instructions

* Address feedback

* More feedback

* Move to mixins

* Separate instructions for mixin initialization

* Feedback again again again!

* Getting there...

* More more feedback again again

* Add `WithdrawWithheldTokensFromAccounts` instruction

* Add instruction serde, fix all errors
2021-12-14 23:36:02 +01:00
Jon Cinque ba08b6e662
stake-pool: Mint extra reserve lamports as pool tokens on init (#2636)
* stake-pool: Mint extra reserve lamports as pool tokens on init

* Wait more aggressively in py test

* Simplify test
2021-12-14 18:45:15 +01:00
Jon Cinque 9bda73f37c
stake-pool-cli: Add `deposit-all-stake` command (#2614)
* stake-pool-cli: Add `deposit-all-stake` command

* Improve py test
2021-12-14 02:25:37 +01:00
Jon Cinque d5ac6b883b
stake-pool-py: Add simple rebalance bot (#2630)
* stake-pool-py: Add simple rebalance bot

* Fixup test

* Refactor flaky tests

* Create vote earlier in test

* Duplicate create_vote call causes stall

* Wait more aggressively
2021-12-13 13:17:07 +01:00
Yang Hau 8eb2c3ce60
fix: Fix typos (#2625) 2021-12-12 02:48:06 -07:00
Abhimanyu Singh Gaur 70973850d3
token-swap: Migrate to `@solana/buffer-layout` (#2629) 2021-12-10 21:53:46 +01:00
Michael Vines 442ff895e9 Remove legacy msg form 2021-12-10 07:41:53 -08:00
Michael Vines 1a0155e34b Update to Rust 1.57.0 2021-12-09 23:56:47 -08:00
Jon Cinque a7888861da
stake-pool-py: Create and deserialize stake pools (#2557)
* stake-pool-py: Create and deserialize stake pools with CI

* Add ability to add / remove validators

* Add vote init instruction for cleaner tests

* Fixup CI

* Add deposit / withdraw sol

* Add update instructions

* Add increase / decrease stake

* Add deposit / withdraw stake
2021-12-10 00:43:25 +01:00
Abhimanyu Singh Gaur e29bc53c5f
Migrate to @solana/buffer-layout (#2624)
* Update package.json

* Fix build errors

* More fixes

* Add flow definitions
2021-12-09 16:26:14 +01:00
Jordan Sexton 0b8961597b
lending: validate pyth price trading status (#2618) 2021-12-04 17:59:20 -06:00
imprfekt eaca634995
docs: token: Added timelock program (#2616)
* docs: token: Added timelock program

Added another solution for SPL token vesting, with additional customizations.

* Docs: token: Token Vesting — solution names and orders

* docs: token: Added "coming soon" features for StreamFlow's token vesting.

...and further explained default options.
2021-12-04 01:09:14 +01:00
Jordan Sexton c2b287788b
lending: handle rounding consistently (#1883)
* handle rounding consistently

* remove unused method

* slightly increase test compute limits

* reuse existing decimal functions
2021-12-03 17:13:21 -06:00
Jon Cinque c24bc966f1
stake-pool-cli: Update input parser to work with ledgers (#2613)
* stake-pool-cli: Update input parser to work with ledgers

* fmt
2021-12-03 01:55:18 +01:00
Jon Cinque 97285c65b1
Update Cargo.lock post themis removal (#2611) 2021-12-03 00:47:08 +01:00
Brooks Prumo 1de578d36e
docs: Prefer non gendered pronouns (#2610) 2021-12-02 17:28:45 -06:00
Ben Lawson f3ad77cfce (Docs) Update Coverage instructions with MacOS commands 2021-12-01 22:26:19 -08:00
Jack May 507f928c0a
Remove themis (#2607) 2021-12-01 12:31:01 -08:00
Jack May 5839d97449
Exclude farms from workspace (#2606) 2021-12-01 10:48:10 -08:00
Alexander Meißner fe2e5b6d2b
Adds "solana-version" to "patch.crates-io.sh" (#2603)
To fix broken "downstream-projects" CI step in the mono repo after #2576 was merged.
2021-11-30 16:04:05 +01:00
Alexey Skibin 05c26de4c8
Add Solana Farms (#2576) 2021-11-29 11:37:23 -06:00
Victor Pontis 801b4e59f8 Update comment on state.rs regarding is_native
I was confused when reading this comment and had to read the code to realize that the comment isn't a typo. 

(Btw, let me know if this kind of small changes are helpful or not 👍.)
2021-11-28 20:39:45 -08:00
Paul 7393f1de43
spl-token: provide more useful output when using create-token with the output option and small redesign of token cli architecture (#2593)
* spl-token: WIP

* Remove and_then, move tx handling in separate function- output handling still missing

* spl-token: add basic output handling for all calls, add detailed output to create-token

* spl-token: remove changes in bench that are not strictly necessary to remove # of files touched in this PR

* [spl-token] cli: HandleTxReturn is now TransactionReturnData

* [spl-token] cli: Make commands return output String that is printed in fn main()

* [spl-token] cli: remove old todos

* [spl-token] cli: only use no_wait arg in command_transfer and use constant for "create-token"
2021-11-24 12:08:46 -07:00
Jon Cinque f83240a868
token-swap: Prevent single deposits for curves that don't allow it (#2590) 2021-11-17 23:41:55 +01:00
Jon Cinque d5581dbd62
governance: Remove dependency on ProcessInstructionWithContext (#2589) 2021-11-17 15:48:01 +01:00
Jon Cinque 7764a9d5c7
token: Transition perf-monitor to solana-program-test (#2586)
* token: Transition perf-monitor to solana-program-test

* fmt

* Refactor for clarity
2021-11-16 23:15:45 +01:00
Jon Cinque 688ee423ed
stake-pool-cli: Fix vote account address in details (#2585) 2021-11-16 21:30:10 +01:00
Michael Vines 4a9c91d594 Bump spl-name-service version to 0.2.0 2021-11-16 08:55:46 -08:00
DR497 fb949741fb name service: allow parent name owner to update records 2021-11-16 08:41:11 -08:00
Jon Cinque 02d2736797
token-js: Add test for disabling mint authority (#2582) 2021-11-15 18:56:23 +01:00
Dmitri Makarov c6758a697c
Increase compute max units for sqrt_u128_max test (#2574)
This increase is caused by upgrade of compiler builtins
2021-11-13 07:16:11 -08:00
Sebastian Bor bf7ad18f41
Governance: vote options (#2544)
* feat: use VoteChoice instead of VoteWeight

* chore: make clippy happy

* feat: use options for ye/no vote

* feat: use choices for CastVote instruction

* chore: move Vote enum to tests

* fix: iterate overall choices for withdrawal

* chore: split ProposalOption and ProposalOptionVote

* fix: calculate multi option proposal size

* chore: split weighted and fractional vote choices

* feat: add proposal type

* feat: add reject option flag

* feat: calculate final state for proposal using options results

* chore: make clippy happy

* fix: generalise max vote weight calculation for multiple options

* feat: gate vote tipping for yes/no proposals only

* chore: make clippy happy

* feat: add option_index to instruction

* feat: move instructions to options

* chore: advance clock

* chore: add await

* chore: add multi option proposal tests

* chore: move governing_mint to account list

* feat: assert valid proposal options

* feat: assert proposal is executable when instruction is added

* chore: make clippy happy

* chore: add tests to insert instructions into multi option proposal

* chore: make clippy happy

* feat: use explicit reject_option_vote_weight

* feat: use Vote struct for vote results

* feat: validate vote

* feat: reject empty proposal options

* chore: update comments

* fix: allow execute only successful options

* chore: add assertions for option statuses

* chore: add partial success test

* chore: add full success execution test

* chore: add test for instructions execution for fully denied proposal

* feat: finalise none executable proposals into completed state

* chore: fix chat

* feat: add vote_record v1 v2 roundtrip serialization

* eat: add proposal_instruction v1 v2 roundtrip serialisation

* chore: use VoteRecordV1

* chore: use legacy structs instead of legacy crate version

* chore: rename proposal to V2

* feat: translate Proposal v1 v2 versions

* chore: make clippy happy

* chore: make clippy happy

* chore: remove unnecessary clone for match

* chore: rename get_final_vote_state to resolve_final_vote_state

* fix proposal account name

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>

* chore: fix compilation

* chore: use borsh::maybestd::io::Write

* chore: consume self in serialise instructions to avoid cloning

* chore: update comments

* feat: add N limit placeholder to multi choice vote type

* feat: increase options size to u16

* fix: use checked math

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2021-11-11 19:34:00 +00:00
JulI0-concerto cd63580b79
Implement multiple output format for spl-stake-pool list-all (#2558)
* Implement json output formats for spl-stake-pool list-all

* Implement --output json or json-compact or display in list-all cmd

* cleanup: use destructuring instead of tuple

* Fix related to PR comments

* Add json and json-compact output for list command

* implement list command display with Display and VerboseDisplay

* make CliStakePool->details optional

* cleanup use

* Update stake-pool/cli/src/main.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* Update stake-pool/cli/src/main.rs

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>

* clippished

* fix use

* fix fmt issue

Co-authored-by: Julien Piccaluga <julien.piccaluga@kudelskisecurity.com>
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-11-10 13:06:14 -07:00
Ikko Ashimine 707382ee96
Fix typo in main.rs (#2569)
auxillary -> auxiliary
2021-11-10 11:18:07 -07:00
Jon Cinque 75ddd9bb22
stake-pool-docs: Rearrange docs, add quickstart guide (#2561)
* stake-pool-docs: Rearrange docs, add quickstart guide

* Rearrange doc sidebar
2021-11-06 12:48:11 +00:00
MarkSackerberg 81c90f5c73
Allow GC to close empty associated accounts (#2554)
* Allow GC to close empty associated accounts

Empty associated accounts will only be closed in case the new flag del_associated_accounts is set. Otherwise behaviour is as before.

Useage:
spl-token gc --del_associated_accounts

* use kebab-case

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>

* align coding style

Thank you jon!

* Add sanity check

* correcting amount check before closing

* formatting correcly

using cargo fmt

* changing sanity check to assert!

Co-authored-by: Sack <none>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
Co-authored-by: Mark Sackerberg <Contact@Discord>
2021-11-04 22:49:23 +01:00
Jon Cinque fcbc0d3501
token-swap: Add comment for stable curve A calculation (#2556) 2021-11-03 19:48:25 +01:00
Jon Cinque 8aef395901
stake-pool: Bump CLI and program version to 0.6.3 (#2555) 2021-11-02 22:15:33 +01:00
Jon Cinque 01765b9953
stake-pool: Reduce wait for active stake merges (#2553)
* stake-pool: Reduce wait to one epoch for active merges

* Remove stake_program references

* Remove credits observed point from docs
2021-11-01 15:14:49 +01:00
Alexander Ray 287c3bedaf
stake-pool-cli: Fix prepare_withdraw_accounts issues (#2548)
* - fix prepare_withdraw_accounts issues

* - use reverse fee as workaround for withdraw issue
2021-10-26 23:13:59 +02:00
Jon Cinque cd3f5ae9fe
stake-pool: Add test for withdrawing all, with fee (#2550) 2021-10-26 22:50:16 +02:00
Jon Cinque 8be3ba819c
stake-pool-docs: Add the published audits (#2546) 2021-10-26 22:30:16 +02:00
Jon Cinque 756696ee8e
stake-pool-cli: Add validator list argument to create (#2545)
People want to know more about the validator list, but there isn't too
much info provided.

* Include the validator list as an optional parameter to pool creation
* Print out the address during creation
* Always print out the address during `list`
* Add docs about it
2021-10-25 23:13:58 +02:00
Sebastian Bor d550f4f7e6
Governance: Flag payer account as writable on instructions creators (#2543) 2021-10-25 14:08:34 +01:00