Skip to content

Commit 079f8cc

Browse files
authored
Add AptosAuthorizeUpgradeContractInstruction to xc-governance-sdk-js (#328)
1 parent c47199d commit 079f8cc

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

third_party/pyth/xc-governance-sdk-js/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export {
22
DataSource,
3+
AptosAuthorizeUpgradeContractInstruction,
34
EthereumUpgradeContractInstruction,
45
HexString20Bytes,
56
HexString32Bytes,

third_party/pyth/xc-governance-sdk-js/src/instructions.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ abstract class TargetInstruction extends Instruction {
100100
}
101101
}
102102

103+
export class AptosAuthorizeUpgradeContractInstruction extends TargetInstruction {
104+
constructor(
105+
targetChainId: ChainId,
106+
private hash: HexString32Bytes,
107+
) {
108+
super(TargetAction.UpgradeContract, targetChainId);
109+
}
110+
111+
protected serializePayload(): Buffer {
112+
return this.hash.serialize();
113+
}
114+
}
115+
103116
export class EthereumUpgradeContractInstruction extends TargetInstruction {
104117
constructor(
105118
targetChainId: ChainId,

0 commit comments

Comments
 (0)