From 47657c754e26de6d6edee9d31dbedeaee03f5400 Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Tue, 5 Sep 2023 17:21:08 +0200 Subject: [PATCH] Use microLamports for setComputeUnitPrice (#7) --- .../js/src/generated/instructions/setComputeUnitPrice.ts | 8 +++----- configs/kinobi.cjs | 1 - idls/spl_compute_budget.json | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/clients/js/src/generated/instructions/setComputeUnitPrice.ts b/clients/js/src/generated/instructions/setComputeUnitPrice.ts index d1591ba0..08270f49 100644 --- a/clients/js/src/generated/instructions/setComputeUnitPrice.ts +++ b/clients/js/src/generated/instructions/setComputeUnitPrice.ts @@ -8,9 +8,7 @@ import { Context, - SolAmount, TransactionBuilder, - mapAmountSerializer, transactionBuilder, } from '@metaplex-foundation/umi'; import { @@ -30,12 +28,12 @@ import { export type SetComputeUnitPriceInstructionData = { discriminator: number; /** Transaction compute unit price used for prioritization fees. */ - lamports: SolAmount; + microLamports: bigint; }; export type SetComputeUnitPriceInstructionDataArgs = { /** Transaction compute unit price used for prioritization fees. */ - lamports: SolAmount; + microLamports: number | bigint; }; export function getSetComputeUnitPriceInstructionDataSerializer(): Serializer< @@ -50,7 +48,7 @@ export function getSetComputeUnitPriceInstructionDataSerializer(): Serializer< struct( [ ['discriminator', u8()], - ['lamports', mapAmountSerializer(u64(), 'SOL', 9)], + ['microLamports', u64()], ], { description: 'SetComputeUnitPriceInstructionData' } ), diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index 894d316b..394cd09f 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -136,7 +136,6 @@ kinobi.update( new k.SetNumberWrappersVisitor({ "splSystem.CreateAccount.lamports": { kind: "SolAmount" }, "splSystem.TransferSol.amount": { kind: "SolAmount" }, - "splComputeBudget.SetComputeUnitPrice.lamports": { kind: "SolAmount" }, }) ); diff --git a/idls/spl_compute_budget.json b/idls/spl_compute_budget.json index 020d9cec..9cf9e925 100644 --- a/idls/spl_compute_budget.json +++ b/idls/spl_compute_budget.json @@ -52,7 +52,7 @@ "discriminant": { "value": 3, "type": "u8" }, "args": [ { - "name": "lamports", + "name": "microLamports", "type": "u64", "docs": [ "Transaction compute unit price used for prioritization fees."