@solana-program/compute-budget 0.12.0 → 0.14.0
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/dist/src/index.js +72 -14
- package/dist/src/index.js.map +1 -1
- package/dist/src/index.mjs +70 -16
- package/dist/src/index.mjs.map +1 -1
- package/dist/types/estimateAndSetComputeLimit.d.ts +2 -2
- package/dist/types/estimateAndSetComputeLimit.d.ts.map +1 -1
- package/dist/types/estimateComputeLimitInternal.d.ts +3 -3
- package/dist/types/estimateComputeLimitInternal.d.ts.map +1 -1
- package/dist/types/generated/instructions/requestHeapFrame.d.ts +1 -1
- package/dist/types/generated/instructions/requestHeapFrame.d.ts.map +1 -1
- package/dist/types/generated/instructions/requestUnits.d.ts +1 -1
- package/dist/types/generated/instructions/requestUnits.d.ts.map +1 -1
- package/dist/types/generated/instructions/setComputeUnitLimit.d.ts +1 -1
- package/dist/types/generated/instructions/setComputeUnitLimit.d.ts.map +1 -1
- package/dist/types/generated/instructions/setComputeUnitPrice.d.ts +1 -1
- package/dist/types/generated/instructions/setComputeUnitPrice.d.ts.map +1 -1
- package/dist/types/generated/instructions/setLoadedAccountsDataSizeLimit.d.ts +1 -1
- package/dist/types/generated/instructions/setLoadedAccountsDataSizeLimit.d.ts.map +1 -1
- package/dist/types/generated/programs/computeBudget.d.ts +18 -2
- package/dist/types/generated/programs/computeBudget.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/introspect.d.ts +18 -0
- package/dist/types/introspect.d.ts.map +1 -0
- package/dist/types/setComputeLimit.d.ts +3 -3
- package/dist/types/setComputeLimit.d.ts.map +1 -1
- package/dist/types/setComputePrice.d.ts +4 -4
- package/dist/types/setComputePrice.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/types/generated/shared/index.d.ts +0 -50
- package/dist/types/generated/shared/index.d.ts.map +0 -1
- package/dist/types/internal.d.ts +0 -35
- package/dist/types/internal.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionMessage, MicroLamports } from '@solana/kit';
|
|
2
2
|
/**
|
|
3
3
|
* Sets the compute unit price of a transaction message in micro-Lamports.
|
|
4
4
|
*
|
|
@@ -11,9 +11,9 @@ import { BaseTransactionMessage, MicroLamports } from '@solana/kit';
|
|
|
11
11
|
* );
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export declare function setTransactionMessageComputeUnitPrice<TTransactionMessage extends
|
|
14
|
+
export declare function setTransactionMessageComputeUnitPrice<TTransactionMessage extends TransactionMessage>(microLamports: number | bigint, transactionMessage: TTransactionMessage): TTransactionMessage extends TransactionMessage ? Omit<import("@solana/kit").ExcludeTransactionMessageWithinSizeLimit<TTransactionMessage>, "instructions"> & {
|
|
15
15
|
readonly instructions: readonly [...TTransactionMessage["instructions"], import("./generated").SetComputeUnitPriceInstruction<import("@solana/kit").Address<"ComputeBudget111111111111111111111111111111">, []>];
|
|
16
|
-
};
|
|
16
|
+
} : never;
|
|
17
17
|
/**
|
|
18
18
|
* Updates the first `SetComputeUnitPrice` instruction in a transaction message
|
|
19
19
|
* with the given micro-Lamports, or appends a new instruction if none exists.
|
|
@@ -32,5 +32,5 @@ export declare function setTransactionMessageComputeUnitPrice<TTransactionMessag
|
|
|
32
32
|
* );
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export declare function updateOrAppendSetComputeUnitPriceInstruction<TTransactionMessage extends
|
|
35
|
+
export declare function updateOrAppendSetComputeUnitPriceInstruction<TTransactionMessage extends TransactionMessage>(microLamports: MicroLamports | ((previousMicroLamports: MicroLamports | null) => MicroLamports), transactionMessage: TTransactionMessage): TTransactionMessage;
|
|
36
36
|
//# sourceMappingURL=setComputePrice.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setComputePrice.d.ts","sourceRoot":"","sources":["../../src/setComputePrice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,
|
|
1
|
+
{"version":3,"file":"setComputePrice.d.ts","sourceRoot":"","sources":["../../src/setComputePrice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIrG;;;;;;;;;;;GAWG;AACH,wBAAgB,qCAAqC,CAAC,mBAAmB,SAAS,kBAAkB,EAChG,aAAa,EAAE,MAAM,GAAG,MAAM,EAC9B,kBAAkB,EAAE,mBAAmB;;UAM1C;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4CAA4C,CAAC,mBAAmB,SAAS,kBAAkB,EACvG,aAAa,EAAE,aAAa,GAAG,CAAC,CAAC,qBAAqB,EAAE,aAAa,GAAG,IAAI,KAAK,aAAa,CAAC,EAC/F,kBAAkB,EAAE,mBAAmB,GACxC,mBAAmB,CA6BrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana-program/compute-budget",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "JavaScript client for the Compute Budget program",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"module": "./dist/src/index.mjs",
|
|
@@ -32,21 +32,21 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/solana-program/compute-budget#readme",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@solana/kit": "^
|
|
35
|
+
"@solana/kit": "^6.1.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@solana/eslint-config-solana": "^3.0.3",
|
|
39
|
-
"@solana/kit": "^
|
|
39
|
+
"@solana/kit": "^6.1.0",
|
|
40
40
|
"@types/node": "^24",
|
|
41
41
|
"@typescript-eslint/eslint-plugin": "^7.16.1",
|
|
42
42
|
"@typescript-eslint/parser": "^7.16.1",
|
|
43
43
|
"eslint": "^8.57.0",
|
|
44
|
-
"prettier": "^3.
|
|
44
|
+
"prettier": "^3.8.1",
|
|
45
45
|
"rimraf": "^5.0.5",
|
|
46
46
|
"tsup": "^8.1.2",
|
|
47
47
|
"typedoc": "^0.25.12",
|
|
48
|
-
"typescript": "^5.
|
|
49
|
-
"vitest": "^
|
|
48
|
+
"typescript": "^5.9.3",
|
|
49
|
+
"vitest": "^4.0.0"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"build": "rimraf dist && tsup && tsc -p ./tsconfig.declarations.json",
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
-
* to add features, then rerun Codama to update it.
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/codama-idl/codama
|
|
7
|
-
*/
|
|
8
|
-
import { type AccountMeta, type AccountSignerMeta, type Address, type ProgramDerivedAddress, type TransactionSigner } from '@solana/kit';
|
|
9
|
-
/**
|
|
10
|
-
* Asserts that the given value is not null or undefined.
|
|
11
|
-
* @internal
|
|
12
|
-
*/
|
|
13
|
-
export declare function expectSome<T>(value: T | null | undefined): T;
|
|
14
|
-
/**
|
|
15
|
-
* Asserts that the given value is a PublicKey.
|
|
16
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export declare function expectAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): Address<T>;
|
|
19
|
-
/**
|
|
20
|
-
* Asserts that the given value is a PDA.
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
export declare function expectProgramDerivedAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): ProgramDerivedAddress<T>;
|
|
24
|
-
/**
|
|
25
|
-
* Asserts that the given value is a TransactionSigner.
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
|
-
export declare function expectTransactionSigner<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): TransactionSigner<T>;
|
|
29
|
-
/**
|
|
30
|
-
* Defines an instruction account to resolve.
|
|
31
|
-
* @internal
|
|
32
|
-
*/
|
|
33
|
-
export type ResolvedAccount<T extends string = string, U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null> = {
|
|
34
|
-
isWritable: boolean;
|
|
35
|
-
value: U;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Defines an instruction that stores additional bytes on-chain.
|
|
39
|
-
* @internal
|
|
40
|
-
*/
|
|
41
|
-
export type InstructionWithByteDelta = {
|
|
42
|
-
byteDelta: number;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Get account metas and signers from resolved accounts.
|
|
46
|
-
* @internal
|
|
47
|
-
*/
|
|
48
|
-
export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => AccountMeta | AccountSignerMeta | undefined;
|
|
49
|
-
export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
|
|
50
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/generated/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIH,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEzB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,GAAG,CAAC,CAK5D;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAA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,GAAG,WAAW,aAC1F,eAAe,KAAG,WAAW,GAAG,iBAAiB,GAAG,SAAS,CAajF;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChE,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,qBAAqB,CAAC,QAAQ,CAAC,GAAG,iBAAiB,CAAC,QAAQ,CAAC,GACzF,KAAK,IAAI,iBAAiB,CAAC,QAAQ,CAAC,CAEtC"}
|
package/dist/types/internal.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { BaseTransactionMessage, Instruction, MicroLamports } from '@solana/kit';
|
|
2
|
-
import { SetComputeUnitLimitInstruction, SetComputeUnitPriceInstruction } from './generated';
|
|
3
|
-
/**
|
|
4
|
-
* Finds the index of the first `SetComputeUnitLimit` instruction in a transaction message
|
|
5
|
-
* and its set limit, if any.
|
|
6
|
-
*/
|
|
7
|
-
export declare function getSetComputeUnitLimitInstructionIndexAndUnits(transactionMessage: BaseTransactionMessage): {
|
|
8
|
-
index: number;
|
|
9
|
-
units: number;
|
|
10
|
-
} | null;
|
|
11
|
-
/**
|
|
12
|
-
* Finds the index of the first `SetComputeUnitLimit` instruction in a transaction message, if any.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getSetComputeUnitLimitInstructionIndex(transactionMessage: BaseTransactionMessage): number;
|
|
15
|
-
/**
|
|
16
|
-
* Checks if the given instruction is a `SetComputeUnitLimit` instruction.
|
|
17
|
-
*/
|
|
18
|
-
export declare function isSetComputeUnitLimitInstruction(instruction: Instruction): instruction is SetComputeUnitLimitInstruction;
|
|
19
|
-
/**
|
|
20
|
-
* Finds the index of the first `SetComputeUnitPrice` instruction in a transaction message
|
|
21
|
-
* and its set micro-lamports, if any.
|
|
22
|
-
*/
|
|
23
|
-
export declare function getSetComputeUnitPriceInstructionIndexAndMicroLamports(transactionMessage: BaseTransactionMessage): {
|
|
24
|
-
index: number;
|
|
25
|
-
microLamports: MicroLamports;
|
|
26
|
-
} | null;
|
|
27
|
-
/**
|
|
28
|
-
* Finds the index of the first `SetComputeUnitPrice` instruction in a transaction message, if any.
|
|
29
|
-
*/
|
|
30
|
-
export declare function getSetComputeUnitPriceInstructionIndex(transactionMessage: BaseTransactionMessage): number;
|
|
31
|
-
/**
|
|
32
|
-
* Checks if the given instruction is a `SetComputeUnitPrice` instruction.
|
|
33
|
-
*/
|
|
34
|
-
export declare function isSetComputeUnitPriceInstruction(instruction: Instruction): instruction is SetComputeUnitPriceInstruction;
|
|
35
|
-
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,sBAAsB,EAGtB,WAAW,EACX,aAAa,EAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EAIH,8BAA8B,EAC9B,8BAA8B,EACjC,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,wBAAgB,8CAA8C,CAC1D,kBAAkB,EAAE,sBAAsB,GAC3C;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASzC;AAED;;GAEG;AACH,wBAAgB,sCAAsC,CAAC,kBAAkB,EAAE,sBAAsB,UAEhG;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC5C,WAAW,EAAE,WAAW,GACzB,WAAW,IAAI,8BAA8B,CAM/C;AAED;;;GAGG;AACH,wBAAgB,sDAAsD,CAClE,kBAAkB,EAAE,sBAAsB,GAC3C;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,aAAa,CAAA;CAAE,GAAG,IAAI,CAYxD;AAED;;GAEG;AACH,wBAAgB,sCAAsC,CAAC,kBAAkB,EAAE,sBAAsB,UAEhG;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC5C,WAAW,EAAE,WAAW,GACzB,WAAW,IAAI,8BAA8B,CAM/C"}
|