Commit Graph

277 Commits

Author SHA1 Message Date
Tyera Eulberg 1fcc84beb3
Allow source account to be its own owner in Transfer and Transfer2 (#433)
* Add failing test

* Add Transfer2 to failing test

* Add source-delegate to failing test

* No need to hold source RefMut in process_transfer

* Fixup comments

* Add destination-owner test case

* Add source-multisig test case
2020-09-11 18:56:42 +00:00
Jack May 72c59056e5
Fix spelling (#430) 2020-09-11 09:32:49 -07:00
dependabot[bot] 330bf3f98f
Bump eslint from 7.7.0 to 7.8.1 in /token/js (#425)
Bumps [eslint](https://github.com/eslint/eslint) from 7.7.0 to 7.8.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.7.0...v7.8.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-11 08:40:12 +00:00
dependabot[bot] b967728073
Bump rollup from 2.26.5 to 2.26.11 in /token/js (#424)
Bumps [rollup](https://github.com/rollup/rollup) from 2.26.5 to 2.26.11.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.26.5...v2.26.11)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-11 08:40:05 +00:00
dependabot[bot] 793930c835
Bump prettier from 2.0.5 to 2.1.1 in /token/js (#322)
Bumps [prettier](https://github.com/prettier/prettier) from 2.0.5 to 2.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.0.5...2.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-10 23:18:33 +00:00
Tyera Eulberg a8df113101
Add token/program2 for next changeset (#412)
* Add token/program2 for next changeset

* Use version number instead of index
2020-09-10 16:04:50 -06:00
Tyera Eulberg 20d8685249
Rebase on solana-web3 bump (#421)
* Rebase on solana-web3 v0.75.0

* Doc cleanup
2020-09-10 21:20:23 +00:00
Daniel Kelleher ac3004b3c7
Wrapped SOL support (#416)
* Add support for wrapped native token account generation in the Token JS client.

* Some small changes to the token test script as per review comments
2020-09-10 13:16:24 -06:00
dependabot[bot] 55c8ae85e0
Bump node-fetch from 2.6.0 to 2.6.1 in /token/js (#418)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-10 18:54:01 +00:00
Jon Cinque f5e0d793a9
token-swap: Swap instruction fix and update libs for CI (#408)
* token-swap: Fix swap instruction

* Update SDK libs and fix outstanding issues

* Run lint in token/js

* Disable CI token-swap js tests

* Update code for web3.js 0.75.0

* Update output -> destination verbiage for clarity / consistency
2020-09-10 20:16:50 +02:00
Tyera Eulberg 7141298b2f
Flesh out @solana/spl-token with token2 instructions (#410)
* Fix token-js docs

* Add Freeze/Thaw instructions

* Add v2 instructions

* Add new instructions to js test

* Bump @solana/spl-token to v0.0.8

* Fix didThrow and remove invalidApprove
2020-09-10 17:17:45 +00:00
Justin Starry 708bb430ab
Bump dependencies from 1.3.8 to 1.3.9 (#415) 2020-09-10 17:25:43 +08:00
Greg Fitzgerald 0ca4a61e4d
Javascript -> JavaScript (#409) 2020-09-09 17:57:30 -06:00
Trent Nelson 72fc795f90 Bump SPL Token CLI version to 2.0.1 2020-09-09 17:14:13 +00:00
Daniel Kelleher b8066f2e08
Fix for token ts declarations - import the correct Account object (#400) 2020-09-09 09:35:38 -06:00
dependabot[bot] f842f276e5
Bump solana-cli-config from 1.3.8 to 1.3.9 (#402)
Bumps [solana-cli-config](https://github.com/solana-labs/solana) from 1.3.8 to 1.3.9.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.8...v1.3.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-09 08:45:25 +00:00
dependabot[bot] 5bb0a04960
Bump solana-logger from 1.3.8 to 1.3.9 (#403)
Bumps [solana-logger](https://github.com/solana-labs/solana) from 1.3.8 to 1.3.9.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.8...v1.3.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-09 08:45:19 +00:00
Trent Nelson 9eb10d9144 Unrelated clippy... 2020-09-04 01:18:44 -06:00
Trent Nelson e00a6f1add Bump Token version to 2.0.4 2020-09-04 01:18:44 -06:00
Trent Nelson b15eb09cfb Bump solana crates to 1.3.8 2020-09-04 01:18:44 -06:00
Jack May 0637e358bc
Add back token perf monitor (#380) 2020-09-01 17:27:11 -07:00
Trent Nelson 5f425e5a3e
Token CLI: Use Token2 instructions (#375) 2020-09-01 14:29:12 -06:00
Trent Nelson b011698251 Token CLI: Support arbitrary signers
eg. Ledger
2020-09-01 17:47:55 +00:00
Justin Starry 8e1bff0a72
Fix token-js CI tests (#371) 2020-08-30 14:31:58 +08:00
Michael Vines 1247e539a7 Fix up doc quotes 2020-08-29 21:59:35 -07:00
Michael Vines 9e23bc94cb Update to Solana 1.3.6 2020-08-29 22:12:00 +00:00
Michael Vines 858dd64f6b Update to solana 1.3.6 2020-08-29 14:37:10 -07:00
Michael Vines eb1f41c4b6 Adapt to LEN 2020-08-29 14:37:10 -07:00
Michael Vines 51b3465b17 Bump spl-token-cli version 2020-08-29 08:41:25 -07:00
Justin Starry f9c3dd1f67 Bump @solana/spl-token to v0.0.7 2020-08-29 17:04:59 +08:00
Justin Starry 05cc84ea64
Remove extra account padding (#363) 2020-08-29 17:03:24 +08:00
Justin Starry cbba9b3d6c
Fix isInitialized when account is frozen (#362) 2020-08-29 16:44:57 +08:00
Tyera Eulberg 510d34198b
Bump token program id, version (#361) 2020-08-29 02:44:03 -06:00
Michael Vines 0c8981731b Bump version 2020-08-28 16:25:59 -07:00
Jack May 7b5eb2a2a5
Fix account size comparisons (#359) 2020-08-28 23:21:57 +00:00
Justin Starry 3691b14a01 Update token js bindings 2020-08-28 16:02:32 -07:00
Tyera Eulberg d11dbba955
Bump version (#357) 2020-08-28 19:34:29 +00:00
Jack May 815cca3cb8
Don't repack if not needed (#355) 2020-08-28 12:03:10 -07:00
Jack May 64a9e151e0
Remove last unsafes (#354) 2020-08-28 12:12:12 -06:00
Tyera Eulberg b4a3674437
s/AccountHolder/AccountOwner (#356) 2020-08-28 12:11:57 -06:00
Greg Fitzgerald 6761f440ab
Token nits (#353) 2020-08-28 10:12:05 -06:00
Michael Vines 81ac32e3be Update token.h 2020-08-27 23:32:07 -07:00
Michael Vines 0a47a3127c Move c header generation out of build.rs 2020-08-27 23:32:07 -07:00
Tyera Eulberg 13a279c0b4
Bump spl-token to v2 (#352) 2020-08-28 00:29:55 -06:00
Michael Vines 68660c8011 Fix various quotes in documentation 2020-08-27 22:41:34 -07:00
Jack May 2a5acff2d8
Safer pack/unpack (#349)
* Safer pack/unpack

* fix cli

* clippy

* fix swap

* nit

* clippy

Co-authored-by: Michael Vines <mvines@gmail.com>
2020-08-27 21:19:15 -07:00
Tyera Eulberg 74bf8a1f58
New spl-token v1.1 program id (#348) 2020-08-27 19:41:14 -06:00
Michael Vines 18a380cb50 Update token.h 2020-08-28 00:47:35 +00:00
Michael Vines 12f941d7fc Adjust native mint 2020-08-28 00:47:35 +00:00
Michael Vines b60eb8fbee Add Transfer2/Approve2/MintTo2/Burn2 instructions for improved hardware wallet support 2020-08-28 00:47:35 +00:00
Tyera Eulberg 2e6162abbd C headers doc 2020-08-27 16:17:38 -07:00
Tyera Eulberg b2b20444e5 Require valid Mint for InitializeAccount 2020-08-27 16:17:38 -07:00
Tyera Eulberg 0b71752d45
Use checked math everywhere (#346) 2020-08-27 14:31:59 -06:00
Tyera Eulberg 49e6e4a589
Reinstate Mint supply (#342)
* Reinstate Mint supply, and adjust with Minto & Burn

* C headers

* Patch token-cli

* Patch token-swap
2020-08-27 13:06:23 -06:00
Tyera Eulberg fec5717d2a More C headers 2020-08-27 09:40:31 -07:00
Tyera Eulberg 8d0ba35407 Combine Account is_native and rent_exempt_reserve fields; wrapped SOL amount reflects only amoutn over rent_exempt_reserve 2020-08-27 09:40:31 -07:00
Tyera Eulberg 181cdfa170 C headers 2020-08-27 09:40:31 -07:00
Tyera Eulberg 2e5056f70d Add Account.rent_exempt_reserve 2020-08-27 09:40:31 -07:00
Tyera Eulberg a5c1bb470d Pass rent_sysvar into init Instructions and check rent-exempt 2020-08-27 09:40:31 -07:00
Michael Vines b58677f554 Bump some crate versions 2020-08-27 09:39:35 -07:00
dependabot[bot] 4893198a68 Bump solana-account-decoder from 1.3.2 to 1.3.4
Bumps [solana-account-decoder](https://github.com/solana-labs/solana) from 1.3.2 to 1.3.4.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.2...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-27 09:38:45 -07:00
Michael Vines 81d18e590d InitializeMint's mint authority is no longer optional 2020-08-26 23:43:45 -07:00
Michael Vines b62c2721fa Update token.h 2020-08-26 23:10:18 -07:00
Michael Vines 68db5f77a0 Port cli to token2 2020-08-26 23:10:18 -07:00
Michael Vines 2815165c14 Relocate program2 into program 2020-08-26 23:10:18 -07:00
Michael Vines 20b6ee04a3 Remove token 1.0 2020-08-26 23:10:18 -07:00
Tyera Eulberg ea52428475
token: Simplify initialize_mint (#327)
* Simplify initialize_mint

* C headers
2020-08-27 00:27:44 +00:00
dependabot[bot] 025a605a59
Bump @babel/core from 7.11.1 to 7.11.4 in /token/js (#317)
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.11.1 to 7.11.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.11.4/packages/babel-core)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-26 08:33:10 +00:00
dependabot[bot] b0cebcf4bb
Bump solana-clap-utils from 1.3.2 to 1.3.4 (#318)
Bumps [solana-clap-utils](https://github.com/solana-labs/solana) from 1.3.2 to 1.3.4.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.2...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-26 08:33:05 +00:00
Tyera Eulberg e91725a8b3
token: Add close_authority and re-enable CloseAccount for non-native Accounts (#314)
* Add close_authority and re-enable CloseAccount for non-native Accounts

* C headers
2020-08-25 21:36:35 -06:00
Tyera Eulberg c00adbe3a7
Add capability to freeze token Accounts (#297)
* Add freeze elements to state structs

* Add can_freeze paramter to InitializeMint instruction, and plumb

* Add fixed_supply parameter to InitializeMint

* Convert to SetAuthority instruction

* Add frozen restrictions

* Add FreezeAccount instruction

* Make FreezeAccount into toggle

* Add parameter to make freezing explicit

* Pass mint owner, freeze_authority as parameters

* Rename ToggleFreeze

* Make AuthorityType more explicit

* Rename mint owner => mint_authority

* Add Account::is_frozen method

* C header updates

* s/is_initialized/state for Account

* Minting nit

* Add helpers to clean up AuthorityType packing

* Split FreezeAccount into 2 instructions

* Pass new_authority as parameter not account

* More C header updates

* Use new COption helpers

* Use boolean for toggle fn
2020-08-25 14:24:11 -06:00
dependabot[bot] 40b43f3ebe
Bump solana-cli-config from 1.3.2 to 1.3.4 (#292)
Bumps [solana-cli-config](https://github.com/solana-labs/solana) from 1.3.2 to 1.3.4.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.2...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-25 16:37:47 +00:00
dependabot[bot] 9776d42329 Bump eslint from 7.6.0 to 7.7.0 in /token/js
Bumps [eslint](https://github.com/eslint/eslint) from 7.6.0 to 7.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.6.0...v7.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-25 09:05:55 -07:00
dependabot[bot] 036cca36b6 Bump solana-sdk from 1.3.2 to 1.3.4
Bumps [solana-sdk](https://github.com/solana-labs/solana) from 1.3.2 to 1.3.4.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.2...v1.3.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-08-25 09:05:29 -07:00
Jack May 9df7b22087
Fix overflow when amounts are u64::MAX (#310) 2020-08-25 08:48:26 -07:00
Tyera Eulberg 27d1e52a60
Add COption helpers (#311)
* Add COption conversion methods

* Add COption pack/unpack
2020-08-25 09:31:01 -06:00
dependabot[bot] 428d5dcf11
Bump bn.js from 5.1.2 to 5.1.3 in /token/js (#312)
Bumps [bn.js](https://github.com/indutny/bn.js) from 5.1.2 to 5.1.3.
- [Release notes](https://github.com/indutny/bn.js/releases)
- [Changelog](https://github.com/indutny/bn.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/indutny/bn.js/compare/v5.1.2...v5.1.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-25 08:31:29 +00:00
Jack May 65aeff5b0b
Use deprecated bpf loader (#307)
* Use deprecated bpf loader

* bump web3.js to pick up fixed flow defs
2020-08-24 14:19:46 -07:00
dependabot[bot] b1bd204fbe
Bump rollup from 2.25.0 to 2.26.5 in /token/js (#304)
Bumps [rollup](https://github.com/rollup/rollup) from 2.25.0 to 2.26.5.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.25.0...v2.26.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-24 08:31:53 +00:00
Michael Vines 62cb0e2dd9 Remove duplicate 2020-08-20 17:47:49 -07:00
Michael Vines c64f29e0d8 Update version 2020-08-20 13:41:27 -07:00
Michael Vines b619da32ae Bump version to 1.0.8 2020-08-14 18:08:46 -07:00
Michael Vines db6f414589 Back out 'Add support for self transfers (#210)' 2020-08-14 22:50:18 +00:00
Michael Vines e440466311 Add token program2 2020-08-14 22:50:18 +00:00
dependabot[bot] c12b04aaaa
Bump @solana/web3.js from 0.68.0 to 0.71.1 in /token/js (#279)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 0.68.0 to 0.71.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v0.68.0...v0.71.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-14 22:28:33 +00:00
Michael Vines 480c88ceaf Exclude DECIMALS 2020-08-14 17:57:46 +00:00
Michael Vines e345b1cb17 Remove extra whitespace 2020-08-14 17:57:46 +00:00
Michael Vines e2ac634c3e Bump token version 2020-08-14 08:48:12 -07:00
Michael Vines 69ec1d7ca7 clippy 2020-08-14 08:48:12 -07:00
dependabot[bot] c3e80d401f
Bump clap from 2.33.2 to 2.33.3 (#274)
Bumps [clap](https://github.com/clap-rs/clap) from 2.33.2 to 2.33.3.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-14 08:44:28 +00:00
dependabot[bot] 44c8dd7284
Bump rollup from 2.23.1 to 2.25.0 in /token/js (#273)
Bumps [rollup](https://github.com/rollup/rollup) from 2.23.1 to 2.25.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.23.1...v2.25.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-14 08:40:46 +00:00
dependabot[bot] 98e322a27c
Bump @rollup/plugin-babel from 5.1.0 to 5.2.0 in /token/js (#272)
Bumps [@rollup/plugin-babel](https://github.com/rollup/plugins) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Commits](https://github.com/rollup/plugins/compare/babel-v5.1.0...babel-v5.2.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-14 08:40:41 +00:00
Michael Vines bf1b3259b9 Bump version to v1.0.7 2020-08-14 01:22:11 +00:00
Michael Vines 77e43016f1 clippy 2020-08-14 01:22:11 +00:00
Michael Vines d87d056e61 Bump testnetDefaultChannel 2020-08-14 01:22:11 +00:00
Michael Vines 65b49c41fb Bump @solana/web3.js from 0.64.0 to 0.68.0 in /token/js 2020-08-14 01:22:11 +00:00
Michael Vines 96f9b0cdc6 Adapt spl-token cli to Solana 1.3.2 2020-08-14 01:22:11 +00:00
dependabot[bot] 5bf7742620
Bump solana-cli-config from 1.3.1 to 1.3.2 (#263)
Bumps [solana-cli-config](https://github.com/solana-labs/solana) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.1...v1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-12 08:44:29 +00:00
dependabot[bot] 0c5f3979c3
Bump solana-logger from 1.3.1 to 1.3.2 (#264)
Bumps [solana-logger](https://github.com/solana-labs/solana) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/solana-labs/solana/releases)
- [Changelog](https://github.com/solana-labs/solana/blob/master/RELEASE.md)
- [Commits](https://github.com/solana-labs/solana/compare/v1.3.1...v1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-08-12 08:43:30 +00:00
Jack May 706e619bdd
cbindgen does not produce deterministic header files (#261) 2020-08-11 16:09:36 -07:00