@solana-program/system 0.4.0 → 0.4.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 +1 -2
- package/dist/src/index.js +42 -33
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +43 -35
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/generated/errors/system.d.ts +10 -0
- package/dist/types/generated/errors/system.d.ts.map +1 -1
- package/dist/types/generated/programs/system.d.ts +3 -3
- package/dist/types/generated/programs/system.d.ts.map +1 -1
- package/package.json +8 -5
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/kinobi-so/kinobi
|
|
7
7
|
*/
|
|
8
|
+
import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/web3.js';
|
|
8
9
|
/** AccountAlreadyInUse: an account with the same address already exists */
|
|
9
10
|
export declare const SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE = 0;
|
|
10
11
|
/** ResultWithNegativeLamports: account does not have enough SOL to perform the operation */
|
|
@@ -25,4 +26,13 @@ export declare const SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED = 7;
|
|
|
25
26
|
export declare const SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE = 8;
|
|
26
27
|
export type SystemError = typeof SYSTEM_ERROR__ACCOUNT_ALREADY_IN_USE | typeof SYSTEM_ERROR__ADDRESS_WITH_SEED_MISMATCH | typeof SYSTEM_ERROR__INVALID_ACCOUNT_DATA_LENGTH | typeof SYSTEM_ERROR__INVALID_PROGRAM_ID | typeof SYSTEM_ERROR__MAX_SEED_LENGTH_EXCEEDED | typeof SYSTEM_ERROR__NONCE_BLOCKHASH_NOT_EXPIRED | typeof SYSTEM_ERROR__NONCE_NO_RECENT_BLOCKHASHES | typeof SYSTEM_ERROR__NONCE_UNEXPECTED_BLOCKHASH_VALUE | typeof SYSTEM_ERROR__RESULT_WITH_NEGATIVE_LAMPORTS;
|
|
27
28
|
export declare function getSystemErrorMessage(code: SystemError): string;
|
|
29
|
+
export declare function isSystemError<TProgramErrorCode extends SystemError>(error: unknown, transactionMessage: {
|
|
30
|
+
instructions: Record<number, {
|
|
31
|
+
programAddress: Address;
|
|
32
|
+
}>;
|
|
33
|
+
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
|
|
34
|
+
context: Readonly<{
|
|
35
|
+
code: TProgramErrorCode;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
28
38
|
//# sourceMappingURL=system.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/generated/errors/system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2EAA2E;AAC3E,eAAO,MAAM,oCAAoC,IAAM,CAAC;AACxD,4FAA4F;AAC5F,eAAO,MAAM,2CAA2C,IAAM,CAAC;AAC/D,iEAAiE;AACjE,eAAO,MAAM,gCAAgC,IAAM,CAAC;AACpD,4EAA4E;AAC5E,eAAO,MAAM,yCAAyC,IAAM,CAAC;AAC7D,kEAAkE;AAClE,eAAO,MAAM,sCAAsC,IAAM,CAAC;AAC1D,2FAA2F;AAC3F,eAAO,MAAM,wCAAwC,IAAM,CAAC;AAC5D,qGAAqG;AACrG,eAAO,MAAM,yCAAyC,IAAM,CAAC;AAC7D,4EAA4E;AAC5E,eAAO,MAAM,yCAAyC,IAAM,CAAC;AAC7D,iFAAiF;AACjF,eAAO,MAAM,8CAA8C,IAAM,CAAC;AAElE,MAAM,MAAM,WAAW,GACnB,OAAO,oCAAoC,GAC3C,OAAO,wCAAwC,GAC/C,OAAO,yCAAyC,GAChD,OAAO,gCAAgC,GACvC,OAAO,sCAAsC,GAC7C,OAAO,yCAAyC,GAChD,OAAO,yCAAyC,GAChD,OAAO,8CAA8C,GACrD,OAAO,2C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AAC;CAC3D,EACD,IAAI,CAAC,EAAE,iBAAiB,GACvB,KAAK,IAAI,WAAW,CAAC,OAAO,uCAAuC,CAAC,GACrE,QAAQ,CAAC;IAAE,OAAO,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,iBAAiB,CAAA;KAAE,CAAC,CAAA;CAAE,CAAC,CAO7D"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/kinobi-so/kinobi
|
|
7
7
|
*/
|
|
8
|
-
import { type Address } from '@solana/web3.js';
|
|
8
|
+
import { type Address, type ReadonlyUint8Array } from '@solana/web3.js';
|
|
9
9
|
import { type ParsedAdvanceNonceAccountInstruction, type ParsedAllocateInstruction, type ParsedAllocateWithSeedInstruction, type ParsedAssignInstruction, type ParsedAssignWithSeedInstruction, type ParsedAuthorizeNonceAccountInstruction, type ParsedCreateAccountInstruction, type ParsedCreateAccountWithSeedInstruction, type ParsedInitializeNonceAccountInstruction, type ParsedTransferSolInstruction, type ParsedTransferSolWithSeedInstruction, type ParsedUpgradeNonceAccountInstruction, type ParsedWithdrawNonceAccountInstruction } from '../instructions';
|
|
10
10
|
export declare const SYSTEM_PROGRAM_ADDRESS: Address<"11111111111111111111111111111111">;
|
|
11
11
|
export declare enum SystemAccount {
|
|
@@ -27,8 +27,8 @@ export declare enum SystemInstruction {
|
|
|
27
27
|
UpgradeNonceAccount = 12
|
|
28
28
|
}
|
|
29
29
|
export declare function identifySystemInstruction(instruction: {
|
|
30
|
-
data:
|
|
31
|
-
} |
|
|
30
|
+
data: ReadonlyUint8Array;
|
|
31
|
+
} | ReadonlyUint8Array): SystemInstruction;
|
|
32
32
|
export type ParsedSystemInstruction<TProgram extends string = '11111111111111111111111111111111'> = ({
|
|
33
33
|
instructionType: SystemInstruction.CreateAccount;
|
|
34
34
|
} & ParsedCreateAccountInstruction<TProgram>) | ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/generated/programs/system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../../src/generated/programs/system.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,oCAAoC,EACzC,KAAK,yBAAyB,EAC9B,KAAK,iCAAiC,EACtC,KAAK,uBAAuB,EAC5B,KAAK,+BAA+B,EACpC,KAAK,sCAAsC,EAC3C,KAAK,8BAA8B,EACnC,KAAK,sCAAsC,EAC3C,KAAK,uCAAuC,EAC5C,KAAK,4BAA4B,EACjC,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EACzC,KAAK,qCAAqC,EAC3C,MAAM,iBAAiB,CAAC;AAEzB,eAAO,MAAM,sBAAsB,EACK,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAEpF,oBAAY,aAAa;IACvB,KAAK,IAAA;CACN;AAED,oBAAY,iBAAiB;IAC3B,aAAa,IAAA;IACb,MAAM,IAAA;IACN,WAAW,IAAA;IACX,qBAAqB,IAAA;IACrB,mBAAmB,IAAA;IACnB,oBAAoB,IAAA;IACpB,sBAAsB,IAAA;IACtB,qBAAqB,IAAA;IACrB,QAAQ,IAAA;IACR,gBAAgB,IAAA;IAChB,cAAc,KAAA;IACd,mBAAmB,KAAA;IACnB,mBAAmB,KAAA;CACpB;AAED,wBAAgB,yBAAyB,CACvC,WAAW,EAAE;IAAE,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAAG,kBAAkB,GAC7D,iBAAiB,CA4CnB;AAED,MAAM,MAAM,uBAAuB,CACjC,QAAQ,SAAS,MAAM,GAAG,kCAAkC,IAE1D,CAAC;IACC,eAAe,EAAE,iBAAiB,CAAC,aAAa,CAAC;CAClD,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC,GAC7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CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-program/system",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "JavaScript client for the System program",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "./dist/src/index.mjs",
|
|
@@ -29,21 +29,24 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@ava/typescript": "^4.1.0",
|
|
31
31
|
"@solana/eslint-config-solana": "^3.0.3",
|
|
32
|
-
"@solana/web3.js": "
|
|
33
|
-
"@solana/webcrypto-ed25519-polyfill": "
|
|
34
|
-
"@types/node": "^20
|
|
32
|
+
"@solana/web3.js": "2.0.0-preview.4",
|
|
33
|
+
"@solana/webcrypto-ed25519-polyfill": "2.0.0-preview.4",
|
|
34
|
+
"@types/node": "^20",
|
|
35
35
|
"@typescript-eslint/eslint-plugin": "^7.16.1",
|
|
36
36
|
"@typescript-eslint/parser": "^7.16.1",
|
|
37
37
|
"ava": "^6.1.3",
|
|
38
38
|
"eslint": "^8.57.0",
|
|
39
39
|
"prettier": "^3.3.3",
|
|
40
40
|
"rimraf": "^5.0.5",
|
|
41
|
-
"tsup": "^8.
|
|
41
|
+
"tsup": "^8.1.2",
|
|
42
42
|
"typedoc": "^0.25.12",
|
|
43
43
|
"typedoc-plugin-missing-exports": "^2.2.0",
|
|
44
44
|
"typescript": "^5.5.3"
|
|
45
45
|
},
|
|
46
46
|
"ava": {
|
|
47
|
+
"nodeArguments": [
|
|
48
|
+
"--no-warnings"
|
|
49
|
+
],
|
|
47
50
|
"require": [
|
|
48
51
|
"@solana/webcrypto-ed25519-polyfill"
|
|
49
52
|
],
|