add explorer support for pyth batch update price ix (#26240)
This commit is contained in:
parent
67936aaa74
commit
72dc813ada
|
@ -87,6 +87,14 @@ export function PythDetailsCard(props: {
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
case "UpdatePriceNoFailOnError":
|
||||||
|
return (
|
||||||
|
<UpdatePriceDetailsCard
|
||||||
|
info={PythInstruction.decodeUpdatePriceNoFailOnError(ix)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
case "AggregatePrice":
|
case "AggregatePrice":
|
||||||
return (
|
return (
|
||||||
<AggregatePriceDetailsCard
|
<AggregatePriceDetailsCard
|
||||||
|
|
|
@ -22,7 +22,8 @@ export type PythInstructionType =
|
||||||
| "InitPrice"
|
| "InitPrice"
|
||||||
| "InitTest"
|
| "InitTest"
|
||||||
| "UpdateTest"
|
| "UpdateTest"
|
||||||
| "SetMinPublishers";
|
| "SetMinPublishers"
|
||||||
|
| "UpdatePriceNoFailOnError";
|
||||||
|
|
||||||
export function headerLayout(property: string = "header") {
|
export function headerLayout(property: string = "header") {
|
||||||
return BufferLayout.struct(
|
return BufferLayout.struct(
|
||||||
|
@ -187,6 +188,17 @@ export const PYTH_INSTRUCTION_LAYOUTS: {
|
||||||
BufferLayout.blob(3, "unused1"),
|
BufferLayout.blob(3, "unused1"),
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
|
UpdatePriceNoFailOnError: {
|
||||||
|
index: 13,
|
||||||
|
layout: BufferLayout.struct([
|
||||||
|
headerLayout(),
|
||||||
|
BufferLayout.u32("status"),
|
||||||
|
BufferLayout.u32("unused1"),
|
||||||
|
BufferLayout.ns64("price"),
|
||||||
|
BufferLayout.nu64("conf"),
|
||||||
|
BufferLayout.nu64("publishSlot"),
|
||||||
|
]),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export enum PriceType {
|
export enum PriceType {
|
||||||
|
@ -433,6 +445,27 @@ export class PythInstruction {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decode an "update price no fail error" instruction and retrieve the instruction params.
|
||||||
|
*/
|
||||||
|
static decodeUpdatePriceNoFailOnError(
|
||||||
|
instruction: TransactionInstruction
|
||||||
|
): UpdatePriceParams {
|
||||||
|
const { status, price, conf, publishSlot } = decodeData(
|
||||||
|
PYTH_INSTRUCTION_LAYOUTS.UpdatePriceNoFailOnError,
|
||||||
|
instruction.data
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
publisherPubkey: instruction.keys[0].pubkey,
|
||||||
|
pricePubkey: instruction.keys[1].pubkey,
|
||||||
|
status,
|
||||||
|
price,
|
||||||
|
conf,
|
||||||
|
publishSlot,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decode an "aggregate price" instruction and retrieve the instruction params.
|
* Decode an "aggregate price" instruction and retrieve the instruction params.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue