@solana-program/compute-budget 0.1.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.
Files changed (32) hide show
  1. package/README.md +38 -0
  2. package/dist/src/index.cjs +382 -0
  3. package/dist/src/index.cjs.map +1 -0
  4. package/dist/src/index.js +339 -0
  5. package/dist/src/index.js.map +1 -0
  6. package/dist/types/src/generated/index.d.ts +11 -0
  7. package/dist/types/src/generated/index.d.ts.map +1 -0
  8. package/dist/types/src/generated/instructions/index.d.ts +13 -0
  9. package/dist/types/src/generated/instructions/index.d.ts.map +1 -0
  10. package/dist/types/src/generated/instructions/requestHeapFrame.d.ts +45 -0
  11. package/dist/types/src/generated/instructions/requestHeapFrame.d.ts.map +1 -0
  12. package/dist/types/src/generated/instructions/requestUnits.d.ts +45 -0
  13. package/dist/types/src/generated/instructions/requestUnits.d.ts.map +1 -0
  14. package/dist/types/src/generated/instructions/setComputeUnitLimit.d.ts +39 -0
  15. package/dist/types/src/generated/instructions/setComputeUnitLimit.d.ts.map +1 -0
  16. package/dist/types/src/generated/instructions/setComputeUnitPrice.d.ts +39 -0
  17. package/dist/types/src/generated/instructions/setComputeUnitPrice.d.ts.map +1 -0
  18. package/dist/types/src/generated/instructions/setLoadedAccountsDataSizeLimit.d.ts +37 -0
  19. package/dist/types/src/generated/instructions/setLoadedAccountsDataSizeLimit.d.ts.map +1 -0
  20. package/dist/types/src/generated/programs/computeBudget.d.ts +35 -0
  21. package/dist/types/src/generated/programs/computeBudget.d.ts.map +1 -0
  22. package/dist/types/src/generated/programs/index.d.ts +9 -0
  23. package/dist/types/src/generated/programs/index.d.ts.map +1 -0
  24. package/dist/types/src/generated/shared/index.d.ts +61 -0
  25. package/dist/types/src/generated/shared/index.d.ts.map +1 -0
  26. package/dist/types/src/index.d.ts +2 -0
  27. package/dist/types/src/index.d.ts.map +1 -0
  28. package/dist/types/test/_setup.d.ts +14 -0
  29. package/dist/types/test/_setup.d.ts.map +1 -0
  30. package/dist/types/test/setComputeUnitLimit.test.d.ts +2 -0
  31. package/dist/types/test/setComputeUnitLimit.test.d.ts.map +1 -0
  32. package/package.json +75 -0
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the kinobi library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun kinobi to update it.
5
+ *
6
+ * @see https://github.com/metaplex-foundation/kinobi
7
+ */
8
+ import { Address } from '@solana/addresses';
9
+ import { Codec, Decoder, Encoder } from '@solana/codecs';
10
+ import { IAccountMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData } from '@solana/instructions';
11
+ export type SetComputeUnitPriceInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
12
+ export type SetComputeUnitPriceInstructionWithSigners<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
13
+ export type SetComputeUnitPriceInstructionData = {
14
+ discriminator: number;
15
+ /** Transaction compute unit price used for prioritization fees. */
16
+ microLamports: bigint;
17
+ };
18
+ export type SetComputeUnitPriceInstructionDataArgs = {
19
+ /** Transaction compute unit price used for prioritization fees. */
20
+ microLamports: number | bigint;
21
+ };
22
+ export declare function getSetComputeUnitPriceInstructionDataEncoder(): Encoder<SetComputeUnitPriceInstructionDataArgs>;
23
+ export declare function getSetComputeUnitPriceInstructionDataDecoder(): Decoder<SetComputeUnitPriceInstructionData>;
24
+ export declare function getSetComputeUnitPriceInstructionDataCodec(): Codec<SetComputeUnitPriceInstructionDataArgs, SetComputeUnitPriceInstructionData>;
25
+ export type SetComputeUnitPriceInput = {
26
+ microLamports: SetComputeUnitPriceInstructionDataArgs['microLamports'];
27
+ };
28
+ export type SetComputeUnitPriceInputWithSigners = {
29
+ microLamports: SetComputeUnitPriceInstructionDataArgs['microLamports'];
30
+ };
31
+ export declare function getSetComputeUnitPriceInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: SetComputeUnitPriceInputWithSigners): SetComputeUnitPriceInstructionWithSigners<TProgram>;
32
+ export declare function getSetComputeUnitPriceInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: SetComputeUnitPriceInput): SetComputeUnitPriceInstruction<TProgram>;
33
+ export declare function getSetComputeUnitPriceInstructionRaw<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []>(args: SetComputeUnitPriceInstructionDataArgs, programAddress?: Address<TProgram>, remainingAccounts?: TRemainingAccounts): SetComputeUnitPriceInstruction<TProgram, TRemainingAccounts>;
34
+ export type ParsedSetComputeUnitPriceInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'> = {
35
+ programAddress: Address<TProgram>;
36
+ data: SetComputeUnitPriceInstructionData;
37
+ };
38
+ export declare function parseSetComputeUnitPriceInstruction<TProgram extends string>(instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>): ParsedSetComputeUnitPriceInstruction<TProgram>;
39
+ //# sourceMappingURL=setComputeUnitPrice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setComputeUnitPrice.d.ts","sourceRoot":"","sources":["../../../../../src/generated/instructions/setComputeUnitPrice.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EASR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,8BAA8B,CACxC,QAAQ,SAAS,MAAM,GAAG,6CAA6C,EACvE,kBAAkB,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AE,wBAAwB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;AAmB7E,wBAAgB,oCAAoC,CAClD,QAAQ,SAAS,MAAM,GAAG,6CAA6C,EACvE,kBAAkB,SAAS,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAE3D,IAAI,EAAE,sCAAsC,EAC5C,cAAc,GAAE,OAAO,CAAC,QAAQ,CAAsE,EACtG,iBAAiB,CAAC,EAAE,kBAAkB,gEAOvC;AAED,MAAM,MAAM,oCAAoC,CAC9C,QAAQ,SAAS,MAAM,GAAG,6CAA6C,IACrE;IACF,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,EAAE,kCAAkC,CAAC;CAC1C,CAAC;AAEF,wBAAgB,mCAAmC,CAAC,QAAQ,SAAS,MAAM,EACzE,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,UAAU,CAAC,GACrE,oCAAoC,CAAC,QAAQ,CAAC,CAOhD"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the kinobi library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun kinobi to update it.
5
+ *
6
+ * @see https://github.com/metaplex-foundation/kinobi
7
+ */
8
+ import { Address } from '@solana/addresses';
9
+ import { Codec, Decoder, Encoder } from '@solana/codecs';
10
+ import { IAccountMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData } from '@solana/instructions';
11
+ export type SetLoadedAccountsDataSizeLimitInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
12
+ export type SetLoadedAccountsDataSizeLimitInstructionWithSigners<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
13
+ export type SetLoadedAccountsDataSizeLimitInstructionData = {
14
+ discriminator: number;
15
+ accountDataSizeLimit: number;
16
+ };
17
+ export type SetLoadedAccountsDataSizeLimitInstructionDataArgs = {
18
+ accountDataSizeLimit: number;
19
+ };
20
+ export declare function getSetLoadedAccountsDataSizeLimitInstructionDataEncoder(): Encoder<SetLoadedAccountsDataSizeLimitInstructionDataArgs>;
21
+ export declare function getSetLoadedAccountsDataSizeLimitInstructionDataDecoder(): Decoder<SetLoadedAccountsDataSizeLimitInstructionData>;
22
+ export declare function getSetLoadedAccountsDataSizeLimitInstructionDataCodec(): Codec<SetLoadedAccountsDataSizeLimitInstructionDataArgs, SetLoadedAccountsDataSizeLimitInstructionData>;
23
+ export type SetLoadedAccountsDataSizeLimitInput = {
24
+ accountDataSizeLimit: SetLoadedAccountsDataSizeLimitInstructionDataArgs['accountDataSizeLimit'];
25
+ };
26
+ export type SetLoadedAccountsDataSizeLimitInputWithSigners = {
27
+ accountDataSizeLimit: SetLoadedAccountsDataSizeLimitInstructionDataArgs['accountDataSizeLimit'];
28
+ };
29
+ export declare function getSetLoadedAccountsDataSizeLimitInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: SetLoadedAccountsDataSizeLimitInputWithSigners): SetLoadedAccountsDataSizeLimitInstructionWithSigners<TProgram>;
30
+ export declare function getSetLoadedAccountsDataSizeLimitInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: SetLoadedAccountsDataSizeLimitInput): SetLoadedAccountsDataSizeLimitInstruction<TProgram>;
31
+ export declare function getSetLoadedAccountsDataSizeLimitInstructionRaw<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []>(args: SetLoadedAccountsDataSizeLimitInstructionDataArgs, programAddress?: Address<TProgram>, remainingAccounts?: TRemainingAccounts): SetLoadedAccountsDataSizeLimitInstruction<TProgram, TRemainingAccounts>;
32
+ export type ParsedSetLoadedAccountsDataSizeLimitInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'> = {
33
+ programAddress: Address<TProgram>;
34
+ data: SetLoadedAccountsDataSizeLimitInstructionData;
35
+ };
36
+ export declare function parseSetLoadedAccountsDataSizeLimitInstruction<TProgram extends string>(instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>): ParsedSetLoadedAccountsDataSizeLimitInstruction<TProgram>;
37
+ //# sourceMappingURL=setLoadedAccountsDataSizeLimit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setLoadedAccountsDataSizeLimit.d.ts","sourceRoot":"","sources":["../../../../../src/generated/instructions/setLoadedAccountsDataSizeLimit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EACL,KAAK,EACL,OAAO,EACP,OAAO,EASR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,wBAAwB,EACxB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,yCAAyC,CACnD,QAAQ,SAAS,MAAM,GAAG,6CAA6C,EACvE,kBAAkB,SAAS,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IACzD,YAAY,CAAC,QAAQ,CAAC,GACxB,oBAAoB,CAAC,UAAU,CAAC,GAChC,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;AAE/C,MAAM,MAAM,oDAAoD,CAC9D,QAAQ,SAAS,MAAM,GAAG,6CAA6C,EACvE,kBAAkB,SAAS,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IACzD,YAAY,CAAC,QAAQ,CAAC,GACxB,oBAAoB,CAAC,UAAU,CAAC,GAChC,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;AAE/C,MAAM,MAAM,6CAA6C,GAAG;IAC1D,aAAa,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BAAgB,8CAA8C,CAC5D,QAAQ,SAAS,MAAM,EAEvB,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,UAAU,CAAC,GACrE,+CAA+C,CAAC,QAAQ,CAAC,CAO3D"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the kinobi library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun kinobi to update it.
5
+ *
6
+ * @see https://github.com/metaplex-foundation/kinobi
7
+ */
8
+ import { Address } from '@solana/addresses';
9
+ import { Program } from '@solana/programs';
10
+ import { ParsedRequestHeapFrameInstruction, ParsedRequestUnitsInstruction, ParsedSetComputeUnitLimitInstruction, ParsedSetComputeUnitPriceInstruction, ParsedSetLoadedAccountsDataSizeLimitInstruction } from '../instructions';
11
+ export declare const COMPUTE_BUDGET_PROGRAM_ADDRESS: Address<"ComputeBudget111111111111111111111111111111">;
12
+ export type ComputeBudgetProgram = Program<'ComputeBudget111111111111111111111111111111'>;
13
+ export declare function getComputeBudgetProgram(): ComputeBudgetProgram;
14
+ export declare enum ComputeBudgetInstruction {
15
+ RequestUnits = 0,
16
+ RequestHeapFrame = 1,
17
+ SetComputeUnitLimit = 2,
18
+ SetComputeUnitPrice = 3,
19
+ SetLoadedAccountsDataSizeLimit = 4
20
+ }
21
+ export declare function identifyComputeBudgetInstruction(instruction: {
22
+ data: Uint8Array;
23
+ } | Uint8Array): ComputeBudgetInstruction;
24
+ export type ParsedComputeBudgetInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'> = ({
25
+ instructionType: ComputeBudgetInstruction.RequestUnits;
26
+ } & ParsedRequestUnitsInstruction<TProgram>) | ({
27
+ instructionType: ComputeBudgetInstruction.RequestHeapFrame;
28
+ } & ParsedRequestHeapFrameInstruction<TProgram>) | ({
29
+ instructionType: ComputeBudgetInstruction.SetComputeUnitLimit;
30
+ } & ParsedSetComputeUnitLimitInstruction<TProgram>) | ({
31
+ instructionType: ComputeBudgetInstruction.SetComputeUnitPrice;
32
+ } & ParsedSetComputeUnitPriceInstruction<TProgram>) | ({
33
+ instructionType: ComputeBudgetInstruction.SetLoadedAccountsDataSizeLimit;
34
+ } & ParsedSetLoadedAccountsDataSizeLimitInstruction<TProgram>);
35
+ //# sourceMappingURL=computeBudget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeBudget.d.ts","sourceRoot":"","sources":["../../../../../src/generated/programs/computeBudget.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EACL,iCAAiC,EACjC,6BAA6B,EAC7B,oCAAoC,EACpC,oCAAoC,EACpC,+CAA+C,EAChD,MAAM,iBAAiB,CAAC;AAGzB,eAAO,MAAM,8BAA8B,wDAC8D,CAAC;AAE1G,MAAM,MAAM,oBAAoB,GAC9B,OAAO,CAAC,6CAA6C,CAAC,CAAC;AAEzD,wBAAgB,uBAAuB,IAAI,oBAAoB,CAK9D;AAED,oBAAY,wBAAwB;IAClC,YAAY,IAAA;IACZ,gBAAgB,IAAA;IAChB,mBAAmB,IAAA;IACnB,mBAAmB,IAAA;IACnB,8BAA8B,IAAA;CAC/B;AAED,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,GAC7C,wBAAwB,CAqB1B;AAED,MAAM,MAAM,8BAA8B,CACxC,QAAQ,SAAS,MAAM,GAAG,6CAA6C,IAErE,CAAC;IACC,eAAe,EAAE,wBAAwB,CAAC,YAAY,CAAC;CACxD,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAC,GAC5C,CAAC;IACC,eAAe,EAAE,wBAAwB,CAAC,gBAAgB,CAAC;CAC5D,GAAG,iCAAiC,CAAC,QAAQ,CAAC,CAAC,GAChD,CAAC;IACC,eAAe,EAAE,wBAAwB,CAAC,mBAAmB,CAAC;CAC/D,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC,GACnD,CAAC;IACC,eAAe,EAAE,wBAAwB,CAAC,mBAAmB,CAAC;CAC/D,GAAG,oCAAoC,CAAC,QAAQ,CAAC,CAAC,GACnD,CAAC;IACC,eAAe,EAAE,wBAAwB,CAAC,8BAA8B,CAAC;CAC1E,GAAG,+CAA+C,CAAC,QAAQ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the kinobi library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun kinobi to update it.
5
+ *
6
+ * @see https://github.com/metaplex-foundation/kinobi
7
+ */
8
+ export * from './computeBudget';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/generated/programs/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * This code was AUTOGENERATED using the kinobi library.
3
+ * Please DO NOT EDIT THIS FILE, instead use visitors
4
+ * to add features, then rerun kinobi to update it.
5
+ *
6
+ * @see https://github.com/metaplex-foundation/kinobi
7
+ */
8
+ import { Address, ProgramDerivedAddress } from '@solana/addresses';
9
+ import { AccountRole, IAccountMeta } from '@solana/instructions';
10
+ import { IAccountSignerMeta, TransactionSigner } from '@solana/signers';
11
+ /**
12
+ * Asserts that the given value is not null or undefined.
13
+ * @internal
14
+ */
15
+ export declare function expectSome<T>(value: T | null | undefined): T;
16
+ /**
17
+ * Asserts that the given value is a PublicKey.
18
+ * @internal
19
+ */
20
+ export declare function expectAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): Address<T>;
21
+ /**
22
+ * Asserts that the given value is a PDA.
23
+ * @internal
24
+ */
25
+ export declare function expectProgramDerivedAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): ProgramDerivedAddress<T>;
26
+ /**
27
+ * Asserts that the given value is a TransactionSigner.
28
+ * @internal
29
+ */
30
+ export declare function expectTransactionSigner<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): TransactionSigner<T>;
31
+ /**
32
+ * Defines an instruction account to resolve.
33
+ * @internal
34
+ */
35
+ export type ResolvedAccount<T extends string = string, U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null> = {
36
+ isWritable: boolean;
37
+ value: U;
38
+ };
39
+ /**
40
+ * Add an account meta with a default role if only an address is provided.
41
+ * @internal
42
+ */
43
+ export declare function accountMetaWithDefault<TAccount extends string | IAccountMeta<string>, TRole extends AccountRole>(account: TAccount | undefined, role: TRole): (TAccount extends string ? {
44
+ address: Address<TAccount>;
45
+ role: TRole;
46
+ } : TAccount) | undefined;
47
+ /**
48
+ * Defines an instruction that stores additional bytes on-chain.
49
+ * @internal
50
+ */
51
+ export type IInstructionWithByteDelta = {
52
+ byteDelta: number;
53
+ };
54
+ /**
55
+ * Get account metas and signers from resolved accounts.
56
+ * @internal
57
+ */
58
+ export declare function getAccountMetasWithSigners<TKey extends string = string>(accounts: Record<TKey, ResolvedAccount>, optionalAccountStrategy: 'omitted' | 'programId', programAddress: Address): Record<TKey, IAccountMeta | IAccountSignerMeta>;
59
+ export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
60
+ export declare function memcmp(data: Uint8Array, bytes: Uint8Array, offset: number): boolean;
61
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/generated/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAM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@@ -0,0 +1,14 @@
1
+ import { Commitment, CompilableTransaction, ITransactionWithBlockhashLifetime, Rpc, RpcSubscriptions, SolanaRpcApi, SolanaRpcSubscriptionsApi, TransactionSigner } from '@solana/web3.js';
2
+ type Client = {
3
+ rpc: Rpc<SolanaRpcApi>;
4
+ rpcSubscriptions: RpcSubscriptions<SolanaRpcSubscriptionsApi>;
5
+ };
6
+ export declare const createDefaultSolanaClient: () => Client;
7
+ export declare const generateKeyPairSignerWithSol: (client: Client, putativeLamports?: bigint) => Promise<import("@solana/web3.js").KeyPairSigner<string>>;
8
+ export declare const createDefaultTransaction: (client: Client, feePayer: TransactionSigner) => Promise<ITransactionWithBlockhashLifetime & Omit<import("@solana/web3.js").ITransactionWithFeePayerSigner<string, TransactionSigner<string>> & Readonly<{
9
+ instructions: readonly import("@solana/web3.js").IInstruction<string, readonly (import("@solana/web3.js").IAccountMeta<string> | import("@solana/web3.js").IAccountLookupMeta<string, string>)[]>[];
10
+ version: 0;
11
+ }>, "signatures">>;
12
+ export declare const signAndSendTransaction: (client: Client, transaction: CompilableTransaction & ITransactionWithBlockhashLifetime, commitment?: Commitment) => Promise<import("@solana/web3.js").Signature>;
13
+ export {};
14
+ //# sourceMappingURL=_setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_setup.d.ts","sourceRoot":"","sources":["../../../test/_setup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,iCAAiC,EACjC,GAAG,EACH,gBAAgB,EAChB,YAAY,EACZ,yBAAyB,EACzB,iBAAiB,EAalB,MAAM,iBAAiB,CAAC;AAEzB,KAAK,MAAM,GAAG;IACZ,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,gBAAgB,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,CAAC;CAC/D,CAAC;AAEF,eAAO,MAAM,yBAAyB,QAAO,MAI5C,CAAC;AAEF,eAAO,MAAM,4BAA4B,WAC/B,MAAM,qBACI,MAAM,6DASzB,CAAC;AAEF,eAAO,MAAM,wBAAwB,WAC3B,MAAM,YACJ,iBAAiB;;;kBAU5B,CAAC;AAEF,eAAO,MAAM,sBAAsB,WACzB,MAAM,eACD,qBAAqB,GAAG,iCAAiC,eAC1D,UAAU,iDAQvB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=setComputeUnitLimit.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setComputeUnitLimit.test.d.ts","sourceRoot":"","sources":["../../../test/setComputeUnitLimit.test.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@solana-program/compute-budget",
3
+ "version": "0.1.0",
4
+ "description": "JavaScript client for the Compute Budget program",
5
+ "sideEffects": false,
6
+ "module": "./dist/src/index.mjs",
7
+ "main": "./dist/src/index.js",
8
+ "types": "./dist/types/src/index.d.ts",
9
+ "type": "module",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/types/src/index.d.ts",
13
+ "import": "./dist/src/index.mjs",
14
+ "require": "./dist/src/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "./dist/src",
19
+ "./dist/types"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public",
23
+ "registry": "https://registry.npmjs.org"
24
+ },
25
+ "license": "MIT",
26
+ "dependencies": {
27
+ "@solana/accounts": "^2.0.0-preview",
28
+ "@solana/addresses": "^2.0.0-preview",
29
+ "@solana/codecs": "^2.0.0-preview",
30
+ "@solana/instructions": "^2.0.0-preview",
31
+ "@solana/programs": "^2.0.0-preview",
32
+ "@solana/signers": "^2.0.0-preview"
33
+ },
34
+ "devDependencies": {
35
+ "@ava/typescript": "^4.1.0",
36
+ "@solana/web3.js": "^2.0.0-preview",
37
+ "@solana/webcrypto-ed25519-polyfill": "^2.0.0-preview",
38
+ "@typescript-eslint/eslint-plugin": "^7.0.2",
39
+ "@typescript-eslint/parser": "^7.0.2",
40
+ "ava": "^6.1.1",
41
+ "eslint": "^8.0.1",
42
+ "eslint-config-airbnb-typescript": "^17.0.0",
43
+ "eslint-config-prettier": "^8.5.0",
44
+ "eslint-plugin-import": "^2.26.0",
45
+ "eslint-plugin-prettier": "^4.2.1",
46
+ "prettier": "^2.5.1",
47
+ "rimraf": "^5.0.5",
48
+ "tsup": "^8.0.2",
49
+ "typedoc": "^0.25.8",
50
+ "typedoc-plugin-expand-object-like-types": "^0.1.2",
51
+ "typedoc-plugin-missing-exports": "^2.2.0",
52
+ "typescript": "^5.3.3"
53
+ },
54
+ "ava": {
55
+ "require": [
56
+ "@solana/webcrypto-ed25519-polyfill"
57
+ ],
58
+ "typescript": {
59
+ "compile": false,
60
+ "rewritePaths": {
61
+ "test/": "dist/test/"
62
+ }
63
+ }
64
+ },
65
+ "packageManager": "pnpm@8.2.0",
66
+ "scripts": {
67
+ "build": "rimraf dist && tsup && tsc -p ./tsconfig.declarations.json",
68
+ "build:docs": "typedoc",
69
+ "test": "ava",
70
+ "lint": "eslint --ext js,ts,tsx src",
71
+ "lint:fix": "eslint --fix --ext js,ts,tsx src",
72
+ "format": "prettier --check src test",
73
+ "format:fix": "prettier --write src test"
74
+ }
75
+ }