Commit Graph

1094 Commits

Author SHA1 Message Date
omertxyz f30ad1d752
Add serde feature - token-2022 (#3291)
* Add serde to token-2022

* Add tests

* Fix feature syntax

* Formatting, enabling features

* Make CI work, and some naming nit cleanup

* Un-async tests

Co-authored-by: jon wong <j@jnwng.com>
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-07-07 13:18:47 -04:00
samkim-crypto 3afe1e652b
Derive elgamal key in token client (#3308)
* token-2022: derive elgamal key in token client

* token-2022: update program tests for key derivation

* token-2022: key derivation for apply pending balance

* token-2022: add configure account with max pending balance

* token-2022: update tests for apply pending balance

* token-2022: derive key for confidential trasfer with fee

* token-2022: update test for confidential transfer with fee

* token-2022: derive encryption keys for withdrawing withheld tokens

* token-2022: update tests
2022-07-04 15:47:33 +09:00
Jon Cinque 5874a14584
token-cli: Move cmd test into a separate file (#3306) 2022-07-01 19:41:27 -04:00
Jon Cinque c1ee6a58be
Update Solana crates to 1.10.29 (#3303) 2022-07-01 16:51:01 -04:00
Jon Cinque c4f10d8d53
token-js: Throw if using token-2022 instructions with tokenkeg (#3296)
* token-js: Throw if using token-2022 instructions with tokenkeg

* Fixup updated params
2022-06-29 13:39:30 -04:00
Kunal Desai 7caf27cca6
Support interest bearing mint in token-js (#3266)
* Support interest bearing mint in token-js

* pr feedback

* Add tests + actions.ts

* Update docs

* pr feedback
2022-06-27 18:50:05 -04:00
samkim-crypto 57c5fd80f6
token-2022: check destination accounts on confidential token tests (#3281)
* token-2022: check destination accounts on confidential token tests

* token-2022: cargo clippy
2022-06-21 23:59:26 +09:00
samkim-crypto c3137af9df
token-2022: add tests for withdraw of confidential withheld tokens from accounts (#3280)
* token-2022: add tests for withdraw of confidential withheld tokens from accounts

* token-2022: cargo fmt

* token-2022: cargo clippy
2022-06-21 22:02:15 +09:00
samkim-crypto 0f316fb357
bump solana to v1.10.26 (#3274) 2022-06-20 09:55:49 +09:00
Jon Cinque e44d174f63
token-js: Clarify how to run tests (#3269) 2022-06-17 19:32:25 -04:00
Athar Mohammad 351cd60a5e
spl-token: Enums for Cli command names (#2598) (#3236)
* Added Enums which can be turned into strings
  for command names.
2022-06-17 16:56:03 -04:00
Jon Cinque 056948bbd1
token-js: Add memo transfer support (#3257) 2022-06-16 11:32:28 -04:00
Jon Cinque 5c478568c6
token-js: Support non-transferable mint (#3256) 2022-06-16 09:40:29 -04:00
Jon Cinque b461406e97
token-js: Add default account state support (#3255) 2022-06-16 09:40:11 -04:00
Jon Cinque 79d2c606b8
CI: Add `--max-warnings 0` to eslint to abort on errors (#3254)
* CI: Add `--max-warnings 0` to eslint to abort on errors

* Fix lint issue
2022-06-16 09:39:55 -04:00
Jon Cinque 27014732dd
token-2022: Bump version for next release (#3239) 2022-06-10 22:38:33 +02:00
Ronald Hood Jr 5493842399
token-js: Bindings For Transfer Fee Extension IXs (#3102)
* JS Bindings For Transfer Fee Extensions IXs

* Add tests and actions

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-06-10 01:31:57 +02:00
Kunal Desai ad97543192
Support InitializeAccount3 in token js (#3233) 2022-06-09 13:57:01 +02:00
Kunal Desai 6096ac6f46
Support InitializeAccount2 instruction (#3229)
* Support InitializeAccount2 instruction

* Add unit test
2022-06-08 22:29:49 +02:00
dboures 3e9104736a
token-cli: produce error if invalid --config option (#3166)
* token-cli: produce error if invalid --config option

* token-cli: add test for invalid --config
2022-06-08 14:48:55 +02:00
samkim-crypto 677acf173d
token-2022: limit incoming transfers for confidential transfer extension (#3208)
* token-2022: limit incoming transfers for confidential transfer extension

* token-2022: add maximum pending counter for confidential extension in client

* token-2022: update tests for ct configure account

* token-2022: cargo fmt

* divide pending balance into lo and hi

* token-2022: update ct processor for lo and hi pending balances

* token-2022: limit confidential transfer deposit and transfer amount in token client

* token_2022: rename TokenError::IllegalAmount

* token-2022: compare max pending credit as u64

* token-2022: fmt

* token-2022: minor fix error from rebase

* Update token/program-2022/src/extension/confidential_transfer/processor.rs

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

* token-2022: update configure account initialization comments

* token-2022: use strict comparison for max pending balance credit counter check

* token-2022: update deposit tests to check `pending_balance_hi` populated

* token-2022: update deposit tests to check that deposit and transfer fails when max pending exceeded

* token-2022: reset pending balance counter on `ApplyPendingBalance`

* token-2022: fix cargo test cases for credit counter

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2022-06-07 23:16:46 +09:00
samkim-crypto c2a3ecd970
token-2022: prevent an already configured confidential account to be configured again (#3216)
* token-2022: prevent an already configured confidential account to be configured again

* token-2022: add overwrite flag to init extension

* token-2022: clippy

* token-2022: update initialize mint for interest bearing mint

* token-2022: confidential transfer mint init allow overwrite
2022-06-07 09:42:23 +09:00
Jon Cinque f7abf4a6bc
token-2022: Remove `reallocate` and `sibling-instruction` features (#3213) 2022-06-01 16:46:41 +02:00
Jon Cinque 773e2ee469
token-2022: Add interest-bearing extension (#3013)
* token-2022: Add interest-bearing extension

* Rename / comment feedback

* Rename interest-bearing -> interest-bearing mint
2022-06-01 16:46:30 +02:00
samkim-crypto 424c900345
bump solana to v1.10.19 (#3195)
* bump solana to v1.10.19

* update solana-version.sh
2022-05-25 08:40:30 +09:00
samkim-crypto 2ad468f8b7
Fix confidential self transfer with fees (#3193)
* token-2022: fix confidential self-transfers with fee

* token-2022: update tests for confidential self-transfer with fees
2022-05-24 19:19:19 +09:00
beeman 3af176d6c4
token-js: move start-server-and-test dep to devDependencies (#3186) 2022-05-20 14:19:04 +02:00
samkim-crypto b2077609d9
token-2022: add tests for confidential transfer withdraw withheld tokens from mint (#3181) 2022-05-19 11:12:00 +09:00
Michael Vines f1c693d067
token-2022: Add support for Non-Transferable Tokens (NTTs) - NonTransferableMint extension (#3178)
Co-authored-by: Juan Oxoby <me@jmoxo.by>
2022-05-17 16:16:13 -07:00
Dmitri Makarov 791cc8a776
Use target_os instead of target_arch for Solana conditional compilation (#3148) 2022-05-17 12:25:24 -07:00
Dmitri Makarov f1c1d440e9
Bump solana to v1.10.15 (#3176) 2022-05-17 11:27:30 -07:00
dboures 49c53ad653
token-js: Add sync version of getAssociatedTokenAddress (#3171)
* token-js: Bump web3.js dependency to 1.41.0

* token-js: Add sync version of getAssociatedTokenAddress

* token-js: add test for getAssociatedTokenAddressSync

* Update lockfile

Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
2022-05-17 00:30:31 +02:00
samkim-crypto 9e029349fc
Rename encryption pubkey (#3147)
* token-2022: change elgamal pubkey to encryption pubkey

* token-2022: update client and tests for  elgamal pubkey to encryption pubkey
2022-05-08 12:51:18 +09:00
samkim-crypto b6eb64b0b4
token-2022: check pending and available balance on confidential token tests (#3145)
* token-2022: check pending and available balance on confidential token tests

* token-2022: cargo fmt
2022-05-07 15:00:58 +09:00
samkim-crypto bcf7aa2d6e
token-2022: client for confidential withdraw withheld tokens (#3134) 2022-05-06 15:52:43 +09:00
Tyera Eulberg 731a1363b1
Token client improvements (#3139)
* Use-stmt cleanup

* Use nonblocking RpcClient

* Arc-wrap RpcClient

* Confirm tx when using RpcClient

* Bump version for releasing
2022-05-04 18:11:11 -06:00
Tyera Eulberg d087b574e6
Accommodate upstream web3.js changes in twotx patch (#3140) 2022-05-04 17:32:51 -06:00
Jon Cinque e59a0dc186
token-2022: Set transfer fee two epochs ahead (#3120) 2022-04-27 17:48:08 +02:00
Tyera Eulberg 51ece68cec
Add feature-wrapping for new ConfidentialTransferInstruction::TransferWithFee (#3116) 2022-04-26 13:15:09 -06:00
Tyera Eulberg b3fe5b6d5d
Bump token-2022 (#3113)
* Bump token-2022

* Bump solana dependencies
2022-04-26 12:15:26 -06:00
Tyera Eulberg 2c1a671a77
Make spl-token-2022 instruction decoders pub (#3112)
* Make instruction decoders pub

* Add missing doc
2022-04-26 07:56:08 -06:00
Tyera Eulberg 2491b29a1e
Add AuthorityType variant to use for mint close-authority adjustment (#3111) 2022-04-26 07:55:15 -06:00
Jon Cinque c616db83c4
token-2022: Add compatibility test for instructions (#3106) 2022-04-22 23:55:18 +02:00
samkim-crypto 049a89f351
token-2022: Add confidential transfer with fee instruction (#2988)
* token-2022: add separate transfer with fee instruction

* token-2022: add `TransferWithFee` client code

* apply twoxtx patch

* token-2022: add brief tests for transfer with fee

* Revert "apply twoxtx patch"

This reverts commit ce09d1f5d2fb496cd4ee9991be234726786e39f2.

* token-2022: cargo fmt

* token-2022: uncommenting the rest of the tests

* token-2022: cargo fmt

* token-2022: temporarily reverting to 5f89521

* token-2022: minor

* token-2022: clippy

* token-2022: apply twoxtx patch

* token-2022: fix transfer with fee test

* Revert "token-2022: apply twoxtx patch"

This reverts commit 577e63c2f38ce0a17fa4aede3d0acfd852b1d3ab.

* token-2022: simplify fee parameter for zkp on client

* token-2022: fix build
2022-04-22 14:00:42 -04:00
Harsh Ghodkar f7d4ebecc6
added a flag to check if the recipient address is correct (#3085)
* added a flag to check if the recipient address is correct

* small fix

* Made the changes of adding the check to a suggested block

* updating from base

* was able to clear merge conflicts

* added a couple tests

* better names for tests

* done with fixes

* cargo fmt
2022-04-21 21:53:30 +02:00
Ronald Hood Jr ae2e000434
InitializeImmutableOwner Instruction (#3068)
* initializeImmutableOwner Instruction

* Immutable Owner Testing

* immutable owner tests

* Creating Mint and Initializing Account

* Parameter Synchronization

* Documentation Update

Co-authored-by: Ronald Hood <ronald.hood@yale.edu>
2022-04-21 20:43:56 +02:00
samkim-crypto 76f0532d83
token-2022: fix confidential transfer tests (#3096)
* token-2022: update zk-token-sdk to 1.10.8

* token-2022: remove ignore tag for confidential tranfer test
2022-04-21 12:21:21 -04:00
Jon Cinque bbde6d8703
token-cli: Add tests for all cases from docs (#3070)
* token-cli: Add tests for all cases from docs

* Add TestValidator and build.rs for programs

* Fix solana-test-validator version

* Add solana-test-validator to patch script
2022-04-15 21:51:16 +02:00
Jon Cinque 1d1c2b178b
Upgrade crates to 1.10.8 (#3076) 2022-04-11 22:25:27 +02:00
Jon Cinque 513c1143a2
token-cli-bench: Remove RPC utils in favor of Tpu Client (#3046) 2022-04-01 13:41:33 +02:00