@solana-program/system 0.12.0 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +7 -9
  2. package/dist/src/index.js +4 -5
  3. package/dist/src/index.js.map +1 -1
  4. package/dist/src/index.mjs +5 -6
  5. package/dist/src/index.mjs.map +1 -1
  6. package/dist/types/generated/instructions/advanceNonceAccount.d.ts +1 -1
  7. package/dist/types/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
  8. package/dist/types/generated/instructions/allocate.d.ts +1 -1
  9. package/dist/types/generated/instructions/allocate.d.ts.map +1 -1
  10. package/dist/types/generated/instructions/allocateWithSeed.d.ts +1 -1
  11. package/dist/types/generated/instructions/allocateWithSeed.d.ts.map +1 -1
  12. package/dist/types/generated/instructions/assign.d.ts +1 -1
  13. package/dist/types/generated/instructions/assign.d.ts.map +1 -1
  14. package/dist/types/generated/instructions/assignWithSeed.d.ts +1 -1
  15. package/dist/types/generated/instructions/assignWithSeed.d.ts.map +1 -1
  16. package/dist/types/generated/instructions/authorizeNonceAccount.d.ts +1 -1
  17. package/dist/types/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
  18. package/dist/types/generated/instructions/createAccount.d.ts +1 -1
  19. package/dist/types/generated/instructions/createAccount.d.ts.map +1 -1
  20. package/dist/types/generated/instructions/createAccountWithSeed.d.ts +1 -1
  21. package/dist/types/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
  22. package/dist/types/generated/instructions/initializeNonceAccount.d.ts +1 -1
  23. package/dist/types/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
  24. package/dist/types/generated/instructions/transferSol.d.ts +1 -1
  25. package/dist/types/generated/instructions/transferSol.d.ts.map +1 -1
  26. package/dist/types/generated/instructions/transferSolWithSeed.d.ts +1 -1
  27. package/dist/types/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
  28. package/dist/types/generated/instructions/upgradeNonceAccount.d.ts +1 -1
  29. package/dist/types/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
  30. package/dist/types/generated/instructions/withdrawNonceAccount.d.ts +1 -1
  31. package/dist/types/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
  32. package/dist/types/generated/programs/system.d.ts +1 -1
  33. package/dist/types/generated/programs/system.d.ts.map +1 -1
  34. package/package.json +31 -28
  35. package/src/generated/accounts/index.ts +9 -0
  36. package/src/generated/accounts/nonce.ts +139 -0
  37. package/src/generated/errors/index.ts +9 -0
  38. package/src/generated/errors/system.ts +77 -0
  39. package/src/generated/index.ts +13 -0
  40. package/src/generated/instructions/advanceNonceAccount.ts +186 -0
  41. package/src/generated/instructions/allocate.ts +148 -0
  42. package/src/generated/instructions/allocateWithSeed.ts +189 -0
  43. package/src/generated/instructions/assign.ts +145 -0
  44. package/src/generated/instructions/assignWithSeed.ts +177 -0
  45. package/src/generated/instructions/authorizeNonceAccount.ts +169 -0
  46. package/src/generated/instructions/createAccount.ts +184 -0
  47. package/src/generated/instructions/createAccountWithSeed.ts +221 -0
  48. package/src/generated/instructions/index.ts +21 -0
  49. package/src/generated/instructions/initializeNonceAccount.ts +202 -0
  50. package/src/generated/instructions/transferSol.ts +157 -0
  51. package/src/generated/instructions/transferSolWithSeed.ts +191 -0
  52. package/src/generated/instructions/upgradeNonceAccount.ts +135 -0
  53. package/src/generated/instructions/withdrawNonceAccount.ts +235 -0
  54. package/src/generated/programs/index.ts +9 -0
  55. package/src/generated/programs/system.ts +355 -0
  56. package/src/generated/types/index.ts +10 -0
  57. package/src/generated/types/nonceState.ts +37 -0
  58. package/src/generated/types/nonceVersion.ts +37 -0
  59. package/src/index.ts +1 -0
package/README.md CHANGED
@@ -4,23 +4,19 @@ A generated JavaScript library for the System program.
4
4
 
5
5
  ## Getting started
6
6
 
7
- To build and test your JavaScript client from the root of the repository, you may use the following command.
7
+ The JS client tests use [LiteSVM](https://github.com/LiteSVM/litesvm) in-process, so no local validator is needed. From the root of the repository:
8
8
 
9
9
  ```sh
10
- pnpm clients:js:test
10
+ make test-js-clients-js
11
11
  ```
12
12
 
13
- This will start a new local validator, if one is not already running, and run the tests for your JavaScript client.
13
+ This installs dependencies, builds the client, and runs the test suite.
14
14
 
15
- ## Available client scripts.
15
+ ## Available client scripts
16
16
 
17
- Alternatively, you can go into the client directory and run the tests directly.
17
+ Alternatively, you can go into the client directory and run the scripts directly.
18
18
 
19
19
  ```sh
20
- # Start the validator.
21
- pnpm validator:restart
22
-
23
- # Go into the client directory and run the tests.
24
20
  cd clients/js
25
21
  pnpm install
26
22
  pnpm build
@@ -35,3 +31,5 @@ pnpm lint:fix
35
31
  pnpm format
36
32
  pnpm format:fix
37
33
  ```
34
+
35
+ Equivalent `make` targets from the repo root are `make lint-js-clients-js` and `make format-check-js-clients-js`.
package/dist/src/index.js CHANGED
@@ -1056,8 +1056,7 @@ function parseSystemInstruction(instruction) {
1056
1056
  }
1057
1057
  function systemProgram() {
1058
1058
  return (client) => {
1059
- return {
1060
- ...client,
1059
+ return kit.extendClient(client, {
1061
1060
  system: {
1062
1061
  accounts: { nonce: programClientCore.addSelfFetchFunctions(client, getNonceCodec()) },
1063
1062
  instructions: {
@@ -1082,7 +1081,7 @@ function systemProgram() {
1082
1081
  upgradeNonceAccount: (input) => programClientCore.addSelfPlanAndSendFunctions(client, getUpgradeNonceAccountInstruction(input))
1083
1082
  }
1084
1083
  }
1085
- };
1084
+ });
1086
1085
  };
1087
1086
  }
1088
1087
 
@@ -1097,7 +1096,7 @@ var SYSTEM_ERROR__NONCE_NO_RECENT_BLOCKHASHES = 6;
1097
1096
  var SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED = 7;
1098
1097
  var SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE = 8;
1099
1098
  var systemErrorMessages;
1100
- if (process.env.NODE_ENV !== "production") {
1099
+ if (process.env["NODE_ENV"] !== "production") {
1101
1100
  systemErrorMessages = {
1102
1101
  [SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE]: `an account with the same address already exists`,
1103
1102
  [SYSTEM_ERROR__ADDRESS_WITH_SEED_MISMATCH]: `provided address does not match addressed derived from seed`,
@@ -1111,7 +1110,7 @@ if (process.env.NODE_ENV !== "production") {
1111
1110
  };
1112
1111
  }
1113
1112
  function getSystemErrorMessage(code) {
1114
- if (process.env.NODE_ENV !== "production") {
1113
+ if (process.env["NODE_ENV"] !== "production") {
1115
1114
  return systemErrorMessages[code];
1116
1115
  }
1117
1116
  return "Error message not available in production bundles.";