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:
@ -111,6 +111,8 @@ export class PublicKey extends Struct {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Derive a public key from another key, a seed, and a program ID.
|
* 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(
|
static async createWithSeed(
|
||||||
fromPublicKey: PublicKey,
|
fromPublicKey: PublicKey,
|
||||||
|
@ -52,11 +52,11 @@ export type AssignParams = {
|
|||||||
export type CreateAccountWithSeedParams = {
|
export type CreateAccountWithSeedParams = {
|
||||||
/** The account that will transfer lamports to the created account */
|
/** The account that will transfer lamports to the created account */
|
||||||
fromPubkey: PublicKey;
|
fromPubkey: PublicKey;
|
||||||
/** Public key of the created account */
|
/** Public key of the created account. Must be pre-calculated with PublicKey.createWithSeed() */
|
||||||
newAccountPubkey: PublicKey;
|
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;
|
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;
|
seed: string;
|
||||||
/** Amount of lamports to transfer to the created account */
|
/** Amount of lamports to transfer to the created account */
|
||||||
lamports: number;
|
lamports: number;
|
||||||
|
Reference in New Issue
Block a user