diff --git a/web3.js/src/system-program.js b/web3.js/src/system-program.js index daa0d272df..9e9f1a5b02 100644 --- a/web3.js/src/system-program.js +++ b/web3.js/src/system-program.js @@ -67,7 +67,7 @@ export class SystemInstruction extends TransactionInstruction { if ( this.type == SystemInstructionLayout.Create || this.type == SystemInstructionLayout.CreateWithSeed || - this.type == SystemInstructionLayout.NonceWithdraw || + this.type == SystemInstructionLayout.WithdrawNonceAccount || this.type == SystemInstructionLayout.Transfer ) { return this.keys[0].pubkey; @@ -83,7 +83,7 @@ export class SystemInstruction extends TransactionInstruction { if ( this.type == SystemInstructionLayout.Create || this.type == SystemInstructionLayout.CreateWithSeed || - this.type == SystemInstructionLayout.NonceWithdraw || + this.type == SystemInstructionLayout.WithdrawNonceAccount || this.type == SystemInstructionLayout.Transfer ) { return this.keys[1].pubkey; @@ -100,7 +100,7 @@ export class SystemInstruction extends TransactionInstruction { if ( this.type == SystemInstructionLayout.Create || this.type == SystemInstructionLayout.CreateWithSeed || - this.type == SystemInstructionLayout.NonceWithdraw || + this.type == SystemInstructionLayout.WithdrawNonceAccount || this.type == SystemInstructionLayout.Transfer ) { return data.lamports; @@ -147,25 +147,25 @@ const SystemInstructionLayout = Object.freeze({ Layout.publicKey('programId'), ]), }, - NonceAdvance: { + AdvanceNonceAccount: { index: 4, layout: BufferLayout.struct([BufferLayout.u32('instruction')]), }, - NonceWithdraw: { + WithdrawNonceAccount: { index: 5, layout: BufferLayout.struct([ BufferLayout.u32('instruction'), BufferLayout.ns64('lamports'), ]), }, - NonceInitialize: { + InitializeNonceAccount: { index: 6, layout: BufferLayout.struct([ BufferLayout.u32('instruction'), Layout.publicKey('authorized'), ]), }, - NonceAuthorize: { + AuthorizeNonceAccount: { index: 7, layout: BufferLayout.struct([ BufferLayout.u32('instruction'), @@ -305,7 +305,7 @@ export class SystemProgram { this.programId, ); - const type = SystemInstructionLayout.NonceInitialize; + const type = SystemInstructionLayout.InitializeNonceAccount; const data = encodeData(type, { authorized: authorizedPubkey.toBuffer(), }); @@ -332,7 +332,7 @@ export class SystemProgram { nonceAccount: PublicKey, authorizedPubkey: PublicKey, ): TransactionInstruction { - const type = SystemInstructionLayout.NonceAdvance; + const type = SystemInstructionLayout.AdvanceNonceAccount; const data = encodeData(type); const instructionData = { keys: [ @@ -359,7 +359,7 @@ export class SystemProgram { to: PublicKey, lamports: number, ): Transaction { - const type = SystemInstructionLayout.NonceWithdraw; + const type = SystemInstructionLayout.WithdrawNonceAccount; const data = encodeData(type, {lamports}); return new Transaction().add({ @@ -392,7 +392,7 @@ export class SystemProgram { authorizedPubkey: PublicKey, newAuthorized: PublicKey, ): Transaction { - const type = SystemInstructionLayout.NonceAuthorize; + const type = SystemInstructionLayout.AuthorizeNonceAccount; const data = encodeData(type, { newAuthorized: newAuthorized.toBuffer(), }); diff --git a/web3.js/src/transaction.js b/web3.js/src/transaction.js index 46797d282f..fae08553dd 100644 --- a/web3.js/src/transaction.js +++ b/web3.js/src/transaction.js @@ -105,7 +105,7 @@ type TransactionCtorFields = {| * * @typedef {Object} NonceInformation * @property {nonce} The current Nonce blockhash - * @property {nonceInstruction} The NonceAdvance Instruction + * @property {nonceInstruction} The AdvanceNonceAccount Instruction */ type NonceInformation = {| nonce: Blockhash,