Commit Graph

2052 Commits

Author SHA1 Message Date
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
dependabot[bot] 3155270fa4
chore: bump @types/node from 16.11.26 to 17.0.24 in /web3.js (#24432)
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.26 to 17.0.24.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

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

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-18 08:12:09 +00: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) <[email protected]>
Co-authored-by: Jack May <[email protected]>
Co-authored-by: Justin Starry <[email protected]>
2022-04-16 14:28:57 -05:00
Elliott W 6e03e0e987
feat: support overriding fetch function in Connection (#24367)
Co-authored-by: elliott-home-pc <[email protected]>
2022-04-16 14:49:31 +08:00
Justin Starry 7c45d94ccc
feat: remove flow type generation (#24380) 2022-04-16 08:12:29 +08:00
dependabot[bot] 052c64b01a
chore: bump async from 2.6.3 to 2.6.4 in /web3.js (#24379)
Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.3...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-15 08:41:12 +00:00
Justin Starry e13efa0883 fix: do not modify transaction during simulation 2022-04-13 15:22:35 -07:00
David Mohl d8c45a69c3
fix: don't override a transaction's recentBlockhash when calling simulate if it's already set (#24280)
* Update simulate to add blockhash if not exist

Simulate has been overriding the recentBlockhash of the passed
Transaction which can be considered destructive and with side effects.

Since the purpose of this function is to purely simulate, it should not
override recentBlockhash if it has already been set

Refs https://github.com/solana-labs/solana/issues/24279

* Apply prettier
2022-04-13 10:15:50 +08: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
steveluscher db50893fa1 test: reenable account change subscription test 2022-04-09 19:43:15 -07:00
steveluscher 35ee38b0f1 test: reenable log subscription test 2022-04-09 19:43:15 -07:00
steveluscher 4dd3987451 Reset onLogs subscriptions when websocket disconnects 2022-04-07 15:45:35 -07:00
Bryon M 04158ee455
fix: stop logging to console when send tx fails (#23511)
There is no need to log the error to the console. Developers can simply catch the error and handle it themselves without it cluttering production logs.
2022-04-04 19:11:20 +08:00
dependabot[bot] 2a5764ef79
chore: bump @rollup/plugin-commonjs from 21.0.2 to 21.0.3 in /web3.js (#23962)
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 21.0.2 to 21.0.3.
- [Release notes](https://github.com/rollup/plugins/releases)
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/commonjs-v21.0.3/packages/commonjs)

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

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-28 08:16:45 +00:00
stellaw1 c08cfafd6c feat: adds getBlockProduction RPC call 2022-03-26 18:31:40 -07:00
steveluscher 9cf7720922 fix: when there is no instruction index, default to the current instruction by supplying u16:MAX 2022-03-24 22:55:52 -07:00
steveluscher c73cdfd6ce fix: add TypeScript buffer type to nonce-account.ts 2022-03-24 22:55:52 -07:00
steveluscher 477355df3b fix: add TypeScript buffer type to stake-program.ts 2022-03-24 22:55:52 -07:00
steveluscher 6686b7c534 fix: add TypeScript buffer type to message.ts 2022-03-24 22:55:52 -07:00
steveluscher 741c85ca7c fix: add TypeScript buffer type to loader.ts 2022-03-24 22:55:52 -07:00
steveluscher 6bb02cdcc1 fix: add TypeScript buffer type to secp256k1-program.ts 2022-03-24 22:55:52 -07:00
steveluscher 96361295aa fix: add TypeScript buffer type to ed25519-program.ts 2022-03-24 22:55:52 -07:00
steveluscher 3333f37e88 fix: add TypeScript buffer type to vote-account.ts 2022-03-24 22:55:52 -07:00
steveluscher b2f2a68b86 fix: fix spelling of timestamp in BlockTimestamp type 2022-03-24 22:55:52 -07:00
steveluscher c227b8ca4d fix: add TypeScript buffer type to vote-program.ts 2022-03-24 22:55:52 -07:00
steveluscher 607a5c05de fix: add TypeScript buffer type to system-program.ts 2022-03-24 22:55:52 -07:00
steveluscher 807f88e547 fix: add TypeScript types to the rustString buffer layout helper 2022-03-24 22:55:52 -07:00
steveluscher d34fe3dba3 fix: add TypeScript buffer type to layout.ts 2022-03-24 22:55:52 -07:00
steveluscher b516a25132 fix: add TypeScript buffer type to instruction.ts 2022-03-24 22:55:52 -07:00
steveluscher 023fc028bc chore: Upgrade buffer-layout to v4.0.0 2022-03-24 22:55:52 -07:00
Steven Luscher 412d9be445
fix: repair web3 connection tests by making fewer assumptions about the existence of particular blocks (#23921)
* fix: repair 'get confirmed signatures for address' test in web3.js

* fix: repair 'get signatures for address' test in web3.js

* fix: repair 'get parsed confirmed transactions' test in web3.js

* fix: repair 'get transaction' test in web3.js

* fix: repair 'get confirmed transaction' test in web3.js

* fix: repair 'get block' test in web3.js

* fix: repair 'get confirmed block' test in web3.js

* fix: repair 'get block signatures' test in web3.js

* fix: repair 'get block time' test in web3.js

Co-authored-by: steveluscher <[email protected]>
2022-03-24 22:21:14 -07:00
steveluscher 260fdf7ba3 Revert "chore: Upgrade buffer-layout package in web3.js (#23897)"
Fixing up the types is going to take me a bit longer than I anticipated, so I'll back this out for now.
2022-03-23 18:34:01 -07:00
Steven Luscher 0c0db9308b
chore: Upgrade buffer-layout package in web3.js (#23897) 2022-03-23 14:56:13 -07:00
Andrey Frolov 59290c08aa
fix: add type-check script to web3.js package (#23109) 2022-03-23 12:58:42 -07:00
Sammy 26da64184a
feat(web3.js): expose rpcEndpoint in client for web3.js (#23719)
Adds a getter to the commitment class to expose the rpcEndpoint property.
2022-03-23 11:05:37 -07:00
Ashwin Ramaswami accc64ebcf
chore: fix typo retring -> retrying (#23630) 2022-03-13 23:25:27 -06:00
Jordan Sexton 3cf31fa9b8
fix: web3.js browser cjs build (#23500) 2022-03-11 14:35:15 -07:00
Marc Jaramillo 2bff36dfba
feat: add getEstimatedFee to Transaction (#23579) 2022-03-11 10:05:22 -07:00
dependabot[bot] 26ef6111bb
chore: bump follow-redirects from 1.13.1 to 1.14.8 in /web3.js (#23122)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.13.1 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.13.1...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-09 14:09:06 -08:00
Mark Percival 8438366d1b
fix: update 'borsh' dependency to v0.7.0 (#22425)
Fixes issue with usage of 'global' when used in the browser.

Currently the web3.js distributable is built with a commonJS rollup, but if you
use the npm package with another packager, it will fail when it hits the call
to 'global' inside the browser. Borsh fixed this in v0.7.0
2022-03-08 15:07:33 -08:00
Krešimir Klas 41ab690a61 feat: add getMultipleAccountsInfoAndContext method to Connection
Similar to `getAccountInfoAndContext`.
2022-03-02 20:39:48 +01:00
Jordan Sexton 8eefe60c44
chore: web3.js: fix cjs file reference in package.json (#21940) 2022-03-02 10:00:55 -07:00
Justin Starry c97f34a0fd
Add script for running nightly rustfmt on all workspaces (#23244)
* Add script for running nightly rustfmt on all workspaces

* invalidate ci cache
2022-02-22 11:59:06 +08:00
Pierre ebe3d2d59d
fix: simulateTransaction accounts items can be null (#23229)
* fix: simulated accounts can be null

* Use Missing rather than token program id

Co-authored-by: Arrowana <[email protected]>
2022-02-21 14:20:11 +08:00
mooori 5726f42a7c
feat(stake-program): support `splitWithSeed` (#23213) 2022-02-17 12:21:07 -07:00
dependabot[bot] 21656c26e7
chore: bump vm2 from 3.9.5 to 3.9.7 in /web3.js (#23125)
Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.5 to 3.9.7.
- [Release notes](https://github.com/patriksimek/vm2/releases)
- [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patriksimek/vm2/compare/3.9.5...3.9.7)

---
updated-dependencies:
- dependency-name: vm2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-15 00:56:42 +00:00
mooori ae175a026b
feat(vote-program): support VoteInstruction::Authorize (#22978) 2022-02-09 11:29:49 -07:00
Tyera Eulberg c899685cb2
chore: make Connection block tests less brittle (#23015) 2022-02-08 14:58:50 -07:00
mooori 4d877567dd
feat(web3.js): support withdraw from Vote account (#22932) 2022-02-04 13:37:28 -07:00