chore: tweak docs for account creation methods (#18507)

* doc tweaks" PublicKey.createWithSeed() and system-program's CreateAccountWithSeedParams obj

* Update web3.js/src/system-program.ts

* Update web3.js/src/system-program.ts

* Update web3.js/src/system-program.ts

Co-authored-by: GentlemansKiller <gk_gaming_shit@protonmail.ch>
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
This commit is contained in:
GentlemansKiller 2021-07-07 21:23:36 -05:00 committed by GitHub
parent 1e0942e900
commit 69ad13b077
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -111,6 +111,8 @@ export class PublicKey extends Struct {
/**
* Derive a public key from another key, a seed, and a program ID.
* The program ID will also serve as the owner of the public key, giving
* it permission to write data to the account.
*/
static async createWithSeed(
fromPublicKey: PublicKey,

View File

@ -52,11 +52,11 @@ export type AssignParams = {
export type CreateAccountWithSeedParams = {
/** The account that will transfer lamports to the created account */
fromPubkey: PublicKey;
/** Public key of the created account */
/** Public key of the created account. Must be pre-calculated with PublicKey.createWithSeed() */
newAccountPubkey: PublicKey;
/** Base public key to use to derive the address of the created account */
/** Base public key to use to derive the address of the created account. Must be the same as the base key used to create `newAccountPubkey` */
basePubkey: PublicKey;
/** Seed to use to derive the address of the created account */
/** Seed to use to derive the address of the created account. Must be the same as the seed used to create `newAccountPubkey` */
seed: string;
/** Amount of lamports to transfer to the created account */
lamports: number;