    import {PublicKey} from '@solana/web3'

public class | source

# PublicKey

You can directly use an instance of this class. BPF_LOADER_DEPRECATED_PROGRAM_ID BPF_LOADER_PROGRAM_ID STAKE_CONFIG_ID SYSVAR_CLOCK_PUBKEY SYSVAR_RECENT_BLOCKHASHES_PUBKEY SYSVAR_RENT_PUBKEY SYSVAR_REWARDS_PUBKEY SYSVAR_STAKE_HISTORY_PUBKEY VALIDATOR_INFO_KEY VOTE_PROGRAM_ID

A public key

## Static Method Summary

Static Public Methods
public static | async createProgramAddress(seeds: Array<Buffer|Uint8Array>, programId: PublicKey): Promise<PublicKey> Derive a program address from seeds and a program ID. |
public static | async createWithSeed(fromPublicKey: PublicKey, seed: string, programId: PublicKey): Promise<PublicKey> Derive a public key from another key, a seed, and a program ID. |
public static | async findProgramAddress(seeds: Array<Buffer|Uint8Array>, programId: PublicKey): Promise<PublicKeyNonce> Find a valid program address |

## Constructor Summary

Public Constructor
public | constructor(value: number | string | Buffer | Uint8Array | Array<number>) Create a new PublicKey object |

## Method Summary

Public Methods
public | equals(publicKey: PublicKey): boolean Checks if two publicKeys are equal |
public | toBase58(): string Return the base-58 representation of the public key |
public | toBuffer(): Buffer Return the Buffer representation of the public key |
public | toString(): string Returns a string representation of the public key |

## Static Public Methods

### public static async createProgramAddress(seeds: Array<Buffer|Uint8Array>, programId: PublicKey): Promise<PublicKey> source

Derive a program address from seeds and a program ID.

#### Params:

Name | Type | Attribute | Description
seeds | Array<Buffer|Uint8Array> |  |
programId | PublicKey |  |

#### Return:

Promise<PublicKey>

### public static async createWithSeed(fromPublicKey: PublicKey, seed: string, programId: PublicKey): Promise<PublicKey> source

Derive a public key from another key, a seed, and a program ID.

#### Params:

Name | Type | Attribute | Description
fromPublicKey | PublicKey |  |
seed | string |  |
programId | PublicKey |  |

#### Return:

Promise<PublicKey>

### public static async findProgramAddress(seeds: Array<Buffer|Uint8Array>, programId: PublicKey): Promise<PublicKeyNonce> source

Find a valid program address

Valid program addresses must fall off the ed25519 curve. This function iterates a nonce until it finds one that when combined with the seeds results in a valid program address.

#### Params:

Name | Type | Attribute | Description
seeds | Array<Buffer|Uint8Array> |  |
programId | PublicKey |  |

#### Return:

Promise<PublicKeyNonce>

## Public Constructors

### public constructor(value: number | string | Buffer | Uint8Array | Array<number>) source

Create a new PublicKey object

#### Params:

Name | Type | Attribute | Description
value | number | string | Buffer | Uint8Array | Array<number> |  |

## Public Methods

### public equals(publicKey: PublicKey): boolean source

Checks if two publicKeys are equal

#### Params:

Name | Type | Attribute | Description
publicKey | PublicKey |  |

#### Return:

boolean

### public toBase58(): string source

Return the base-58 representation of the public key

#### Return:

string

### public toBuffer(): Buffer source

Return the Buffer representation of the public key

#### Return:

Buffer

### public toString(): string source

Returns a string representation of the public key

#### Return:

string