@solana-program/compute-budget 0.1.1 → 0.2.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 CHANGED
@@ -1,8 +1,105 @@
1
- import { mapEncoder, getStructEncoder, getU8Encoder, getU32Encoder, getStructDecoder, getU8Decoder, getU32Decoder, combineCodec, getU64Encoder, getU64Decoder } from '@solana/codecs';
1
+ import { getU8Encoder, mapEncoder, getStructEncoder, getU32Encoder, getStructDecoder, getU8Decoder, getU32Decoder, combineCodec, getU64Encoder, getU64Decoder } from '@solana/codecs';
2
2
  import { isProgramDerivedAddress } from '@solana/addresses';
3
3
  import { AccountRole, upgradeRoleToSigner } from '@solana/instructions';
4
4
  import { isTransactionSigner as isTransactionSigner$1 } from '@solana/signers';
5
5
 
6
+ // src/generated/instructions/requestHeapFrame.ts
7
+ function expectSome(value) {
8
+ if (value == null) {
9
+ throw new Error("Expected a value but received null or undefined.");
10
+ }
11
+ return value;
12
+ }
13
+ function expectAddress(value) {
14
+ if (!value) {
15
+ throw new Error("Expected a Address.");
16
+ }
17
+ if (typeof value === "object" && "address" in value) {
18
+ return value.address;
19
+ }
20
+ if (Array.isArray(value)) {
21
+ return value[0];
22
+ }
23
+ return value;
24
+ }
25
+ function expectProgramDerivedAddress(value) {
26
+ if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {
27
+ throw new Error("Expected a ProgramDerivedAddress.");
28
+ }
29
+ return value;
30
+ }
31
+ function expectTransactionSigner(value) {
32
+ if (!value || !isTransactionSigner(value)) {
33
+ throw new Error("Expected a TransactionSigner.");
34
+ }
35
+ return value;
36
+ }
37
+ function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
38
+ return (account) => {
39
+ if (!account.value) {
40
+ if (optionalAccountStrategy === "omitted")
41
+ return;
42
+ return Object.freeze({
43
+ address: programAddress,
44
+ role: AccountRole.READONLY
45
+ });
46
+ }
47
+ const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
48
+ return Object.freeze({
49
+ address: expectAddress(account.value),
50
+ role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole,
51
+ ...isTransactionSigner(account.value) ? { signer: account.value } : {}
52
+ });
53
+ };
54
+ }
55
+ function isTransactionSigner(value) {
56
+ return !!value && typeof value === "object" && "address" in value && isTransactionSigner$1(value);
57
+ }
58
+ function memcmp(data, bytes, offset) {
59
+ const slice = data.slice(offset, offset + bytes.length);
60
+ if (slice.length !== bytes.length)
61
+ return false;
62
+ return bytes.every((b, i) => b === slice[i]);
63
+ }
64
+
65
+ // src/generated/programs/computeBudget.ts
66
+ var COMPUTE_BUDGET_PROGRAM_ADDRESS = "ComputeBudget111111111111111111111111111111";
67
+ function getComputeBudgetProgram() {
68
+ return {
69
+ name: "computeBudget",
70
+ address: COMPUTE_BUDGET_PROGRAM_ADDRESS
71
+ };
72
+ }
73
+ var ComputeBudgetInstruction = /* @__PURE__ */ ((ComputeBudgetInstruction2) => {
74
+ ComputeBudgetInstruction2[ComputeBudgetInstruction2["RequestUnits"] = 0] = "RequestUnits";
75
+ ComputeBudgetInstruction2[ComputeBudgetInstruction2["RequestHeapFrame"] = 1] = "RequestHeapFrame";
76
+ ComputeBudgetInstruction2[ComputeBudgetInstruction2["SetComputeUnitLimit"] = 2] = "SetComputeUnitLimit";
77
+ ComputeBudgetInstruction2[ComputeBudgetInstruction2["SetComputeUnitPrice"] = 3] = "SetComputeUnitPrice";
78
+ ComputeBudgetInstruction2[ComputeBudgetInstruction2["SetLoadedAccountsDataSizeLimit"] = 4] = "SetLoadedAccountsDataSizeLimit";
79
+ return ComputeBudgetInstruction2;
80
+ })(ComputeBudgetInstruction || {});
81
+ function identifyComputeBudgetInstruction(instruction) {
82
+ const data = instruction instanceof Uint8Array ? instruction : instruction.data;
83
+ if (memcmp(data, getU8Encoder().encode(0), 0)) {
84
+ return 0 /* RequestUnits */;
85
+ }
86
+ if (memcmp(data, getU8Encoder().encode(1), 0)) {
87
+ return 1 /* RequestHeapFrame */;
88
+ }
89
+ if (memcmp(data, getU8Encoder().encode(2), 0)) {
90
+ return 2 /* SetComputeUnitLimit */;
91
+ }
92
+ if (memcmp(data, getU8Encoder().encode(3), 0)) {
93
+ return 3 /* SetComputeUnitPrice */;
94
+ }
95
+ if (memcmp(data, getU8Encoder().encode(4), 0)) {
96
+ return 4 /* SetLoadedAccountsDataSizeLimit */;
97
+ }
98
+ throw new Error(
99
+ "The provided instruction could not be identified as a computeBudget instruction."
100
+ );
101
+ }
102
+
6
103
  // src/generated/instructions/requestHeapFrame.ts
7
104
  function getRequestHeapFrameInstructionDataEncoder() {
8
105
  return mapEncoder(
@@ -26,20 +123,15 @@ function getRequestHeapFrameInstructionDataCodec() {
26
123
  );
27
124
  }
28
125
  function getRequestHeapFrameInstruction(input) {
29
- const programAddress = "ComputeBudget111111111111111111111111111111";
126
+ const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
30
127
  const args = { ...input };
31
- const instruction = getRequestHeapFrameInstructionRaw(
32
- args,
33
- programAddress
34
- );
35
- return instruction;
36
- }
37
- function getRequestHeapFrameInstructionRaw(args, programAddress = "ComputeBudget111111111111111111111111111111", remainingAccounts) {
38
- return {
39
- accounts: remainingAccounts ?? [],
40
- data: getRequestHeapFrameInstructionDataEncoder().encode(args),
41
- programAddress
128
+ const instruction = {
129
+ programAddress,
130
+ data: getRequestHeapFrameInstructionDataEncoder().encode(
131
+ args
132
+ )
42
133
  };
134
+ return instruction;
43
135
  }
44
136
  function parseRequestHeapFrameInstruction(instruction) {
45
137
  return {
@@ -71,20 +163,15 @@ function getRequestUnitsInstructionDataCodec() {
71
163
  );
72
164
  }
73
165
  function getRequestUnitsInstruction(input) {
74
- const programAddress = "ComputeBudget111111111111111111111111111111";
166
+ const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
75
167
  const args = { ...input };
76
- const instruction = getRequestUnitsInstructionRaw(
77
- args,
78
- programAddress
79
- );
80
- return instruction;
81
- }
82
- function getRequestUnitsInstructionRaw(args, programAddress = "ComputeBudget111111111111111111111111111111", remainingAccounts) {
83
- return {
84
- accounts: remainingAccounts ?? [],
85
- data: getRequestUnitsInstructionDataEncoder().encode(args),
86
- programAddress
168
+ const instruction = {
169
+ programAddress,
170
+ data: getRequestUnitsInstructionDataEncoder().encode(
171
+ args
172
+ )
87
173
  };
174
+ return instruction;
88
175
  }
89
176
  function parseRequestUnitsInstruction(instruction) {
90
177
  return {
@@ -114,20 +201,15 @@ function getSetComputeUnitLimitInstructionDataCodec() {
114
201
  );
115
202
  }
116
203
  function getSetComputeUnitLimitInstruction(input) {
117
- const programAddress = "ComputeBudget111111111111111111111111111111";
204
+ const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
118
205
  const args = { ...input };
119
- const instruction = getSetComputeUnitLimitInstructionRaw(
120
- args,
121
- programAddress
122
- );
123
- return instruction;
124
- }
125
- function getSetComputeUnitLimitInstructionRaw(args, programAddress = "ComputeBudget111111111111111111111111111111", remainingAccounts) {
126
- return {
127
- accounts: remainingAccounts ?? [],
128
- data: getSetComputeUnitLimitInstructionDataEncoder().encode(args),
129
- programAddress
206
+ const instruction = {
207
+ programAddress,
208
+ data: getSetComputeUnitLimitInstructionDataEncoder().encode(
209
+ args
210
+ )
130
211
  };
212
+ return instruction;
131
213
  }
132
214
  function parseSetComputeUnitLimitInstruction(instruction) {
133
215
  return {
@@ -159,20 +241,15 @@ function getSetComputeUnitPriceInstructionDataCodec() {
159
241
  );
160
242
  }
161
243
  function getSetComputeUnitPriceInstruction(input) {
162
- const programAddress = "ComputeBudget111111111111111111111111111111";
244
+ const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
163
245
  const args = { ...input };
164
- const instruction = getSetComputeUnitPriceInstructionRaw(
165
- args,
166
- programAddress
167
- );
168
- return instruction;
169
- }
170
- function getSetComputeUnitPriceInstructionRaw(args, programAddress = "ComputeBudget111111111111111111111111111111", remainingAccounts) {
171
- return {
172
- accounts: remainingAccounts ?? [],
173
- data: getSetComputeUnitPriceInstructionDataEncoder().encode(args),
174
- programAddress
246
+ const instruction = {
247
+ programAddress,
248
+ data: getSetComputeUnitPriceInstructionDataEncoder().encode(
249
+ args
250
+ )
175
251
  };
252
+ return instruction;
176
253
  }
177
254
  function parseSetComputeUnitPriceInstruction(instruction) {
178
255
  return {
@@ -204,22 +281,15 @@ function getSetLoadedAccountsDataSizeLimitInstructionDataCodec() {
204
281
  );
205
282
  }
206
283
  function getSetLoadedAccountsDataSizeLimitInstruction(input) {
207
- const programAddress = "ComputeBudget111111111111111111111111111111";
284
+ const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
208
285
  const args = { ...input };
209
- const instruction = getSetLoadedAccountsDataSizeLimitInstructionRaw(
210
- args,
211
- programAddress
212
- );
213
- return instruction;
214
- }
215
- function getSetLoadedAccountsDataSizeLimitInstructionRaw(args, programAddress = "ComputeBudget111111111111111111111111111111", remainingAccounts) {
216
- return {
217
- accounts: remainingAccounts ?? [],
286
+ const instruction = {
287
+ programAddress,
218
288
  data: getSetLoadedAccountsDataSizeLimitInstructionDataEncoder().encode(
219
289
  args
220
- ),
221
- programAddress
290
+ )
222
291
  };
292
+ return instruction;
223
293
  }
224
294
  function parseSetLoadedAccountsDataSizeLimitInstruction(instruction) {
225
295
  return {
@@ -229,111 +299,7 @@ function parseSetLoadedAccountsDataSizeLimitInstruction(instruction) {
229
299
  )
230
300
  };
231
301
  }
232
- function expectSome(value) {
233
- if (value == null) {
234
- throw new Error("Expected a value but received null or undefined.");
235
- }
236
- return value;
237
- }
238
- function expectAddress(value) {
239
- if (!value) {
240
- throw new Error("Expected a Address.");
241
- }
242
- if (typeof value === "object" && "address" in value) {
243
- return value.address;
244
- }
245
- if (Array.isArray(value)) {
246
- return value[0];
247
- }
248
- return value;
249
- }
250
- function expectProgramDerivedAddress(value) {
251
- if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {
252
- throw new Error("Expected a ProgramDerivedAddress.");
253
- }
254
- return value;
255
- }
256
- function expectTransactionSigner(value) {
257
- if (!value || !isTransactionSigner(value)) {
258
- throw new Error("Expected a TransactionSigner.");
259
- }
260
- return value;
261
- }
262
- function accountMetaWithDefault(account, role) {
263
- if (account === void 0)
264
- return void 0;
265
- return typeof account === "string" ? { address: account, role } : account;
266
- }
267
- function getAccountMetasWithSigners(accounts, optionalAccountStrategy, programAddress) {
268
- const accountMetas = {};
269
- Object.keys(accounts).forEach((key) => {
270
- const account = accounts[key];
271
- if (!account.value) {
272
- if (optionalAccountStrategy === "omitted")
273
- return;
274
- accountMetas[key] = {
275
- address: programAddress,
276
- role: AccountRole.READONLY
277
- };
278
- return;
279
- }
280
- const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
281
- accountMetas[key] = Object.freeze({
282
- address: expectAddress(account.value),
283
- role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole,
284
- ...isTransactionSigner(account.value) ? { signer: account.value } : {}
285
- });
286
- });
287
- return accountMetas;
288
- }
289
- function isTransactionSigner(value) {
290
- return !!value && typeof value === "object" && "address" in value && isTransactionSigner$1(value);
291
- }
292
- function memcmp(data, bytes, offset) {
293
- const slice = data.slice(offset, offset + bytes.length);
294
- if (slice.length !== bytes.length)
295
- return false;
296
- return bytes.every((b, i) => b === slice[i]);
297
- }
298
-
299
- // src/generated/programs/computeBudget.ts
300
- var COMPUTE_BUDGET_PROGRAM_ADDRESS = "ComputeBudget111111111111111111111111111111";
301
- function getComputeBudgetProgram() {
302
- return {
303
- name: "computeBudget",
304
- address: COMPUTE_BUDGET_PROGRAM_ADDRESS
305
- };
306
- }
307
- var ComputeBudgetInstruction = /* @__PURE__ */ ((ComputeBudgetInstruction2) => {
308
- ComputeBudgetInstruction2[ComputeBudgetInstruction2["RequestUnits"] = 0] = "RequestUnits";
309
- ComputeBudgetInstruction2[ComputeBudgetInstruction2["RequestHeapFrame"] = 1] = "RequestHeapFrame";
310
- ComputeBudgetInstruction2[ComputeBudgetInstruction2["SetComputeUnitLimit"] = 2] = "SetComputeUnitLimit";
311
- ComputeBudgetInstruction2[ComputeBudgetInstruction2["SetComputeUnitPrice"] = 3] = "SetComputeUnitPrice";
312
- ComputeBudgetInstruction2[ComputeBudgetInstruction2["SetLoadedAccountsDataSizeLimit"] = 4] = "SetLoadedAccountsDataSizeLimit";
313
- return ComputeBudgetInstruction2;
314
- })(ComputeBudgetInstruction || {});
315
- function identifyComputeBudgetInstruction(instruction) {
316
- const data = instruction instanceof Uint8Array ? instruction : instruction.data;
317
- if (memcmp(data, getU8Encoder().encode(0), 0)) {
318
- return 0 /* RequestUnits */;
319
- }
320
- if (memcmp(data, getU8Encoder().encode(1), 0)) {
321
- return 1 /* RequestHeapFrame */;
322
- }
323
- if (memcmp(data, getU8Encoder().encode(2), 0)) {
324
- return 2 /* SetComputeUnitLimit */;
325
- }
326
- if (memcmp(data, getU8Encoder().encode(3), 0)) {
327
- return 3 /* SetComputeUnitPrice */;
328
- }
329
- if (memcmp(data, getU8Encoder().encode(4), 0)) {
330
- return 4 /* SetLoadedAccountsDataSizeLimit */;
331
- }
332
- throw new Error(
333
- "The provided instruction could not be identified as a computeBudget instruction."
334
- );
335
- }
336
302
 
337
- export { COMPUTE_BUDGET_PROGRAM_ADDRESS, ComputeBudgetInstruction, accountMetaWithDefault, expectAddress, expectProgramDerivedAddress, expectSome, expectTransactionSigner, getAccountMetasWithSigners, getComputeBudgetProgram, getRequestHeapFrameInstruction, getRequestHeapFrameInstructionDataCodec, getRequestHeapFrameInstructionDataDecoder, getRequestHeapFrameInstructionDataEncoder, getRequestHeapFrameInstructionRaw, getRequestUnitsInstruction, getRequestUnitsInstructionDataCodec, getRequestUnitsInstructionDataDecoder, getRequestUnitsInstructionDataEncoder, getRequestUnitsInstructionRaw, getSetComputeUnitLimitInstruction, getSetComputeUnitLimitInstructionDataCodec, getSetComputeUnitLimitInstructionDataDecoder, getSetComputeUnitLimitInstructionDataEncoder, getSetComputeUnitLimitInstructionRaw, getSetComputeUnitPriceInstruction, getSetComputeUnitPriceInstructionDataCodec, getSetComputeUnitPriceInstructionDataDecoder, getSetComputeUnitPriceInstructionDataEncoder, getSetComputeUnitPriceInstructionRaw, getSetLoadedAccountsDataSizeLimitInstruction, getSetLoadedAccountsDataSizeLimitInstructionDataCodec, getSetLoadedAccountsDataSizeLimitInstructionDataDecoder, getSetLoadedAccountsDataSizeLimitInstructionDataEncoder, getSetLoadedAccountsDataSizeLimitInstructionRaw, identifyComputeBudgetInstruction, isTransactionSigner, memcmp, parseRequestHeapFrameInstruction, parseRequestUnitsInstruction, parseSetComputeUnitLimitInstruction, parseSetComputeUnitPriceInstruction, parseSetLoadedAccountsDataSizeLimitInstruction };
303
+ export { COMPUTE_BUDGET_PROGRAM_ADDRESS, ComputeBudgetInstruction, expectAddress, expectProgramDerivedAddress, expectSome, expectTransactionSigner, getAccountMetaFactory, getComputeBudgetProgram, getRequestHeapFrameInstruction, getRequestHeapFrameInstructionDataCodec, getRequestHeapFrameInstructionDataDecoder, getRequestHeapFrameInstructionDataEncoder, getRequestUnitsInstruction, getRequestUnitsInstructionDataCodec, getRequestUnitsInstructionDataDecoder, getRequestUnitsInstructionDataEncoder, getSetComputeUnitLimitInstruction, getSetComputeUnitLimitInstructionDataCodec, getSetComputeUnitLimitInstructionDataDecoder, getSetComputeUnitLimitInstructionDataEncoder, getSetComputeUnitPriceInstruction, getSetComputeUnitPriceInstructionDataCodec, getSetComputeUnitPriceInstructionDataDecoder, getSetComputeUnitPriceInstructionDataEncoder, getSetLoadedAccountsDataSizeLimitInstruction, getSetLoadedAccountsDataSizeLimitInstructionDataCodec, getSetLoadedAccountsDataSizeLimitInstructionDataDecoder, getSetLoadedAccountsDataSizeLimitInstructionDataEncoder, identifyComputeBudgetInstruction, isTransactionSigner, memcmp, parseRequestHeapFrameInstruction, parseRequestUnitsInstruction, parseSetComputeUnitLimitInstruction, parseSetComputeUnitPriceInstruction, parseSetLoadedAccountsDataSizeLimitInstruction };
338
304
  //# sourceMappingURL=out.js.map
339
305
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/generated/instructions/requestHeapFrame.ts","../../src/generated/instructions/requestUnits.ts","../../src/generated/instructions/setComputeUnitLimit.ts","../../src/generated/instructions/setComputeUnitPrice.ts","../../src/generated/instructions/setLoadedAccountsDataSizeLimit.ts","../../src/generated/programs/computeBudget.ts","../../src/generated/shared/index.ts"],"names":["combineCodec","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU8Decoder","getU8Encoder","mapEncoder","ComputeBudgetInstruction"],"mappings":";AASA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAuCA,SAAS,4CAA0F;AACxG,SAAO;AAAA,IACL,iBAAiB;AAAA,MACf,CAAC,iBAAiB,aAAa,CAAC;AAAA,MAChC,CAAC,SAAS,cAAc,CAAC;AAAA,IAC3B,CAAC;AAAA,IACD,CAAC,WAAW,EAAE,GAAG,OAAO,eAAe,EAAE;AAAA,EAC3C;AACF;AAEO,SAAS,4CAAsF;AACpG,SAAO,iBAAiB;AAAA,IACtB,CAAC,iBAAiB,aAAa,CAAC;AAAA,IAChC,CAAC,SAAS,cAAc,CAAC;AAAA,EAC3B,CAAC;AACH;AAEO,SAAS,0CAGd;AACA,SAAO;AAAA,IACL,0CAA0C;AAAA,IAC1C,0CAA0C;AAAA,EAC5C;AACF;AAkBO,SAAS,+BACd,OACc;AAEd,QAAM,iBACJ;AAGF,QAAM,OAAO,EAAE,GAAG,MAAM;AAExB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,kCAId,MACA,iBAAoC,+CACpC,mBACA;AACA,SAAO;AAAA,IACL,UAAU,qBAAqB,CAAC;AAAA,IAChC,MAAM,0CAA0C,EAAE,OAAO,IAAI;AAAA,IAC7D;AAAA,E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;AAEnC;AAEO,SAAS,OAAO,MAAkB,OAAmB,QAAgB;AAC1E,QAAM,QAAQ,KAAK,MAAM,QAAQ,SAAS,MAAM,MAAM;AACtD,MAAI,MAAM,WAAW,MAAM;AAAQ,WAAO;AAC1C,SAAO,MAAM,MAAM,CAAC,GAAG,MAAM,MAAM,MAAM,CAAC,CAAC;AAC7C;;;AD1KO,IAAM,iCACX;AAKK,SAAS,0BAAgD;AAC9D,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACF;AAEO,IAAK,2BAAL,kBAAKE,8BAAL;AACL,EAAAA,oDAAA;AACA,EAAAA,oDAAA;AACA,EAAAA,oDAAA;AACA,EAAAA,oDAAA;AACA,EAAAA,oDAAA;AALU,SAAAA;AAAA,GAAA;AAQL,SAAS,iCACd,aAC0B;AAC1B,QAAM,OACJ,uBAAuB,aAAa,cAAc,YAAY;AAChE,MAAI,OAAO,MAAMF,cAAa,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;AAC7C,WAAO;AAAA,EACT;AACA,MAAI,OAAO,MAAMA,cAAa,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;AAC7C,WAAO;AAAA,EACT;AACA,MAAI,OAAO,MAAMA,cAAa,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;AAC7C,WAAO;AAAA,EACT;AACA,MAAI,OAAO,MAAMA,cAAa,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;AAC7C,WAAO;AAAA,EACT;AACA,MAAI,OAAO,MAAMA,cAAa,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG;AAC7C,WAAO;AAAA,EACT;AACA,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF","sourcesContent":["/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\n\nexport type RequestHeapFrameInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type RequestHeapFrameInstructionWithSigners<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type RequestHeapFrameInstructionData = {\n discriminator: number;\n /**\n * Requested transaction-wide program heap size in bytes.\n * Must be multiple of 1024. Applies to each program, including CPIs.\n */\n bytes: number;\n};\n\nexport type RequestHeapFrameInstructionDataArgs = {\n /**\n * Requested transaction-wide program heap size in bytes.\n * Must be multiple of 1024. Applies to each program, including CPIs.\n */\n bytes: number;\n};\n\nexport function getRequestHeapFrameInstructionDataEncoder(): Encoder<RequestHeapFrameInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['bytes', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 1 })\n );\n}\n\nexport function getRequestHeapFrameInstructionDataDecoder(): Decoder<RequestHeapFrameInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['bytes', getU32Decoder()],\n ]);\n}\n\nexport function getRequestHeapFrameInstructionDataCodec(): Codec<\n RequestHeapFrameInstructionDataArgs,\n RequestHeapFrameInstructionData\n> {\n return combineCodec(\n getRequestHeapFrameInstructionDataEncoder(),\n getRequestHeapFrameInstructionDataDecoder()\n );\n}\n\nexport type RequestHeapFrameInput = {\n bytes: RequestHeapFrameInstructionDataArgs['bytes'];\n};\n\nexport type RequestHeapFrameInputWithSigners = {\n bytes: RequestHeapFrameInstructionDataArgs['bytes'];\n};\n\nexport function getRequestHeapFrameInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(\n input: RequestHeapFrameInputWithSigners\n): RequestHeapFrameInstructionWithSigners<TProgram>;\nexport function getRequestHeapFrameInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(input: RequestHeapFrameInput): RequestHeapFrameInstruction<TProgram>;\nexport function getRequestHeapFrameInstruction(\n input: RequestHeapFrameInput\n): IInstruction {\n // Program address.\n const programAddress =\n 'ComputeBudget111111111111111111111111111111' as Address<'ComputeBudget111111111111111111111111111111'>;\n\n // Original args.\n const args = { ...input };\n\n const instruction = getRequestHeapFrameInstructionRaw(\n args as RequestHeapFrameInstructionDataArgs,\n programAddress\n );\n\n return instruction;\n}\n\nexport function getRequestHeapFrameInstructionRaw<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n>(\n args: RequestHeapFrameInstructionDataArgs,\n programAddress: Address<TProgram> = 'ComputeBudget111111111111111111111111111111' as Address<TProgram>,\n remainingAccounts?: TRemainingAccounts\n) {\n return {\n accounts: remainingAccounts ?? [],\n data: getRequestHeapFrameInstructionDataEncoder().encode(args),\n programAddress,\n } as RequestHeapFrameInstruction<TProgram, TRemainingAccounts>;\n}\n\nexport type ParsedRequestHeapFrameInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n> = {\n programAddress: Address<TProgram>;\n data: RequestHeapFrameInstructionData;\n};\n\nexport function parseRequestHeapFrameInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedRequestHeapFrameInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getRequestHeapFrameInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\n\nexport type RequestUnitsInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type RequestUnitsInstructionWithSigners<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type RequestUnitsInstructionData = {\n discriminator: number;\n /** Units to request for transaction-wide compute. */\n units: number;\n /** Prioritization fee lamports. */\n additionalFee: number;\n};\n\nexport type RequestUnitsInstructionDataArgs = {\n /** Units to request for transaction-wide compute. */\n units: number;\n /** Prioritization fee lamports. */\n additionalFee: number;\n};\n\nexport function getRequestUnitsInstructionDataEncoder(): Encoder<RequestUnitsInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['units', getU32Encoder()],\n ['additionalFee', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 0 })\n );\n}\n\nexport function getRequestUnitsInstructionDataDecoder(): Decoder<RequestUnitsInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['units', getU32Decoder()],\n ['additionalFee', getU32Decoder()],\n ]);\n}\n\nexport function getRequestUnitsInstructionDataCodec(): Codec<\n RequestUnitsInstructionDataArgs,\n RequestUnitsInstructionData\n> {\n return combineCodec(\n getRequestUnitsInstructionDataEncoder(),\n getRequestUnitsInstructionDataDecoder()\n );\n}\n\nexport type RequestUnitsInput = {\n units: RequestUnitsInstructionDataArgs['units'];\n additionalFee: RequestUnitsInstructionDataArgs['additionalFee'];\n};\n\nexport type RequestUnitsInputWithSigners = {\n units: RequestUnitsInstructionDataArgs['units'];\n additionalFee: RequestUnitsInstructionDataArgs['additionalFee'];\n};\n\nexport function getRequestUnitsInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(\n input: RequestUnitsInputWithSigners\n): RequestUnitsInstructionWithSigners<TProgram>;\nexport function getRequestUnitsInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(input: RequestUnitsInput): RequestUnitsInstruction<TProgram>;\nexport function getRequestUnitsInstruction(\n input: RequestUnitsInput\n): IInstruction {\n // Program address.\n const programAddress =\n 'ComputeBudget111111111111111111111111111111' as Address<'ComputeBudget111111111111111111111111111111'>;\n\n // Original args.\n const args = { ...input };\n\n const instruction = getRequestUnitsInstructionRaw(\n args as RequestUnitsInstructionDataArgs,\n programAddress\n );\n\n return instruction;\n}\n\nexport function getRequestUnitsInstructionRaw<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n>(\n args: RequestUnitsInstructionDataArgs,\n programAddress: Address<TProgram> = 'ComputeBudget111111111111111111111111111111' as Address<TProgram>,\n remainingAccounts?: TRemainingAccounts\n) {\n return {\n accounts: remainingAccounts ?? [],\n data: getRequestUnitsInstructionDataEncoder().encode(args),\n programAddress,\n } as RequestUnitsInstruction<TProgram, TRemainingAccounts>;\n}\n\nexport type ParsedRequestUnitsInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n> = {\n programAddress: Address<TProgram>;\n data: RequestUnitsInstructionData;\n};\n\nexport function parseRequestUnitsInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedRequestUnitsInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getRequestUnitsInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\n\nexport type SetComputeUnitLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetComputeUnitLimitInstructionWithSigners<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetComputeUnitLimitInstructionData = {\n discriminator: number;\n /** Transaction-wide compute unit limit. */\n units: number;\n};\n\nexport type SetComputeUnitLimitInstructionDataArgs = {\n /** Transaction-wide compute unit limit. */\n units: number;\n};\n\nexport function getSetComputeUnitLimitInstructionDataEncoder(): Encoder<SetComputeUnitLimitInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['units', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 2 })\n );\n}\n\nexport function getSetComputeUnitLimitInstructionDataDecoder(): Decoder<SetComputeUnitLimitInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['units', getU32Decoder()],\n ]);\n}\n\nexport function getSetComputeUnitLimitInstructionDataCodec(): Codec<\n SetComputeUnitLimitInstructionDataArgs,\n SetComputeUnitLimitInstructionData\n> {\n return combineCodec(\n getSetComputeUnitLimitInstructionDataEncoder(),\n getSetComputeUnitLimitInstructionDataDecoder()\n );\n}\n\nexport type SetComputeUnitLimitInput = {\n units: SetComputeUnitLimitInstructionDataArgs['units'];\n};\n\nexport type SetComputeUnitLimitInputWithSigners = {\n units: SetComputeUnitLimitInstructionDataArgs['units'];\n};\n\nexport function getSetComputeUnitLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(\n input: SetComputeUnitLimitInputWithSigners\n): SetComputeUnitLimitInstructionWithSigners<TProgram>;\nexport function getSetComputeUnitLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(input: SetComputeUnitLimitInput): SetComputeUnitLimitInstruction<TProgram>;\nexport function getSetComputeUnitLimitInstruction(\n input: SetComputeUnitLimitInput\n): IInstruction {\n // Program address.\n const programAddress =\n 'ComputeBudget111111111111111111111111111111' as Address<'ComputeBudget111111111111111111111111111111'>;\n\n // Original args.\n const args = { ...input };\n\n const instruction = getSetComputeUnitLimitInstructionRaw(\n args as SetComputeUnitLimitInstructionDataArgs,\n programAddress\n );\n\n return instruction;\n}\n\nexport function getSetComputeUnitLimitInstructionRaw<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n>(\n args: SetComputeUnitLimitInstructionDataArgs,\n programAddress: Address<TProgram> = 'ComputeBudget111111111111111111111111111111' as Address<TProgram>,\n remainingAccounts?: TRemainingAccounts\n) {\n return {\n accounts: remainingAccounts ?? [],\n data: getSetComputeUnitLimitInstructionDataEncoder().encode(args),\n programAddress,\n } as SetComputeUnitLimitInstruction<TProgram, TRemainingAccounts>;\n}\n\nexport type ParsedSetComputeUnitLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n> = {\n programAddress: Address<TProgram>;\n data: SetComputeUnitLimitInstructionData;\n};\n\nexport function parseSetComputeUnitLimitInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedSetComputeUnitLimitInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getSetComputeUnitLimitInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\n\nexport type SetComputeUnitPriceInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetComputeUnitPriceInstructionWithSigners<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetComputeUnitPriceInstructionData = {\n discriminator: number;\n /** Transaction compute unit price used for prioritization fees. */\n microLamports: bigint;\n};\n\nexport type SetComputeUnitPriceInstructionDataArgs = {\n /** Transaction compute unit price used for prioritization fees. */\n microLamports: number | bigint;\n};\n\nexport function getSetComputeUnitPriceInstructionDataEncoder(): Encoder<SetComputeUnitPriceInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['microLamports', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 3 })\n );\n}\n\nexport function getSetComputeUnitPriceInstructionDataDecoder(): Decoder<SetComputeUnitPriceInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['microLamports', getU64Decoder()],\n ]);\n}\n\nexport function getSetComputeUnitPriceInstructionDataCodec(): Codec<\n SetComputeUnitPriceInstructionDataArgs,\n SetComputeUnitPriceInstructionData\n> {\n return combineCodec(\n getSetComputeUnitPriceInstructionDataEncoder(),\n getSetComputeUnitPriceInstructionDataDecoder()\n );\n}\n\nexport type SetComputeUnitPriceInput = {\n microLamports: SetComputeUnitPriceInstructionDataArgs['microLamports'];\n};\n\nexport type SetComputeUnitPriceInputWithSigners = {\n microLamports: SetComputeUnitPriceInstructionDataArgs['microLamports'];\n};\n\nexport function getSetComputeUnitPriceInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(\n input: SetComputeUnitPriceInputWithSigners\n): SetComputeUnitPriceInstructionWithSigners<TProgram>;\nexport function getSetComputeUnitPriceInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(input: SetComputeUnitPriceInput): SetComputeUnitPriceInstruction<TProgram>;\nexport function getSetComputeUnitPriceInstruction(\n input: SetComputeUnitPriceInput\n): IInstruction {\n // Program address.\n const programAddress =\n 'ComputeBudget111111111111111111111111111111' as Address<'ComputeBudget111111111111111111111111111111'>;\n\n // Original args.\n const args = { ...input };\n\n const instruction = getSetComputeUnitPriceInstructionRaw(\n args as SetComputeUnitPriceInstructionDataArgs,\n programAddress\n );\n\n return instruction;\n}\n\nexport function getSetComputeUnitPriceInstructionRaw<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n>(\n args: SetComputeUnitPriceInstructionDataArgs,\n programAddress: Address<TProgram> = 'ComputeBudget111111111111111111111111111111' as Address<TProgram>,\n remainingAccounts?: TRemainingAccounts\n) {\n return {\n accounts: remainingAccounts ?? [],\n data: getSetComputeUnitPriceInstructionDataEncoder().encode(args),\n programAddress,\n } as SetComputeUnitPriceInstruction<TProgram, TRemainingAccounts>;\n}\n\nexport type ParsedSetComputeUnitPriceInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n> = {\n programAddress: Address<TProgram>;\n data: SetComputeUnitPriceInstructionData;\n};\n\nexport function parseSetComputeUnitPriceInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedSetComputeUnitPriceInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getSetComputeUnitPriceInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\n\nexport type SetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetLoadedAccountsDataSizeLimitInstructionWithSigners<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetLoadedAccountsDataSizeLimitInstructionData = {\n discriminator: number;\n accountDataSizeLimit: number;\n};\n\nexport type SetLoadedAccountsDataSizeLimitInstructionDataArgs = {\n accountDataSizeLimit: number;\n};\n\nexport function getSetLoadedAccountsDataSizeLimitInstructionDataEncoder(): Encoder<SetLoadedAccountsDataSizeLimitInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['accountDataSizeLimit', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 4 })\n );\n}\n\nexport function getSetLoadedAccountsDataSizeLimitInstructionDataDecoder(): Decoder<SetLoadedAccountsDataSizeLimitInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['accountDataSizeLimit', getU32Decoder()],\n ]);\n}\n\nexport function getSetLoadedAccountsDataSizeLimitInstructionDataCodec(): Codec<\n SetLoadedAccountsDataSizeLimitInstructionDataArgs,\n SetLoadedAccountsDataSizeLimitInstructionData\n> {\n return combineCodec(\n getSetLoadedAccountsDataSizeLimitInstructionDataEncoder(),\n getSetLoadedAccountsDataSizeLimitInstructionDataDecoder()\n );\n}\n\nexport type SetLoadedAccountsDataSizeLimitInput = {\n accountDataSizeLimit: SetLoadedAccountsDataSizeLimitInstructionDataArgs['accountDataSizeLimit'];\n};\n\nexport type SetLoadedAccountsDataSizeLimitInputWithSigners = {\n accountDataSizeLimit: SetLoadedAccountsDataSizeLimitInstructionDataArgs['accountDataSizeLimit'];\n};\n\nexport function getSetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(\n input: SetLoadedAccountsDataSizeLimitInputWithSigners\n): SetLoadedAccountsDataSizeLimitInstructionWithSigners<TProgram>;\nexport function getSetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n>(\n input: SetLoadedAccountsDataSizeLimitInput\n): SetLoadedAccountsDataSizeLimitInstruction<TProgram>;\nexport function getSetLoadedAccountsDataSizeLimitInstruction(\n input: SetLoadedAccountsDataSizeLimitInput\n): IInstruction {\n // Program address.\n const programAddress =\n 'ComputeBudget111111111111111111111111111111' as Address<'ComputeBudget111111111111111111111111111111'>;\n\n // Original args.\n const args = { ...input };\n\n const instruction = getSetLoadedAccountsDataSizeLimitInstructionRaw(\n args as SetLoadedAccountsDataSizeLimitInstructionDataArgs,\n programAddress\n );\n\n return instruction;\n}\n\nexport function getSetLoadedAccountsDataSizeLimitInstructionRaw<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n TRemainingAccounts extends Array<IAccountMeta<string>> = []\n>(\n args: SetLoadedAccountsDataSizeLimitInstructionDataArgs,\n programAddress: Address<TProgram> = 'ComputeBudget111111111111111111111111111111' as Address<TProgram>,\n remainingAccounts?: TRemainingAccounts\n) {\n return {\n accounts: remainingAccounts ?? [],\n data: getSetLoadedAccountsDataSizeLimitInstructionDataEncoder().encode(\n args\n ),\n programAddress,\n } as SetLoadedAccountsDataSizeLimitInstruction<TProgram, TRemainingAccounts>;\n}\n\nexport type ParsedSetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n> = {\n programAddress: Address<TProgram>;\n data: SetLoadedAccountsDataSizeLimitInstructionData;\n};\n\nexport function parseSetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string\n>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedSetLoadedAccountsDataSizeLimitInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getSetLoadedAccountsDataSizeLimitInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport { getU8Encoder } from '@solana/codecs';\nimport { Program } from '@solana/programs';\nimport {\n ParsedRequestHeapFrameInstruction,\n ParsedRequestUnitsInstruction,\n ParsedSetComputeUnitLimitInstruction,\n ParsedSetComputeUnitPriceInstruction,\n ParsedSetLoadedAccountsDataSizeLimitInstruction,\n} from '../instructions';\nimport { memcmp } from '../shared';\n\nexport const COMPUTE_BUDGET_PROGRAM_ADDRESS =\n 'ComputeBudget111111111111111111111111111111' as Address<'ComputeBudget111111111111111111111111111111'>;\n\nexport type ComputeBudgetProgram =\n Program<'ComputeBudget111111111111111111111111111111'>;\n\nexport function getComputeBudgetProgram(): ComputeBudgetProgram {\n return {\n name: 'computeBudget',\n address: COMPUTE_BUDGET_PROGRAM_ADDRESS,\n };\n}\n\nexport enum ComputeBudgetInstruction {\n RequestUnits,\n RequestHeapFrame,\n SetComputeUnitLimit,\n SetComputeUnitPrice,\n SetLoadedAccountsDataSizeLimit,\n}\n\nexport function identifyComputeBudgetInstruction(\n instruction: { data: Uint8Array } | Uint8Array\n): ComputeBudgetInstruction {\n const data =\n instruction instanceof Uint8Array ? instruction : instruction.data;\n if (memcmp(data, getU8Encoder().encode(0), 0)) {\n return ComputeBudgetInstruction.RequestUnits;\n }\n if (memcmp(data, getU8Encoder().encode(1), 0)) {\n return ComputeBudgetInstruction.RequestHeapFrame;\n }\n if (memcmp(data, getU8Encoder().encode(2), 0)) {\n return ComputeBudgetInstruction.SetComputeUnitLimit;\n }\n if (memcmp(data, getU8Encoder().encode(3), 0)) {\n return ComputeBudgetInstruction.SetComputeUnitPrice;\n }\n if (memcmp(data, getU8Encoder().encode(4), 0)) {\n return ComputeBudgetInstruction.SetLoadedAccountsDataSizeLimit;\n }\n throw new Error(\n 'The provided instruction could not be identified as a computeBudget instruction.'\n );\n}\n\nexport type ParsedComputeBudgetInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111'\n> =\n | ({\n instructionType: ComputeBudgetInstruction.RequestUnits;\n } & ParsedRequestUnitsInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.RequestHeapFrame;\n } & ParsedRequestHeapFrameInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.SetComputeUnitLimit;\n } & ParsedSetComputeUnitLimitInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.SetComputeUnitPrice;\n } & ParsedSetComputeUnitPriceInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.SetLoadedAccountsDataSizeLimit;\n } & ParsedSetLoadedAccountsDataSizeLimitInstruction<TProgram>);\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport {\n Address,\n isProgramDerivedAddress,\n ProgramDerivedAddress,\n} from '@solana/addresses';\nimport {\n AccountRole,\n IAccountMeta,\n upgradeRoleToSigner,\n} from '@solana/instructions';\nimport {\n IAccountSignerMeta,\n isTransactionSigner as web3JsIsTransactionSigner,\n TransactionSigner,\n} from '@solana/signers';\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome<T>(value: T | null | undefined): T {\n if (value == null) {\n throw new Error('Expected a value but received null or undefined.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): Address<T> {\n if (!value) {\n throw new Error('Expected a Address.');\n }\n if (typeof value === 'object' && 'address' in value) {\n return value.address;\n }\n if (Array.isArray(value)) {\n return value[0];\n }\n return value as Address<T>;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): ProgramDerivedAddress<T> {\n if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n throw new Error('Expected a ProgramDerivedAddress.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): TransactionSigner<T> {\n if (!value || !isTransactionSigner(value)) {\n throw new Error('Expected a TransactionSigner.');\n }\n return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n T extends string = string,\n U extends\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null\n> = {\n isWritable: boolean;\n value: U;\n};\n\n/**\n * Add an account meta with a default role if only an address is provided.\n * @internal\n */\nexport function accountMetaWithDefault<\n TAccount extends string | IAccountMeta<string>,\n TRole extends AccountRole\n>(account: TAccount | undefined, role: TRole) {\n if (account === undefined) return undefined;\n return (\n typeof account === 'string' ? { address: account, role } : account\n ) as TAccount extends string\n ? { address: Address<TAccount>; role: TRole }\n : TAccount;\n}\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type IInstructionWithByteDelta = {\n byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetasWithSigners<TKey extends string = string>(\n accounts: Record<TKey, ResolvedAccount>,\n optionalAccountStrategy: 'omitted' | 'programId',\n programAddress: Address\n): Record<TKey, IAccountMeta | IAccountSignerMeta> {\n const accountMetas: Record<string, IAccountMeta | IAccountSignerMeta> = {};\n\n Object.keys(accounts).forEach((key) => {\n const account = accounts[key as TKey] as ResolvedAccount;\n if (!account.value) {\n if (optionalAccountStrategy === 'omitted') return;\n accountMetas[key] = {\n address: programAddress,\n role: AccountRole.READONLY,\n };\n return;\n }\n\n const writableRole = account.isWritable\n ? AccountRole.WRITABLE\n : AccountRole.READONLY;\n accountMetas[key] = Object.freeze({\n address: expectAddress(account.value),\n role: isTransactionSigner(account.value)\n ? upgradeRoleToSigner(writableRole)\n : writableRole,\n ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n });\n });\n\n return accountMetas;\n}\n\nexport function isTransactionSigner<TAddress extends string = string>(\n value:\n | Address<TAddress>\n | ProgramDerivedAddress<TAddress>\n | TransactionSigner<TAddress>\n): value is TransactionSigner<TAddress> {\n return (\n !!value &&\n typeof value === 'object' &&\n 'address' in value &&\n web3JsIsTransactionSigner(value)\n );\n}\n\nexport function memcmp(data: Uint8Array, bytes: Uint8Array, offset: number) {\n const slice = data.slice(offset, offset + bytes.length);\n if (slice.length !== bytes.length) return false;\n return bytes.every((b, i) => b === slice[i]);\n}\n"]}
1
+ {"version":3,"sources":["../../src/generated/instructions/requestHeapFrame.ts","../../src/generated/programs/computeBudget.ts","../../src/generated/shared/index.ts","../../src/generated/instructions/requestUnits.ts","../../src/generated/instructions/setComputeUnitLimit.ts","../../src/generated/instructions/setComputeUnitPrice.ts","../../src/generated/instructions/setLoadedAccountsDataSizeLimit.ts"],"names":["getU8Encoder","ComputeBudgetInstruction","combineCodec","getStructDecoder","getStructEncoder","getU32Decoder","getU32Encoder","getU8Decoder","mapEncoder"],"mappings":";AASA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAAA;AAAA,EACA;AAAA,OACK;;;ACZP,SAAS,oBAAoB;;;ACD7B;AAAA,EAEE;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,OACK;AACP;AAAA,EAEE,uBAAuB;AAAA,OAElB;AAMA,SAAS,WAAc,OAAgC;AAC5D,MAAI,SAAS,MAAM;AACjB,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,SAAO;AACT;AAMO,SAAS,cACd,OAMY;AACZ,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AACA,MAAI,OAAO,UAAU,YAAY,aAAa,OAAO;AACnD,WAAO,MAAM;AAAA,EACf;AACA,MAAI,MAAM,QAAQ,KAAK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H,kBAAiB;AAAA,IACtB,CAAC,iBAAiBI,cAAa,CAAC;AAAA,IAChC,CAAC,wBAAwBF,eAAc,CAAC;AAAA,EAC1C,CAAC;AACH;AAEO,SAAS,wDAGd;AACA,SAAOH;AAAA,IACL,wDAAwD;AAAA,IACxD,wDAAwD;AAAA,EAC1D;AACF;AAMO,SAAS,6CACd,OAGA;AAEA,QAAM,iBAAiB;AAGvB,QAAM,OAAO,EAAE,GAAG,MAAM;AAExB,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,MAAM,wDAAwD,EAAE;AAAA,MAC9D;AAAA,IACF;AAAA,EACF;AAIA,SAAO;AACT;AASO,SAAS,+CAGd,aAC2D;AAC3D,SAAO;AAAA,IACL,gBAAgB,YAAY;AAAA,IAC5B,MAAM,wDAAwD,EAAE;AAAA,MAC9D,YAAY;AAAA,IACd;AAAA,EACF;AACF","sourcesContent":["/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\nimport { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';\n\nexport type RequestHeapFrameInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n TRemainingAccounts extends readonly IAccountMeta<string>[] = [],\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type RequestHeapFrameInstructionData = {\n discriminator: number;\n /**\n * Requested transaction-wide program heap size in bytes.\n * Must be multiple of 1024. Applies to each program, including CPIs.\n */\n bytes: number;\n};\n\nexport type RequestHeapFrameInstructionDataArgs = {\n /**\n * Requested transaction-wide program heap size in bytes.\n * Must be multiple of 1024. Applies to each program, including CPIs.\n */\n bytes: number;\n};\n\nexport function getRequestHeapFrameInstructionDataEncoder(): Encoder<RequestHeapFrameInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['bytes', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 1 })\n );\n}\n\nexport function getRequestHeapFrameInstructionDataDecoder(): Decoder<RequestHeapFrameInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['bytes', getU32Decoder()],\n ]);\n}\n\nexport function getRequestHeapFrameInstructionDataCodec(): Codec<\n RequestHeapFrameInstructionDataArgs,\n RequestHeapFrameInstructionData\n> {\n return combineCodec(\n getRequestHeapFrameInstructionDataEncoder(),\n getRequestHeapFrameInstructionDataDecoder()\n );\n}\n\nexport type RequestHeapFrameInput = {\n bytes: RequestHeapFrameInstructionDataArgs['bytes'];\n};\n\nexport function getRequestHeapFrameInstruction(\n input: RequestHeapFrameInput\n): RequestHeapFrameInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {\n // Program address.\n const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;\n\n // Original args.\n const args = { ...input };\n\n const instruction = {\n programAddress,\n data: getRequestHeapFrameInstructionDataEncoder().encode(\n args as RequestHeapFrameInstructionDataArgs\n ),\n } as RequestHeapFrameInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;\n\n return instruction;\n}\n\nexport type ParsedRequestHeapFrameInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n> = {\n programAddress: Address<TProgram>;\n data: RequestHeapFrameInstructionData;\n};\n\nexport function parseRequestHeapFrameInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedRequestHeapFrameInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getRequestHeapFrameInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport { getU8Encoder } from '@solana/codecs';\nimport { Program } from '@solana/programs';\nimport {\n ParsedRequestHeapFrameInstruction,\n ParsedRequestUnitsInstruction,\n ParsedSetComputeUnitLimitInstruction,\n ParsedSetComputeUnitPriceInstruction,\n ParsedSetLoadedAccountsDataSizeLimitInstruction,\n} from '../instructions';\nimport { memcmp } from '../shared';\n\nexport const COMPUTE_BUDGET_PROGRAM_ADDRESS =\n 'ComputeBudget111111111111111111111111111111' as Address<'ComputeBudget111111111111111111111111111111'>;\n\nexport type ComputeBudgetProgram =\n Program<'ComputeBudget111111111111111111111111111111'>;\n\nexport function getComputeBudgetProgram(): ComputeBudgetProgram {\n return {\n name: 'computeBudget',\n address: COMPUTE_BUDGET_PROGRAM_ADDRESS,\n };\n}\n\nexport enum ComputeBudgetInstruction {\n RequestUnits,\n RequestHeapFrame,\n SetComputeUnitLimit,\n SetComputeUnitPrice,\n SetLoadedAccountsDataSizeLimit,\n}\n\nexport function identifyComputeBudgetInstruction(\n instruction: { data: Uint8Array } | Uint8Array\n): ComputeBudgetInstruction {\n const data =\n instruction instanceof Uint8Array ? instruction : instruction.data;\n if (memcmp(data, getU8Encoder().encode(0), 0)) {\n return ComputeBudgetInstruction.RequestUnits;\n }\n if (memcmp(data, getU8Encoder().encode(1), 0)) {\n return ComputeBudgetInstruction.RequestHeapFrame;\n }\n if (memcmp(data, getU8Encoder().encode(2), 0)) {\n return ComputeBudgetInstruction.SetComputeUnitLimit;\n }\n if (memcmp(data, getU8Encoder().encode(3), 0)) {\n return ComputeBudgetInstruction.SetComputeUnitPrice;\n }\n if (memcmp(data, getU8Encoder().encode(4), 0)) {\n return ComputeBudgetInstruction.SetLoadedAccountsDataSizeLimit;\n }\n throw new Error(\n 'The provided instruction could not be identified as a computeBudget instruction.'\n );\n}\n\nexport type ParsedComputeBudgetInstruction<\n TProgram extends string = 'ComputeBudget111111111111111111111111111111',\n> =\n | ({\n instructionType: ComputeBudgetInstruction.RequestUnits;\n } & ParsedRequestUnitsInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.RequestHeapFrame;\n } & ParsedRequestHeapFrameInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.SetComputeUnitLimit;\n } & ParsedSetComputeUnitLimitInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.SetComputeUnitPrice;\n } & ParsedSetComputeUnitPriceInstruction<TProgram>)\n | ({\n instructionType: ComputeBudgetInstruction.SetLoadedAccountsDataSizeLimit;\n } & ParsedSetLoadedAccountsDataSizeLimitInstruction<TProgram>);\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport {\n Address,\n isProgramDerivedAddress,\n ProgramDerivedAddress,\n} from '@solana/addresses';\nimport {\n AccountRole,\n IAccountMeta,\n upgradeRoleToSigner,\n} from '@solana/instructions';\nimport {\n IAccountSignerMeta,\n isTransactionSigner as web3JsIsTransactionSigner,\n TransactionSigner,\n} from '@solana/signers';\n\n/**\n * Asserts that the given value is not null or undefined.\n * @internal\n */\nexport function expectSome<T>(value: T | null | undefined): T {\n if (value == null) {\n throw new Error('Expected a value but received null or undefined.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a PublicKey.\n * @internal\n */\nexport function expectAddress<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): Address<T> {\n if (!value) {\n throw new Error('Expected a Address.');\n }\n if (typeof value === 'object' && 'address' in value) {\n return value.address;\n }\n if (Array.isArray(value)) {\n return value[0];\n }\n return value as Address<T>;\n}\n\n/**\n * Asserts that the given value is a PDA.\n * @internal\n */\nexport function expectProgramDerivedAddress<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): ProgramDerivedAddress<T> {\n if (!value || !Array.isArray(value) || !isProgramDerivedAddress(value)) {\n throw new Error('Expected a ProgramDerivedAddress.');\n }\n return value;\n}\n\n/**\n * Asserts that the given value is a TransactionSigner.\n * @internal\n */\nexport function expectTransactionSigner<T extends string = string>(\n value:\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null\n | undefined\n): TransactionSigner<T> {\n if (!value || !isTransactionSigner(value)) {\n throw new Error('Expected a TransactionSigner.');\n }\n return value;\n}\n\n/**\n * Defines an instruction account to resolve.\n * @internal\n */\nexport type ResolvedAccount<\n T extends string = string,\n U extends\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null =\n | Address<T>\n | ProgramDerivedAddress<T>\n | TransactionSigner<T>\n | null,\n> = {\n isWritable: boolean;\n value: U;\n};\n\n/**\n * Defines an instruction that stores additional bytes on-chain.\n * @internal\n */\nexport type IInstructionWithByteDelta = {\n byteDelta: number;\n};\n\n/**\n * Get account metas and signers from resolved accounts.\n * @internal\n */\nexport function getAccountMetaFactory(\n programAddress: Address,\n optionalAccountStrategy: 'omitted' | 'programId'\n) {\n return (\n account: ResolvedAccount\n ): IAccountMeta | IAccountSignerMeta | undefined => {\n if (!account.value) {\n if (optionalAccountStrategy === 'omitted') return;\n return Object.freeze({\n address: programAddress,\n role: AccountRole.READONLY,\n });\n }\n\n const writableRole = account.isWritable\n ? AccountRole.WRITABLE\n : AccountRole.READONLY;\n return Object.freeze({\n address: expectAddress(account.value),\n role: isTransactionSigner(account.value)\n ? upgradeRoleToSigner(writableRole)\n : writableRole,\n ...(isTransactionSigner(account.value) ? { signer: account.value } : {}),\n });\n };\n}\n\nexport function isTransactionSigner<TAddress extends string = string>(\n value:\n | Address<TAddress>\n | ProgramDerivedAddress<TAddress>\n | TransactionSigner<TAddress>\n): value is TransactionSigner<TAddress> {\n return (\n !!value &&\n typeof value === 'object' &&\n 'address' in value &&\n web3JsIsTransactionSigner(value)\n );\n}\n\nexport function memcmp(data: Uint8Array, bytes: Uint8Array, offset: number) {\n const slice = data.slice(offset, offset + bytes.length);\n if (slice.length !== bytes.length) return false;\n return bytes.every((b, i) => b === slice[i]);\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\nimport { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';\n\nexport type RequestUnitsInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n TRemainingAccounts extends readonly IAccountMeta<string>[] = [],\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type RequestUnitsInstructionData = {\n discriminator: number;\n /** Units to request for transaction-wide compute. */\n units: number;\n /** Prioritization fee lamports. */\n additionalFee: number;\n};\n\nexport type RequestUnitsInstructionDataArgs = {\n /** Units to request for transaction-wide compute. */\n units: number;\n /** Prioritization fee lamports. */\n additionalFee: number;\n};\n\nexport function getRequestUnitsInstructionDataEncoder(): Encoder<RequestUnitsInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['units', getU32Encoder()],\n ['additionalFee', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 0 })\n );\n}\n\nexport function getRequestUnitsInstructionDataDecoder(): Decoder<RequestUnitsInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['units', getU32Decoder()],\n ['additionalFee', getU32Decoder()],\n ]);\n}\n\nexport function getRequestUnitsInstructionDataCodec(): Codec<\n RequestUnitsInstructionDataArgs,\n RequestUnitsInstructionData\n> {\n return combineCodec(\n getRequestUnitsInstructionDataEncoder(),\n getRequestUnitsInstructionDataDecoder()\n );\n}\n\nexport type RequestUnitsInput = {\n units: RequestUnitsInstructionDataArgs['units'];\n additionalFee: RequestUnitsInstructionDataArgs['additionalFee'];\n};\n\nexport function getRequestUnitsInstruction(\n input: RequestUnitsInput\n): RequestUnitsInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {\n // Program address.\n const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;\n\n // Original args.\n const args = { ...input };\n\n const instruction = {\n programAddress,\n data: getRequestUnitsInstructionDataEncoder().encode(\n args as RequestUnitsInstructionDataArgs\n ),\n } as RequestUnitsInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;\n\n return instruction;\n}\n\nexport type ParsedRequestUnitsInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n> = {\n programAddress: Address<TProgram>;\n data: RequestUnitsInstructionData;\n};\n\nexport function parseRequestUnitsInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedRequestUnitsInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getRequestUnitsInstructionDataDecoder().decode(instruction.data),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\nimport { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';\n\nexport type SetComputeUnitLimitInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n TRemainingAccounts extends readonly IAccountMeta<string>[] = [],\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetComputeUnitLimitInstructionData = {\n discriminator: number;\n /** Transaction-wide compute unit limit. */\n units: number;\n};\n\nexport type SetComputeUnitLimitInstructionDataArgs = {\n /** Transaction-wide compute unit limit. */\n units: number;\n};\n\nexport function getSetComputeUnitLimitInstructionDataEncoder(): Encoder<SetComputeUnitLimitInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['units', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 2 })\n );\n}\n\nexport function getSetComputeUnitLimitInstructionDataDecoder(): Decoder<SetComputeUnitLimitInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['units', getU32Decoder()],\n ]);\n}\n\nexport function getSetComputeUnitLimitInstructionDataCodec(): Codec<\n SetComputeUnitLimitInstructionDataArgs,\n SetComputeUnitLimitInstructionData\n> {\n return combineCodec(\n getSetComputeUnitLimitInstructionDataEncoder(),\n getSetComputeUnitLimitInstructionDataDecoder()\n );\n}\n\nexport type SetComputeUnitLimitInput = {\n units: SetComputeUnitLimitInstructionDataArgs['units'];\n};\n\nexport function getSetComputeUnitLimitInstruction(\n input: SetComputeUnitLimitInput\n): SetComputeUnitLimitInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {\n // Program address.\n const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;\n\n // Original args.\n const args = { ...input };\n\n const instruction = {\n programAddress,\n data: getSetComputeUnitLimitInstructionDataEncoder().encode(\n args as SetComputeUnitLimitInstructionDataArgs\n ),\n } as SetComputeUnitLimitInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;\n\n return instruction;\n}\n\nexport type ParsedSetComputeUnitLimitInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n> = {\n programAddress: Address<TProgram>;\n data: SetComputeUnitLimitInstructionData;\n};\n\nexport function parseSetComputeUnitLimitInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedSetComputeUnitLimitInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getSetComputeUnitLimitInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\nimport { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';\n\nexport type SetComputeUnitPriceInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n TRemainingAccounts extends readonly IAccountMeta<string>[] = [],\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetComputeUnitPriceInstructionData = {\n discriminator: number;\n /** Transaction compute unit price used for prioritization fees. */\n microLamports: bigint;\n};\n\nexport type SetComputeUnitPriceInstructionDataArgs = {\n /** Transaction compute unit price used for prioritization fees. */\n microLamports: number | bigint;\n};\n\nexport function getSetComputeUnitPriceInstructionDataEncoder(): Encoder<SetComputeUnitPriceInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['microLamports', getU64Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 3 })\n );\n}\n\nexport function getSetComputeUnitPriceInstructionDataDecoder(): Decoder<SetComputeUnitPriceInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['microLamports', getU64Decoder()],\n ]);\n}\n\nexport function getSetComputeUnitPriceInstructionDataCodec(): Codec<\n SetComputeUnitPriceInstructionDataArgs,\n SetComputeUnitPriceInstructionData\n> {\n return combineCodec(\n getSetComputeUnitPriceInstructionDataEncoder(),\n getSetComputeUnitPriceInstructionDataDecoder()\n );\n}\n\nexport type SetComputeUnitPriceInput = {\n microLamports: SetComputeUnitPriceInstructionDataArgs['microLamports'];\n};\n\nexport function getSetComputeUnitPriceInstruction(\n input: SetComputeUnitPriceInput\n): SetComputeUnitPriceInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {\n // Program address.\n const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;\n\n // Original args.\n const args = { ...input };\n\n const instruction = {\n programAddress,\n data: getSetComputeUnitPriceInstructionDataEncoder().encode(\n args as SetComputeUnitPriceInstructionDataArgs\n ),\n } as SetComputeUnitPriceInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;\n\n return instruction;\n}\n\nexport type ParsedSetComputeUnitPriceInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n> = {\n programAddress: Address<TProgram>;\n data: SetComputeUnitPriceInstructionData;\n};\n\nexport function parseSetComputeUnitPriceInstruction<TProgram extends string>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedSetComputeUnitPriceInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getSetComputeUnitPriceInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n","/**\n * This code was AUTOGENERATED using the kinobi library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun kinobi to update it.\n *\n * @see https://github.com/metaplex-foundation/kinobi\n */\n\nimport { Address } from '@solana/addresses';\nimport {\n Codec,\n Decoder,\n Encoder,\n combineCodec,\n getStructDecoder,\n getStructEncoder,\n getU32Decoder,\n getU32Encoder,\n getU8Decoder,\n getU8Encoder,\n mapEncoder,\n} from '@solana/codecs';\nimport {\n IAccountMeta,\n IInstruction,\n IInstructionWithAccounts,\n IInstructionWithData,\n} from '@solana/instructions';\nimport { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';\n\nexport type SetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n TRemainingAccounts extends readonly IAccountMeta<string>[] = [],\n> = IInstruction<TProgram> &\n IInstructionWithData<Uint8Array> &\n IInstructionWithAccounts<TRemainingAccounts>;\n\nexport type SetLoadedAccountsDataSizeLimitInstructionData = {\n discriminator: number;\n accountDataSizeLimit: number;\n};\n\nexport type SetLoadedAccountsDataSizeLimitInstructionDataArgs = {\n accountDataSizeLimit: number;\n};\n\nexport function getSetLoadedAccountsDataSizeLimitInstructionDataEncoder(): Encoder<SetLoadedAccountsDataSizeLimitInstructionDataArgs> {\n return mapEncoder(\n getStructEncoder([\n ['discriminator', getU8Encoder()],\n ['accountDataSizeLimit', getU32Encoder()],\n ]),\n (value) => ({ ...value, discriminator: 4 })\n );\n}\n\nexport function getSetLoadedAccountsDataSizeLimitInstructionDataDecoder(): Decoder<SetLoadedAccountsDataSizeLimitInstructionData> {\n return getStructDecoder([\n ['discriminator', getU8Decoder()],\n ['accountDataSizeLimit', getU32Decoder()],\n ]);\n}\n\nexport function getSetLoadedAccountsDataSizeLimitInstructionDataCodec(): Codec<\n SetLoadedAccountsDataSizeLimitInstructionDataArgs,\n SetLoadedAccountsDataSizeLimitInstructionData\n> {\n return combineCodec(\n getSetLoadedAccountsDataSizeLimitInstructionDataEncoder(),\n getSetLoadedAccountsDataSizeLimitInstructionDataDecoder()\n );\n}\n\nexport type SetLoadedAccountsDataSizeLimitInput = {\n accountDataSizeLimit: SetLoadedAccountsDataSizeLimitInstructionDataArgs['accountDataSizeLimit'];\n};\n\nexport function getSetLoadedAccountsDataSizeLimitInstruction(\n input: SetLoadedAccountsDataSizeLimitInput\n): SetLoadedAccountsDataSizeLimitInstruction<\n typeof COMPUTE_BUDGET_PROGRAM_ADDRESS\n> {\n // Program address.\n const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;\n\n // Original args.\n const args = { ...input };\n\n const instruction = {\n programAddress,\n data: getSetLoadedAccountsDataSizeLimitInstructionDataEncoder().encode(\n args as SetLoadedAccountsDataSizeLimitInstructionDataArgs\n ),\n } as SetLoadedAccountsDataSizeLimitInstruction<\n typeof COMPUTE_BUDGET_PROGRAM_ADDRESS\n >;\n\n return instruction;\n}\n\nexport type ParsedSetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,\n> = {\n programAddress: Address<TProgram>;\n data: SetLoadedAccountsDataSizeLimitInstructionData;\n};\n\nexport function parseSetLoadedAccountsDataSizeLimitInstruction<\n TProgram extends string,\n>(\n instruction: IInstruction<TProgram> & IInstructionWithData<Uint8Array>\n): ParsedSetLoadedAccountsDataSizeLimitInstruction<TProgram> {\n return {\n programAddress: instruction.programAddress,\n data: getSetLoadedAccountsDataSizeLimitInstructionDataDecoder().decode(\n instruction.data\n ),\n };\n}\n"]}
@@ -8,8 +8,8 @@
8
8
  import { Address } from '@solana/addresses';
9
9
  import { Codec, Decoder, Encoder } from '@solana/codecs';
10
10
  import { IAccountMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData } from '@solana/instructions';
11
- export type RequestHeapFrameInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
12
- export type RequestHeapFrameInstructionWithSigners<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
11
+ import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';
12
+ export type RequestHeapFrameInstruction<TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
13
13
  export type RequestHeapFrameInstructionData = {
14
14
  discriminator: number;
15
15
  /**
@@ -31,13 +31,8 @@ export declare function getRequestHeapFrameInstructionDataCodec(): Codec<Request
31
31
  export type RequestHeapFrameInput = {
32
32
  bytes: RequestHeapFrameInstructionDataArgs['bytes'];
33
33
  };
34
- export type RequestHeapFrameInputWithSigners = {
35
- bytes: RequestHeapFrameInstructionDataArgs['bytes'];
36
- };
37
- export declare function getRequestHeapFrameInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: RequestHeapFrameInputWithSigners): RequestHeapFrameInstructionWithSigners<TProgram>;
38
- export declare function getRequestHeapFrameInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: RequestHeapFrameInput): RequestHeapFrameInstruction<TProgram>;
39
- export declare function getRequestHeapFrameInstructionRaw<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []>(args: RequestHeapFrameInstructionDataArgs, programAddress?: Address<TProgram>, remainingAccounts?: TRemainingAccounts): RequestHeapFrameInstruction<TProgram, TRemainingAccounts>;
40
- export type ParsedRequestHeapFrameInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'> = {
34
+ export declare function getRequestHeapFrameInstruction(input: RequestHeapFrameInput): RequestHeapFrameInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
35
+ export type ParsedRequestHeapFrameInstruction<TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> = {
41
36
  programAddress: Address<TProgram>;
42
37
  data: RequestHeapFrameInstructionData;
43
38
  };
@@ -1 +1 @@
1
- {"version":3,"file":"requestHeapFrame.d.ts","sourceRoot":"","sources":["../../../../../src/generated/instructions/requestHeapFrame.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,2BAA2B,CACrC,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,sCAAsC,CAChD,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,+BAA+B,GAAG;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;I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AAC,UAAU,CAAC,GACrE,iCAAiC,CAAC,QAAQ,CAAC,CAK7C"}
1
+ {"version":3,"file":"requestHeapFrame.d.ts","sourceRoot":"","sources":["../../../../../src/generated/instructions/requestHeapFrame.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;AAC9B,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE7D,MAAM,MAAM,2BAA2B,CACrC,QAAQ,SAAS,MAAM,GAAG,OAAO,8BAA8B,EAC/D,kBAAkB,SAAS,SAAS,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAC7D,YAAY,CAAC,QAAQ,CAAC,GACxB,oBAAoB,CAAC,UAAU,CAAC,GAChC,wBAAwB,CAAC,kBAAkB,CAAC,CAAC;AAE/C,MAAM,MAAM,+BAA+B,GAAG;IAC5C,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,wBAAgB,yCAAyC,IAAI,OAAO,CAAC,mCAAmC,CAAC,CAQxG;AAED,wBAAgB,yCAAyC,IAAI,OAAO,CAAC,+BAA+B,CAAC,CAKpG;AAED,wBAAgB,uCAAuC,IAAI,KAAK,CAC9D,mCAAmC,EACnC,+BAA+B,CAChC,CAKA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,mCAAmC,CAAC,OAAO,CAAC,CAAC;CACrD,CAAC;AAEF,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,qBAAqB,GAC3B,2BAA2B,CAAC,OAAO,8BAA8B,CAAC,CAepE;AAED,MAAM,MAAM,iCAAiC,CAC3C,QAAQ,SAAS,MAAM,GAAG,OAAO,8BAA8B,IAC7D;IACF,cAAc,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,EAAE,+BAA+B,CAAC;CACvC,CAAC;AAEF,wBAAgB,gCAAgC,CAAC,QAAQ,SAAS,MAAM,EACtE,WAAW,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,oBAAoB,CAAC,UAAU,CAAC,GACrE,iCAAiC,CAAC,QAAQ,CAAC,CAK7C"}
@@ -8,8 +8,8 @@
8
8
  import { Address } from '@solana/addresses';
9
9
  import { Codec, Decoder, Encoder } from '@solana/codecs';
10
10
  import { IAccountMeta, IInstruction, IInstructionWithAccounts, IInstructionWithData } from '@solana/instructions';
11
- export type RequestUnitsInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
12
- export type RequestUnitsInstructionWithSigners<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
11
+ import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';
12
+ export type RequestUnitsInstruction<TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS, TRemainingAccounts extends readonly IAccountMeta<string>[] = []> = IInstruction<TProgram> & IInstructionWithData<Uint8Array> & IInstructionWithAccounts<TRemainingAccounts>;
13
13
  export type RequestUnitsInstructionData = {
14
14
  discriminator: number;
15
15
  /** Units to request for transaction-wide compute. */
@@ -30,14 +30,8 @@ export type RequestUnitsInput = {
30
30
  units: RequestUnitsInstructionDataArgs['units'];
31
31
  additionalFee: RequestUnitsInstructionDataArgs['additionalFee'];
32
32
  };
33
- export type RequestUnitsInputWithSigners = {
34
- units: RequestUnitsInstructionDataArgs['units'];
35
- additionalFee: RequestUnitsInstructionDataArgs['additionalFee'];
36
- };
37
- export declare function getRequestUnitsInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: RequestUnitsInputWithSigners): RequestUnitsInstructionWithSigners<TProgram>;
38
- export declare function getRequestUnitsInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'>(input: RequestUnitsInput): RequestUnitsInstruction<TProgram>;
39
- export declare function getRequestUnitsInstructionRaw<TProgram extends string = 'ComputeBudget111111111111111111111111111111', TRemainingAccounts extends Array<IAccountMeta<string>> = []>(args: RequestUnitsInstructionDataArgs, programAddress?: Address<TProgram>, remainingAccounts?: TRemainingAccounts): RequestUnitsInstruction<TProgram, TRemainingAccounts>;
40
- export type ParsedRequestUnitsInstruction<TProgram extends string = 'ComputeBudget111111111111111111111111111111'> = {
33
+ export declare function getRequestUnitsInstruction(input: RequestUnitsInput): RequestUnitsInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
34
+ export type ParsedRequestUnitsInstruction<TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> = {
41
35
  programAddress: Address<TProgram>;
42
36
  data: RequestUnitsInstructionData;
43
37
  };
@@ -1 +1 @@
1
- {"version":3,"file":"requestUnits.d.ts","sourceRoot":"","sources":["../../../../../src/generated/instructions/requestUnits.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,uBAAuB,CACjC,QAAQ,SAAS,MAAM,GAAG,6CAA6C,EACvE,kBAAkB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