Commit Graph

1256 Commits

Author SHA1 Message Date
hanako mumei 7b86fc9038 token-cli: remove handle_tx 2022-10-06 17:33:34 -07:00
hanako mumei 7847f35f1e token-cli: convert transfer to client 2022-10-06 17:33:34 -07:00
hanako mumei e6739b5bae token-cli: convert gc to client
add new client function empty_and_close_auxiliary_account which does what it says
also remove sign-only mode from command_close to permit client close behave more sensibly
2022-10-06 17:33:34 -07:00
hanako mumei 186303a9d2 token-cli: convert create_multisig to client 2022-10-06 17:33:34 -07:00
hanako mumei 37168db058 token-cli: convert required memos and interest rate to client 2022-10-06 17:33:34 -07:00
hanako mumei 7e3a62473b token-client: convert extended functions to new interface
covers all extensions except confidential transfers
2022-10-06 17:33:34 -07:00
Jon Cinque 96ce922727
token-cli: Add directions for building and running tests (#3673) 2022-10-06 19:37:22 +02:00
mwrites f61af23932
[token-js] : JS binding for CreateIdempotent instruction (#3558)
* JS binding for CreateIdempotent instruction

* revert

* newline

* Removed Idempotent flag and extracted Idempotent logic to its own set of functions

* Conventions
2022-10-06 16:56:32 +02:00
timkoopmans 4e09bd54fb typo 2022-10-04 15:59:29 -07:00
hanako mumei 065e62922a token-cli: load config if exists without -C 2022-09-29 14:34:05 -07:00
samkim-crypto 50abadd819
token-2022: integrate memo into confidential extension (#3587)
* resolve conflict

* add test for confidential extension with memo

* add test for confidential transfer with memo

* change proof instruction order for memo

* resolve conflict

* minor

* rename new_with_memo to new_with_required_memo_transfers

* fix failing tests due to rebase

* fix failing tests due to rebase
2022-09-26 12:27:44 +09:00
hanako mumei e988b163bb token-cli: constrain program id input 2022-09-21 10:37:53 -07:00
hanako mumei 2ae2a6bdf3 token-cli: test --immutable, final cleanups 2022-09-21 10:37:53 -07:00
hanako mumei 304e1bd0f7 token-cli: implement --immutable for wrap 2022-09-21 10:37:53 -07:00
hanako mumei 5756e7f9b7 token-cli: convert unwrap and sync_native to client
also allow client to control its own nativeness (nativity?)
2022-09-21 10:37:53 -07:00
hanako mumei 953e06b3a2 token-client: support wrap
also convert cli to use client for wrap
2022-09-21 10:37:53 -07:00
hanako mumei 6b05f02be7 token-cli: implement --immutable for create-account 2022-09-21 10:37:53 -07:00
hanako mumei 697a9e3d5e token-cli: convert create-account to use client 2022-09-21 10:37:53 -07:00
hanako mumei e5d4b824b7 token-cli: remove unnecessary fetch for memo transfers 2022-09-16 13:24:16 -07:00
Andrii Tretyakov feeda6a61e
token-cli: Memo transfer extension (#3525)
token-cli: Add support for required transfer memos
2022-09-16 11:17:42 -07:00
Jon Cinque f97a3dc7cf
clippy: Deny integer arithmetic, add allows where needed (#3606) 2022-09-15 13:16:53 +02:00
hanako mumei 2acc42fd96 token-cli: display all extensions except confidential 2022-09-14 11:36:40 -07:00
hanako mumei f3f9995484 token-cli: impl display for interest and transfer fee 2022-09-14 11:36:40 -07:00
hanako mumei bdd0d4938a token-cli: impl display for half of extensions 2022-09-14 11:36:40 -07:00
hanako mumei b90903c990 token-cli: impl two extensions for display
also indent all the displys cutely
2022-09-14 11:36:40 -07:00
hanako mumei 6d61b8e3e4 token-cli: impl `spl-token display` for mint
also show decimals for accounts, because we can
2022-09-14 11:36:40 -07:00
hanako mumei 00b8e7a8b1 token-cli: modernize account-info, impl display 2022-09-14 11:36:40 -07:00
hanako mumei f8d1503acf token-cli: convert multisig display to UiMultisig 2022-09-14 11:36:40 -07:00
hanako mumei bdc3087533 token-cli: modernize multisig display 2022-09-14 11:36:40 -07:00
samkim-crypto 7633f6f81d
token-2022: Add support for non transferable and immutable ownership in token client (#3582)
* add token client support for non transferable mint

* resolve conflict

* add basic tests for non transferable token account

* add test for fees for non-transferable accounts

* resolve test failure from rebase
2022-09-14 17:37:09 +09:00
samkim-crypto 4587da1eab
confidential-extension: Restrict deposit source and withdraw dest to base accounts (#3540)
* resolve conflict

* update token client for new deposit syntax

* resolve conflict

* update tests

* address doc comments
2022-09-14 16:22:52 +09:00
Jordan Sexton d0277e65dd organize imports, lint 2022-09-12 18:39:51 -05:00
Jordan Sexton 48c0ede285 token js: patch version bump 2022-09-12 18:38:49 -05:00
Sammy Harris 6f4bdaa912
Update token-js with rent-less instructions (#3590)
* add new token instructions

* add decode helper function

* remove commented out thingy

* fix decode order

* update unit test

* add new unit tests
2022-09-12 17:52:53 -05:00
Jon Cinque 49a119b105
token-client: Add fmt::Display implementation to RpcClientResponse (#3594)
* token-client: Add Display to RpcClientResponse

* Handle crates defined as `{ version = "...", ... }
2022-09-12 22:09:55 +02:00
Jon Cinque 6bcd051d38
token-client: Change create_account to return T::Output (#3584) 2022-09-10 16:01:50 +02:00
hanako mumei 065a04788d token-cli: remove unnecessary program_id logic 2022-09-09 09:56:19 -07:00
hanako mumei 4dfd23e0b6 token-client: memo now explicitly declares signers 2022-09-07 18:17:54 -07:00
hanako mumei 8e6caf45ac token-cli: new config function get_account_checked
this replaces all instances of rpc_client.get_account -> check_owner
also we convert from rpc_client to program_client to further enforce offlineness
2022-09-07 14:36:39 -07:00
hanako mumei d2c33e26a4 token-cli: infer program_id based on cli args 2022-09-07 14:36:39 -07:00
hanako mumei 191977e2c6 token-cli: normalize argument names/descriptions
we now strictly adhere to the pattern:
* positional arg named `token`: a mint, described `TOKEN_MINT_ADDRESS`
* positional arg named `account`: an account, described `TOKEN_ACCOUNT_ADDRESS`
* positional arg named `address`: a mint or account, described `TOKEN_ADDRESS`, or a multisig, described `MULTISIG_ACCOUNT_ADDRESS`
* `--address` flag, named `address`: an account, described `TOKEN_ACCOUNT_ADDRESS`

normalize burn, unwrap, and supply to follow this convention
2022-09-07 14:36:39 -07:00
samkim-crypto fb0e6572a7
token-2022: add calculate post and pre fee amounts (#3570)
* add calculate post and pre fee amounts

* fix typo

* Update token/program-2022/src/extension/transfer_fee/mod.rs

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

* provide more info on ceiling division

* update tests

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-09-07 21:08:12 +09:00
samkim-crypto 30870c96e8
confidential-extension: forbid confidential transfer if nontransferable mint (#3542)
* forbid confidential transfer if nontransferable mint

* add a note about nontransferable mint in the transfer instruction

* disable deposit and withdraw if mint nontransferable
2022-09-07 09:40:28 +09:00
hanako mumei b9cab85d81 token-cli: final cleanups on client refactor
use mint for Token objects whenever possible, rework multisig_signers to be prettier
2022-08-31 13:57:41 -07:00
hanako mumei 5e494c63e0 token-cli: promote fee_payer to Arc<dyn Signer> 2022-08-31 13:57:41 -07:00
hanako mumei cf25381108 token-cli: use token client for approve 2022-08-31 13:57:41 -07:00
hanako mumei b91972debb token-cli: use token client for freeze/thaw/revoke 2022-08-31 13:57:41 -07:00
hanako mumei 46206fe64c token-cli: support memo on command_mint 2022-08-31 13:57:41 -07:00
hanako mumei db4a950ca8 token-client: convert freeze/thaw interface 2022-08-31 13:57:41 -07:00
hanako mumei 1fb05454e7 token-client: convert approve/revoke interface 2022-08-31 13:57:41 -07:00
hanako mumei b30aac80a6 token-client: convert transfer interface 2022-08-31 13:57:41 -07:00
hanako mumei 8e196e5e77 token-cli: use token client for command_burn 2022-08-31 13:57:41 -07:00
hanako mumei e540b172db token-cli: use token client for command_mint
* client: change mint_to to accept decimals and prefer mint_checked
* client: move multisig key winnowing into utility function
2022-08-31 13:57:41 -07:00
hanako mumei 8d1e57018a token-cli: finish interest bearing mint
minor cleanups, guards on set-interest-rate, impl set-authority for interest-bearing mints
2022-08-30 21:12:59 -07:00
Udbhav Muthakana fbae99fe2c token-cli: Support the InterestBearingMint extension 2022-08-30 21:12:59 -07:00
Jon Cinque 422544b906
ci: Re-enable twotx job (#3553)
* ci: Re-enable twotx job

* Remake patch file
2022-08-31 01:41:05 +02:00
Jon Cinque b6259b3a51
token-2022: Add inverse fee calculation (#3524)
* token-2022: Add inverse fee calculation

* Rename functions
2022-08-30 17:56:34 +02:00
Jon Cinque ffbab71d49
token-2022: Use updated generic types for Token client in confidentials (#3546) 2022-08-29 23:27:29 +02:00
Andrii Tretyakov d65ab18fbd
token-cli: Removed usage of Account::LEN as a verificaton for token account (#3527)
replaced with Account::valid_account_data to support token2022
2022-08-29 12:42:33 -07:00
Jordan Sexton a578fc8159
add eslint-plugin-require-extensions (#3543) 2022-08-28 20:38:11 -05:00
hanako mumei 84c566b13e bump token-cli to 2.0.17
release has already been made and lives in the `token-cli-v2.0.17-branch` branch
2022-08-25 17:54:38 -07:00
hanako mumei 9382641da2 token-cli: remove #[allow(deprecated)] from toplevel
also remove ArcSigners temp code
2022-08-25 09:53:29 -07:00
Jordan Sexton d2b15ddc91 update spl-memo dependency 2022-08-24 19:04:27 -05:00
Jordan Sexton 65f5b102e8
spl-token: fix CJS imports (#3529)
* token-js: patch version bump

* add CJS package.json; fixes #3522

* alpha version bump

* remove alpha version

* add same postbuild step to memo js

* fix lockfiles
2022-08-24 19:01:19 -05:00
Athar Mohammad 2fe0ce60f8
[token-js] : Support for UiAmountToAmount and AmountToUiAmount instructions (#3345)
* suport for amountToUiAmount instruction

* support for uiamount to amount instruction

* upgrade @solana/web3.js to 1.47.4

* move amount.test from e2e-2022 to e2e

* fix and sort imports

Co-authored-by: Jordan Sexton <jordan@jordansexton.com>
2022-08-24 01:54:16 -05:00
hana e03a013184
token-cli: support `MintCloseAuthority` (#3487)
* cli: add --enable-close flag to create-token which sets its close authority to mint authority
* cli: add support to changing a mint close authority to authorize
* cli: add close-mint, a new command for closing a mint
* cli: update authorize and close-account to go through the token client
* client: change set_authority and close_account to support multisigners
2022-08-23 15:54:10 -07:00
Jordan Sexton 29d316e811
Fix Token program ESM exports (#3508)
* Fix Memo program ESM exports

* fix repository link

* Fix Token program ESM exports

* web3.js is a peer dependency

* memo/ts -> memo/js (same as token)

* add gh-pages dev dep

* add explicit js extensions

* use explicit js imports

* lint fixes for type imports

* fix version

* check in package-lock.json

* check in package-lock.json

* update spl-memo dep

* reorg imports

* move spl-memo to dev deps

* remove editorconfig

* update spl-memo

* update node version in CI

* memo and token use npm now

* use npm ci commands

* reorder imports
2022-08-22 19:07:03 -05:00
hanako mumei e06506b40b token-cli: dont push duplicates to bulk_signers 2022-08-22 16:28:43 -07:00
hanako mumei c426ed9749 Refactor create-token to go through token client
* cli: remove offline args from commands that create accounts
* cli: implement finish_tx, to be a replacement for handle_tx, which branches on the client return
* client: validate a transaction is fully signed before sending over rpc
* client: convert payer from Signer to Arc<dyn Signer> to support cli signers
* client: support nonce mode
* client: change create_mint to be an object method that returns SendTransaction::Output
* client: rename S2 to S everywhere that Token<T, S> is Token<T>
2022-08-18 17:35:55 -07:00
hana 65769ce23d
Update rust to 1.60, solana to 1.11.6 (#3492)
also change bpf to sbf throughout the codebase

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-08-18 12:16:02 -07:00
Jon Cinque 6e125f88a9
token[-2022]: Change `target_arch` to `target_os` (#3493) 2022-08-18 13:38:10 +02:00
Jordan Sexton d6297495ea
token/js - make unpack functions consistent (#3486)
* make argument order and comments consistent for unpack functions

* add function to unpack multisig for parity

* update spl-memo version

* patch version bump

* run prettier

* fix comment

* update lockfile
2022-08-16 16:20:54 -05:00
Tyera Eulberg 3c54aecfe9
Bump solana to v1.10.35 (#3485) 2022-08-16 12:33:24 -06:00
Tyera Eulberg 5d03efbabe
Bump token-2022 to 0.4.3 (#3480) 2022-08-15 22:08:32 -06:00
Jon Cinque d611db6a01
docs: Add token-2022 extension docs and JS examples (#3457)
* token-js: Add examples for all extensions

* docs: Add token-2022 extensions guide for JS

* Address feedback

* Fix extension
2022-08-16 01:07:21 +02:00
hanako mumei 2ea6dfa1de token-cli: let clients return signature or txn 2022-08-15 16:06:50 -07:00
hanako mumei c5caba0d63 token-cli: use program_client for blockhash 2022-08-15 16:06:50 -07:00
Jon Cinque 3d42786e6e token-cli: Add no-op client 2022-08-15 16:06:50 -07:00
Pierre 730b628c57
token-js: expose unpack methods (#3471)
* feat: expose unpack methods

* default program id

Co-authored-by: Arrowana <8245419+Arrowana@users.noreply.github.com>
2022-08-15 15:30:51 +02:00
Jon Cinque 1970356887
token-js: Version bump to 0.3.0 (#3448)
* token-js: Bump version 0.3.0 for release

* Improve README with support info
2022-08-09 18:54:46 +02:00
Jon Cinque 6b5e7cbbeb
token-js: Add reallocate instruction implementation (#3447) 2022-08-09 17:26:31 +02:00
Justin Malčić cc2739fce1
token-cli: Clone signers (#3290)
* Switch to Arc

* Add temporary structs

To be removed upon upstream changes

* Get multisig signers earlier

* Build SignerFromPathConfig with multisig pubkeys

* Get default signer and address

* Store default signer and address

* Use stored default address

* Use stored default signer

* Avoid rereading signer for fee payer

* Clean up use statements

* Rename to ArcSigner

* Remove default_keypair

* Remove default_address

* Add comment for temporary newtype

* Refactor config

* Create config from args in tests

* Remove unused params

* Fix clippy warnings

* Fix rustfmt warnings

* Fix clippy warnings

* Move imports
2022-08-08 23:40:08 +02:00
Tyera Eulberg 7c6235d9e7
Bump token to v3.5.0 and ata to v1.1.1 (#3430) 2022-08-04 01:09:38 -06:00
Tyera Eulberg 4a56a4b840
Prep for spl-token v3.5.0 (#3426)
* check that unpack is tolerant of small sizes (#3416)

* Refactor unpack and make test more robust (#3417)

* Refactor hasty fix to match token-2022

* Make test exhaustive

* cargo fmt

Co-authored-by: Michael Vines <mvines@gmail.com>

* Readd proptests without losing unit test, #3421

Co-authored-by: anatoly yakovenko <anatoly@solana.com>
Co-authored-by: Michael Vines <mvines@gmail.com>
2022-08-04 00:25:07 -06:00
Jon Cinque f5ce86d43d
token/ata: Bump versions to 3.4.0 and 1.1.0, respectively (#3427) 2022-08-04 01:03:04 +02:00
hana abc63ad946
token-cli: don't error when missing default config (#3424) 2022-08-03 14:58:24 -07:00
Jon Cinque 4fadd553e1
token: Reassign and reallocate accounts on close (#3415)
* token: Reassign and reallocate accounts on close

* Revert "Refactor unpack and make test more robust (#3417)"

This reverts commit c618de374e.

* Revert "check that unpack is tolerant of small sizes (#3416)"

This reverts commit 22faa05f18.

* Also revert d7f352bd78
2022-08-03 23:49:36 +02:00
Jon Cinque 93ec6cf74a
token-cli: Split out CI into separate step, run tests in serial (#3425)
* token-cli: Split out CI into separate step, run tests in serial

* Remove dependency on cargo-test-bpf to speed things up

* Don't download programs since they won't be available
2022-08-03 21:54:35 +02:00
Jon Cinque d7f352bd78
token[-2022]: Add proptest for unpacking (#3421) 2022-08-03 20:01:08 +02:00
Jon Cinque 4aa529d194
ci: Separate twoxtx build step, match Rust version (#3422)
* ci: Separate twoxtx build step, match Rust version

* Make a change to trigger CI

* Really trigger CI this time

* Fixup yaml issue

* Also set RUST_STABLE_VERSION

* Define env variable earlier
2022-08-03 19:53:35 +02:00
Tyera Eulberg c618de374e
Refactor unpack and make test more robust (#3417)
* Refactor hasty fix to match token-2022

* Make test exhaustive

* cargo fmt

Co-authored-by: Michael Vines <mvines@gmail.com>
2022-08-03 01:44:55 -06:00
Tyera Eulberg e0ff9add17
Bump spl-token (#3418) 2022-08-03 01:24:38 -06:00
anatoly yakovenko 22faa05f18
check that unpack is tolerant of small sizes (#3416) 2022-08-02 23:11:13 -06:00
samkim-crypto c98609850f
token-2022: merge instruction data for confidential Transfer and TransferWithFee (#3410) 2022-08-03 12:15:31 +09:00
Jon Cinque 8f74ba517c
token-cli: Run fewer tests at once (#3414) 2022-08-03 01:14:55 +02:00
Jon Cinque 674b0ac70e
token-cli: Add token-client dependency for token-2022 support (#3386) 2022-08-01 17:13:42 +02:00
Jon Cinque 80b8ff3b1d
token-cli: Run tests in batches (#3396) 2022-07-30 00:34:49 +02:00
Tyera Eulberg c21b4ae24a
Bump spl-token-2022 to 0.4.2 (#3390) 2022-07-27 12:25:11 -06:00
Tyera Eulberg c00194d225
Bump solana crates to v1.10.33 (#3385) 2022-07-27 11:28:14 -06:00
Jon Cinque 48e6acb53f
token-cli: Support base token-2022 (without extensions) (#3071) 2022-07-27 10:47:43 +02:00