Commit Graph

433 Commits

Author SHA1 Message Date
Justin Starry f8b5b517d2
fix: replace `TransactionMessage` `accountKeys` field with `payerKey` (#27653)
fix: replace TransactionMessage accountKeys field with payerKey
2022-09-07 18:11:24 -04:00
Steven Luscher 6bc04b5e3a
fix: replace js-sha3 with `@noble/hashes/sha3` (#27630) 2022-09-06 22:38:11 -07:00
Steven Luscher 466e9948bf
feat: added `authorizeWithSeed` to the vote program in web3.js (#27627)
* fix: recursively size variable size structs in your buffer layouts

* feat: added `authorizeWithSeed` to the vote program in web3.js
2022-09-06 22:37:43 -07:00
Justin Starry 204f272412
feat: support versioned txs in `sendTransaction` and `simulateTransaction` (#27528)
* feat: support versioned txs in sendTransaction and simulateTransaction

* chore: add docs for simulation config parameters
2022-09-06 23:53:42 -04:00
Justin Starry 9f81d27db8
feat: add `TransactionMessage` class (#27526)
feat: implement message v0 decompilation
2022-09-07 03:51:52 +00:00
Justin Starry 3374f41201
feat: implement message v0 compilation (#27524)
* feat: add PublicKey.unique method for tests

* feat: add MessageAccountKeys class

* feat: add CompiledKeys class for message compilation

* feat: implement message compilation using CompiledKeys
2022-09-06 23:43:22 -04:00
Justin Starry da7e88fc41
fix: add compute units to jsonrpc parser (#27554) 2022-09-01 18:18:43 +00:00
Justin Starry 292b2a1bfe
feat: update `Connection` to support versioned transactions (#27068)
feat: update Connection to support versioned transactions
2022-08-31 08:46:24 -04:00
Justin Starry ada493f607
feat: add VersionedMessage.deserializeMessageVersion utility function (#27415) 2022-08-29 21:20:16 +01:00
Steven Luscher 60f3dc5f72
fix: replace tweetnacl impl
* Install `@noble/ed25519` and create a shim

* Replace `tweetnacl` with `@noble/ed25519` in `Account` class

* Replace `tweetnacl` with `@noble/ed25519` in `Keypair` class

* Replace `tweetnacl` with `@noble/ed25519` in `PublicKey` class

* Replace `tweetnacl` with `@noble/ed25519` in `Ed25519Program` class

* Replace `tweetnacl` with `@noble/ed25519` in `Transaction` class

* Replace `tweetnacl` with `@noble/ed25519` in versioned `Transaction` class

* Remove `tweetnacl` from project

* Damnit, typedoc.
2022-08-28 12:11:34 -07:00
Steven Luscher 1a836ab4af
[web3.js] Replace sha256 and secp256k1 impls (#27390)
* fix: replace `@ethersproject/sha2` with `@noble/hashes/sha256`

* fix: replace `secp256k1` with `@noble/secp256k1`
2022-08-25 13:34:11 -07:00
Justin Starry 1ccfc65a52
feat: add support for creating version 0 transactions (#27142)
* feat: add support for version 0 transactions

* chore: feedback

* chore: update VersionedMessage type

* chore: use literals for version getter

* chore: fix lint error

* chore: switch to VersionedMessage.deserialize
2022-08-25 15:42:54 +02:00
Steven Luscher 5975176af7
[web3.js] Eliminate dependency on `URL` class (#27349)
* fix: `makeWebsocketUrl` no longer depends on the `URL` class
* fix: `Connection` no longer relies on the `URL` class
* fix: remove dependency on `react-native-url-polyfill`
2022-08-24 11:02:40 -07:00
Andrew Schonfeld 4b8ab4e65d
VoteProgram.safeWithdraw function to safeguard against accidental vote account closures (#26586)
feat: safe withdraw function

Co-authored-by: aschonfeld <andrew@proofofalpha.io>
2022-08-17 00:22:38 +02:00
Justin Starry dcef8ec100
feat: add getAddressLookupTable method to Connection (#27127) 2022-08-14 10:11:49 +00:00
Justin Starry 8e30dbbbf2 chore: restructure utils code 2022-08-12 17:11:51 +01:00
Justin Starry 52dc24abfb chore: restructure program files 2022-08-12 17:11:51 +01:00
Athar Mohammad ce337e009d
feat(web3.js): add support for get stake minimum delegation (#26682) 2022-07-22 01:02:49 -07:00
Antematter e3c9c58032
feat: added web3 bindings for Address Lookup Table Program instructions (#26469)
* feat: added web3 bindings for Address Lookup Table Program

* fix: refactoring + addresses PR comments

* fix: typos fixed and minor refactoring

* add lookup table instruction decoding support + fixes recent slot serialization bug

* export lookup table program

* linting

* fix: type annotations

* add tests cases for address lookup table program

* fix: alloc encoding buffer properly for seq layouts

* fix: typedoc issue

Co-authored-by: Antematter <hello@antematter.io>
Co-authored-by: Muhammad Saad <msaadahmed039@gmail.com>
Co-authored-by: Justin Starry <justin@solana.com>
2022-07-13 20:19:51 +01:00
Athar Mohammad d0d3ad7166
Support for returnData in simulate transaction (#26499)
feat(web3.js): add Support for returnData in simulate transaction
2022-07-12 14:07:17 +02:00
steveluscher b1f8baf6ad test: maybe don't disable all the web3.js tests 2022-07-01 22:31:02 -07:00
steveluscher e24b64dd71 fix: `getPerformanceSamples` no longer breaks when the connection has a default commitment 2022-07-02 05:29:41 +00:00
Steven Luscher a741eddf7d
fix: always use the nonce as the recent blockhash; never overwrite it (#25829) 2022-06-26 19:01:54 -07:00
Kunal Desai aea84e699c
fix: `getTransactions()` now returns the expected datatype (#26099) 2022-06-21 10:31:42 -07:00
steveluscher 0ae5893379 fix: repair sort order of pubkeys when compiling messages 2022-06-04 16:09:08 -07:00
steveluscher 1727ca4371 test: massage tests from PR 25641 2022-05-30 11:40:30 -07:00
sudhir-b 20f169c0b0 fix: sort accountMetas after deduping 2022-05-30 11:40:01 -07:00
Justin Starry a7e6f4deef
feat: support additional compute budget ixs (#25104) 2022-05-20 07:27:48 +00:00
Dmitri Makarov 569b00025c fix: replace rust cfg annotations that use bpf by target_os solana 2022-05-18 20:39:43 -07:00
Steven Luscher 4ea39c1cd3
feat: thread new blockheight expiry strategy through `sendAndConfirmTransaction` (#25227)
* chore: extract expirable blockhash record into its own type

* fix: the local latest blockhash cache now fetches and stores lastValidBlockHeight

* fix: allow people to supply a confirmation strategy to sendAndConfirmRawTransaction

* test: upgrade RPC helpers to use blockheight confirmation method

* test: patch up tests to use blockheight based confirmation strategy

* fix: eliminate deprecated construction of Transaction inside simulateTransaction

* test: eliminate deprecated constructions of Transaction in tests
2022-05-14 21:54:12 -07:00
Steven Luscher d513407485
test: getEstimatedFee change runs only in live environment now (#25210)
Co-authored-by: Marc Jaramillo <mnj.webdeveloper@gmail.com>
2022-05-13 21:16:39 -07:00
Marc Jaramillo 375968da3b fix: transaction confirmation strategy: wait until the last valid blockheight passes (closes #24211)
Co-authored-by: Marc Jaramillo <mnj.webdeveloper@gmail.com>
Co-authored-by: Stella Wang <stella01wang@gmail.com>
2022-05-13 20:21:24 -07:00
Steven Luscher e024806aa5
fix: mark the socket as closed when receiving a close/error message (#25180) 2022-05-13 02:07:13 -07:00
wentokay a38ce127ca
fix: include exception identifier in `catch` blocks (#25147) 2022-05-11 20:32:02 -07:00
Justin Starry d1f816984e
fix: allow mutating transactions (#25141) 2022-05-12 11:02:57 +08:00
Justin Starry 634b7c3b5a
chore: fix lagging stake program live test (#25107)
* chore: fix lagging stake program live test

* chore: use min stake delegation in stake tests
2022-05-11 00:37:15 +08:00
Justin Starry d34b440a3c
chore: update dev dep @solana/spl-token to 0.2.0 (#25044)
* chore: update dev dep @solana/spl-token to 0.2.0

* chore: fix token tests
2022-05-07 00:14:11 +08:00
Steven Luscher 9089909995
fix: add bigint support to system transfers (#24975)
Authored-by: KonyTech <nicolas.cortella@protonmail.com>
2022-05-04 19:14:31 -07:00
Steven Luscher dd8295981b
test: you can now supply promises for values when mocking RPC subscriptions (#24920) 2022-05-02 17:02:35 -07:00
Steven Luscher 2e617ba4fd
fix: the one where we fix client subscriptions (#24473)
* chore: create a first-class type to distinguish client subscription ids from server subscription ids

* chore: add fast-stable-stringify as a dependency to web3.js

* fix: reimplement the subscription tracker as a state machine

* test: updated tests to recognize that signatureUnsubscribe happens synchronously

* chore: add sinon-chai so that we can make assertions on calling spies

* test: coverage for the full range of subscription state transitions

* fix: special case auto-disposing subscriptions like signatureSubscribe

* fix: document Subscription type (SQUASH THIS)

* fix: strict undefined checks (SQUASH THIS)

* fix: naming (SQUASH THIS)

* fix: move defaulting to source (SQUASH THIS)

* fix: build RPC args first, then produce the subscription topic hash (SQUASH THIS)

* fix: dispose handles no longer track whether they've been called (SQUASH THIS)

* fix: shore up the auto-disposing sub tests now that double-free doesn't fatal (SQUASH THIS)

* fix: write documentation explaining how and why to apply a default commitment (SQUASH THIS)

* fix: skip subscriptions that have been deleted when recursing (SQUASH THIS)

* fix: bail on async responses when the connection has been recycled (SQUASH THIS)

* fix: typo in comment (SQUASH THIS)

* chore: comment on why notification callbacks are ts-ignored

* chore: start all the new stuff out as private members of the Connection class
2022-04-28 16:21:39 -07:00
Steven Luscher 8f6e469d92
test: repair web3.js getBlocks tests (#24813) 2022-04-28 16:09:08 -07:00
Steven Luscher 69725df6b0
chore: delete unused Rollup config in web3.js test dir (#24733) 2022-04-27 11:36:04 -07:00
Steven Luscher 2be4ee3619
test: increase timeout for getEstimatedFee test (#24732) 2022-04-26 23:54:56 -07:00
Phil Chen 6bbfef7069
feat: add support for compute budget instructions (#24086)
* Add ComputeBudgetInstruction to web3 sdk

* Prettier fix

* Rename to ComputeBudgetProgram and enable tests

Co-authored-by: Justin Starry <justin@solana.com>
2022-04-26 23:58:32 +08:00
Kartik Soneji 758fcd383d
feat: allow PublicKey.isOnCurve to accept PublicKeyInitData (#24602) 2022-04-25 20:42:41 +08:00
Justin Starry 7ba419e5d5
fix: allow signing a populated transaction (#24475) 2022-04-20 01:03:37 +08:00
Yang Li a6742b5838
fix: remove async for createProgramAddress and findProgramAddress (#2… (#23185)
* fix: remove async for createProgramAddress and findProgramAddress (#23184)

make sync

* test: add test to ensure backwards compatibility
2022-04-18 16:17:00 +02:00
Jordan Sexton 21dacefbee
fix: transactions populated from RPC requests retain original account key order (#23720)
* fix: transaction populate

* chore: web3: fix tx serialization test

* chore: web3: run prettier

* fix: web3: transaction populate

* fix: web3: handle nonce info

* add hash calc config.use_write_cache (#24005)

* restore existing overlapping overflow (#24010)

* Stringify populated transaction fields

* fix: web3: compare stringified JSON

* chore: web3: remove eslint indent rule that conflicts with prettier

* fix: web3: explicitly call toJSON

* fix: web3: add test for compileMessage

* fix: web3: make JSON internal

* fix: web3: connection simulation from message relies on mutating transaction

Co-authored-by: Jeff Washington (jwash) <wash678@gmail.com>
Co-authored-by: Jack May <jack@solana.com>
Co-authored-by: Justin Starry <justin@solana.com>
2022-04-16 14:28:57 -05:00
steveluscher 1882434c69 test: add test for signature notifications 2022-04-09 19:43:15 -07:00
steveluscher 21a64db140 test: refactor notification tests on the basis of promises rather than polling 2022-04-09 19:43:15 -07:00