Commit Graph

856 Commits

Author SHA1 Message Date
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
Michael Vines 1a0155e34b Update to Rust 1.57.0 2021-12-09 23:56:47 -08: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
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 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 02d2736797
token-js: Add test for disabling mint authority (#2582) 2021-11-15 18:56:23 +01:00
Ikko Ashimine 707382ee96
Fix typo in main.rs (#2569)
auxillary -> auxiliary
2021-11-10 11:18:07 -07: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
Michael Vines 9acb082dc3 Upgrade to Solana v1.8.1 2021-10-20 22:52:19 -07:00
fukaoi 5436ac239e
added transferChecked (#2481) 2021-10-13 16:55:19 +02:00
Krešimir Klas 889ccd6799
[token][js]: add missing checked instruction method declarations to module.d.ts (#2484)
The following methods:
- createApproveCheckedInstruction
- createMintToCheckedInstruction
- createBurnCheckedInstruction
- createSyncNativeInstruction

are missing from the `module.d.ts` file which means they won't be included in
the `lib/index.d.ts` module declaration file and therefore cannot be
referenced to when using the package with typescript.

Added the missing declarations.
2021-10-13 16:54:56 +02:00
Michael Vines 1c417ffa4f Fork Token 2022 program 2021-10-12 10:43:58 -07:00
Michael Vines 12732f8d5a Upgrade to Solana 1.8.0 2021-10-12 09:40:06 -07:00
Ryo Onodera 2221e5df74 token-cli: Bump version to 2.0.15 2021-09-28 22:03:41 +09:00
Ryo Onodera 462f1e0708
Really plumb dump_transaction_message (#2448) 2021-09-24 12:05:26 +09:00
Michael Vines 9f0f30a21d Always check transaction statuses before resending 2021-09-19 21:44:09 -07:00
Michael Vines 7d1c0c48fb Use status.satisfies_commitment 2021-09-16 19:35:30 -07:00
dependabot[bot] 2513e327a5
build(deps-dev): bump @babel/node from 7.14.9 to 7.15.4 in /token/js (#2419)
Bumps [@babel/node](https://github.com/babel/babel/tree/HEAD/packages/babel-node) from 7.14.9 to 7.15.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.15.4/packages/babel-node)

---
updated-dependencies:
- dependency-name: "@babel/node"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-16 08:32:30 +00:00
dependabot[bot] a0e32c7baf
build(deps-dev): bump flow-bin from 0.158.0 to 0.160.0 in /token/js (#2418)
Bumps [flow-bin](https://github.com/flowtype/flow-bin) from 0.158.0 to 0.160.0.
- [Release notes](https://github.com/flowtype/flow-bin/releases)
- [Commits](https://github.com/flowtype/flow-bin/commits)

---
updated-dependencies:
- dependency-name: flow-bin
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-16 08:16:59 +00:00
dependabot[bot] a036953d12
build(deps): bump serde_json from 1.0.67 to 1.0.68 (#2416)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.67 to 1.0.68.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.67...v1.0.68)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-15 11:17:56 +00:00
Michael Vines 77bfbabac8 Update token/js/README.md
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
2021-09-12 22:45:17 -07:00
Michael Vines 9b288f6e64 Update token/js/README.md 2021-09-12 22:45:17 -07:00
Gabriel 5d03597f21 update token/js/readme 2021-09-12 22:45:17 -07:00
Michael Vines 2fa7bb0ef3 Adjust send_and_confirm_messages_with_spinner() to work better with public mainnet RPC 2021-09-08 12:08:27 -05:00
Alexander CherryTea edc6be2ae5
Fix example codestyle (#2362)
Use const instead of let / var without any readon
2021-09-08 17:41:03 +02:00
Michael Vines 35e4c1ab49 Slow down retransmission of transactions 2021-09-08 09:48:46 -05:00
Michael Vines 054e4f71c5 Fix issues building against solana 1.8 2021-09-05 17:06:27 -07:00
Michael Vines 902ca60aa3 Groom send_and_confirm_messages_with_spinner 2021-09-05 17:06:27 -07:00
Michael Vines 0737892ba6 Add bench subcommand 2021-09-04 22:31:11 -07:00
dependabot[bot] 6461dd687d
build(deps-dev): bump eslint-plugin-flowtype in /token/js (#2365)
Bumps [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype) from 5.9.1 to 5.9.2.
- [Release notes](https://github.com/gajus/eslint-plugin-flowtype/releases)
- [Commits](https://github.com/gajus/eslint-plugin-flowtype/compare/v5.9.1...v5.9.2)

---
updated-dependencies:
- dependency-name: eslint-plugin-flowtype
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-01 08:14:04 +00:00
Michael Vines ca685784ee Add memo support to transfer and burn commands 2021-08-31 18:08:46 -07:00
dependabot[bot] 3fcfb999d1
build(deps): bump serde from 1.0.129 to 1.0.130 (#2361)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.129 to 1.0.130.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.129...v1.0.130)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 11:13:17 +00:00
dependabot[bot] 61b4e39a7d
build(deps-dev): bump @typescript-eslint/eslint-plugin in /token/js (#2354)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.29.3 to 4.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.30.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 08:32:31 +00:00
dependabot[bot] fd6571c23f
build(deps-dev): bump @typescript-eslint/parser in /token/js (#2353)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.29.3 to 4.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.30.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 08:15:46 +00:00
Michael Vines 4406265d4a Upgrade to Solana 1.7.11 2021-08-30 12:41:08 -07:00
dependabot[bot] 7ef3509f51
build(deps): bump serde_json from 1.0.66 to 1.0.67 (#2351)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.66 to 1.0.67.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.66...v1.0.67)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 11:32:19 +00:00
dependabot[bot] 6ee101fd3d
build(deps-dev): bump eslint-plugin-flowtype in /token/js (#2347)
Bumps [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype) from 5.9.0 to 5.9.1.
- [Release notes](https://github.com/gajus/eslint-plugin-flowtype/releases)
- [Commits](https://github.com/gajus/eslint-plugin-flowtype/compare/v5.9.0...v5.9.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-flowtype
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 08:30:25 +00:00
dependabot[bot] ea8c75de9e
build(deps-dev): bump mocha from 9.1.0 to 9.1.1 in /token/js (#2346)
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.0 to 9.1.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.1.0...v9.1.1)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-30 08:15:12 +00:00
dependabot[bot] 7761bcd1ec
build(deps-dev): bump flow-bin from 0.157.0 to 0.158.0 in /token/js (#2341)
Bumps [flow-bin](https://github.com/flowtype/flow-bin) from 0.157.0 to 0.158.0.
- [Release notes](https://github.com/flowtype/flow-bin/releases)
- [Commits](https://github.com/flowtype/flow-bin/commits)

---
updated-dependencies:
- dependency-name: flow-bin
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 11:11:40 +00:00
dependabot[bot] 329cf58bd5
build(deps): bump @babel/runtime from 7.14.8 to 7.15.3 in /token/js (#2340)
Bumps [@babel/runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime) from 7.14.8 to 7.15.3.
- [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.15.3/packages/babel-runtime)

---
updated-dependencies:
- dependency-name: "@babel/runtime"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 11:00:39 +00:00
dependabot[bot] f3b1be9115
build(deps-dev): bump rollup from 2.56.0 to 2.56.3 in /token/js (#2339)
Bumps [rollup](https://github.com/rollup/rollup) from 2.56.0 to 2.56.3.
- [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.56.0...v2.56.3)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 10:46:24 +00:00
dependabot[bot] b14d61bc2d
build(deps-dev): bump @babel/register from 7.14.5 to 7.15.3 in /token/js (#2338)
Bumps [@babel/register](https://github.com/babel/babel/tree/HEAD/packages/babel-register) from 7.14.5 to 7.15.3.
- [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.15.3/packages/babel-register)

---
updated-dependencies:
- dependency-name: "@babel/register"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 10:31:51 +00:00
dependabot[bot] 1ce492317f
build(deps-dev): bump http-server from 0.12.3 to 13.0.1 in /token/js (#2336)
Bumps [http-server](https://github.com/http-party/http-server) from 0.12.3 to 13.0.1.
- [Release notes](https://github.com/http-party/http-server/releases)
- [Commits](https://github.com/http-party/http-server/compare/v0.12.3...v13.0.1)

---
updated-dependencies:
- dependency-name: http-server
  dependency-type: direct:development
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 10:10:41 +00:00
dependabot[bot] 06af7c69aa
build(deps-dev): bump @typescript-eslint/parser in /token/js (#2335)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 4.29.0 to 4.29.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.29.3/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 09:35:28 +00:00
dependabot[bot] eaee540fa9
build(deps): bump @solana/web3.js from 1.22.0 to 1.24.1 in /token/js (#2334)
Bumps [@solana/web3.js](https://github.com/solana-labs/solana-web3.js) from 1.22.0 to 1.24.1.
- [Release notes](https://github.com/solana-labs/solana-web3.js/releases)
- [Changelog](https://github.com/solana-labs/solana-web3.js/blob/master/.releaserc.json)
- [Commits](https://github.com/solana-labs/solana-web3.js/compare/v1.22.0...v1.24.1)

---
updated-dependencies:
- dependency-name: "@solana/web3.js"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 09:21:50 +00:00
dependabot[bot] ce62fc2e3f
build(deps-dev): bump flow-remove-types in /token/js (#2333)
Bumps [flow-remove-types](https://github.com/facebook/flow) from 2.157.0 to 2.158.0.
- [Release notes](https://github.com/facebook/flow/releases)
- [Changelog](https://github.com/facebook/flow/blob/main/Changelog.md)
- [Commits](https://github.com/facebook/flow/commits)

---
updated-dependencies:
- dependency-name: flow-remove-types
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 09:08:32 +00:00
dependabot[bot] 0b431e0438
build(deps-dev): bump @typescript-eslint/eslint-plugin in /token/js (#2332)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 4.29.0 to 4.29.3.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.29.3/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-27 08:56:56 +00:00