diff --git a/web3.js/module.flow.js b/web3.js/module.flow.js index 5e9625800a..876040b976 100644 --- a/web3.js/module.flow.js +++ b/web3.js/module.flow.js @@ -223,6 +223,7 @@ declare module '@solana/web3.js' { static createAccountWithSeed( from: PublicKey, newAccount: PublicKey, + base: PublicKey, seed: string, lamports: number, space: number, diff --git a/web3.js/package-lock.json b/web3.js/package-lock.json index 1413be7c0f..a127166e0f 100644 --- a/web3.js/package-lock.json +++ b/web3.js/package-lock.json @@ -9720,8 +9720,7 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", - "dev": true, - "optional": true + "dev": true }, "hook-std": { "version": "2.0.0", @@ -9859,8 +9858,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz", "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc=", - "dev": true, - "optional": true + "dev": true }, "acorn-globals": { "version": "1.0.9", diff --git a/web3.js/src/system-program.js b/web3.js/src/system-program.js index fad0fcdd2c..03366f44ea 100644 --- a/web3.js/src/system-program.js +++ b/web3.js/src/system-program.js @@ -148,6 +148,7 @@ const SystemInstructionLayout = Object.freeze({ index: 3, layout: BufferLayout.struct([ BufferLayout.u32('instruction'), + Layout.publicKey('base'), Layout.rustString('seed'), BufferLayout.ns64('lamports'), BufferLayout.ns64('space'), @@ -246,6 +247,7 @@ export class SystemProgram { static createAccountWithSeed( from: PublicKey, newAccount: PublicKey, + base: PublicKey, seed: string, lamports: number, space: number, @@ -253,6 +255,7 @@ export class SystemProgram { ): Transaction { const type = SystemInstructionLayout.CreateWithSeed; const data = encodeData(type, { + base: base.toBuffer(), seed, lamports, space, diff --git a/web3.js/test/system-program.test.js b/web3.js/test/system-program.test.js index c690b68782..3798707e66 100644 --- a/web3.js/test/system-program.test.js +++ b/web3.js/test/system-program.test.js @@ -58,6 +58,7 @@ test('createAccountWithSeed', () => { transaction = SystemProgram.createAccountWithSeed( from.publicKey, newAccount.publicKey, + from.publicKey, 'hi there', 123, BudgetProgram.space, @@ -133,6 +134,7 @@ test('SystemInstruction createWithSeed', () => { const create = SystemProgram.createAccountWithSeed( from.publicKey, to.publicKey, + from.publicKey, 'hi there', amount, space,