@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.
- package/README.md +7 -9
- package/dist/src/index.js +4 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +5 -6
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts +1 -1
- package/dist/types/generated/instructions/advanceNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocate.d.ts +1 -1
- package/dist/types/generated/instructions/allocate.d.ts.map +1 -1
- package/dist/types/generated/instructions/allocateWithSeed.d.ts +1 -1
- package/dist/types/generated/instructions/allocateWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/assign.d.ts +1 -1
- package/dist/types/generated/instructions/assign.d.ts.map +1 -1
- package/dist/types/generated/instructions/assignWithSeed.d.ts +1 -1
- package/dist/types/generated/instructions/assignWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts +1 -1
- package/dist/types/generated/instructions/authorizeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccount.d.ts +1 -1
- package/dist/types/generated/instructions/createAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts +1 -1
- package/dist/types/generated/instructions/createAccountWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts +1 -1
- package/dist/types/generated/instructions/initializeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSol.d.ts +1 -1
- package/dist/types/generated/instructions/transferSol.d.ts.map +1 -1
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts +1 -1
- package/dist/types/generated/instructions/transferSolWithSeed.d.ts.map +1 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts +1 -1
- package/dist/types/generated/instructions/upgradeNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts +1 -1
- package/dist/types/generated/instructions/withdrawNonceAccount.d.ts.map +1 -1
- package/dist/types/generated/programs/system.d.ts +1 -1
- package/dist/types/generated/programs/system.d.ts.map +1 -1
- package/package.json +31 -28
- package/src/generated/accounts/index.ts +9 -0
- package/src/generated/accounts/nonce.ts +139 -0
- package/src/generated/errors/index.ts +9 -0
- package/src/generated/errors/system.ts +77 -0
- package/src/generated/index.ts +13 -0
- package/src/generated/instructions/advanceNonceAccount.ts +186 -0
- package/src/generated/instructions/allocate.ts +148 -0
- package/src/generated/instructions/allocateWithSeed.ts +189 -0
- package/src/generated/instructions/assign.ts +145 -0
- package/src/generated/instructions/assignWithSeed.ts +177 -0
- package/src/generated/instructions/authorizeNonceAccount.ts +169 -0
- package/src/generated/instructions/createAccount.ts +184 -0
- package/src/generated/instructions/createAccountWithSeed.ts +221 -0
- package/src/generated/instructions/index.ts +21 -0
- package/src/generated/instructions/initializeNonceAccount.ts +202 -0
- package/src/generated/instructions/transferSol.ts +157 -0
- package/src/generated/instructions/transferSolWithSeed.ts +191 -0
- package/src/generated/instructions/upgradeNonceAccount.ts +135 -0
- package/src/generated/instructions/withdrawNonceAccount.ts +235 -0
- package/src/generated/programs/index.ts +9 -0
- package/src/generated/programs/system.ts +355 -0
- package/src/generated/types/index.ts +10 -0
- package/src/generated/types/nonceState.ts +37 -0
- package/src/generated/types/nonceVersion.ts +37 -0
- 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
|
-
|
|
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
|
-
|
|
10
|
+
make test-js-clients-js
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
This
|
|
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
|
|
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
|
|
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
|
|
1113
|
+
if (process.env["NODE_ENV"] !== "production") {
|
|
1115
1114
|
return systemErrorMessages[code];
|
|
1116
1115
|
}
|
|
1117
1116
|
return "Error message not available in production bundles.";
|