Skip to main content

Types.PublicKey

SnarkyJS / Modules / Types / PublicKey

Class: PublicKey

Types.PublicKey

A public key, which is also an address on the Mina network. You can derive a PublicKey directly from a PrivateKey.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PublicKey(...props)

Parameters

NameType
...propsany[]

Inherited from

CircuitValue.constructor

Defined in

lib/circuit_value.ts:70

Properties

isOdd

isOdd: Bool

Defined in

lib/signature.ts:115


x

x: Field

Defined in

lib/signature.ts:114

Methods

assertEquals

assertEquals(x): void

Parameters

NameType
xPublicKey

Returns

void

Inherited from

CircuitValue.assertEquals

Defined in

lib/circuit_value.ts:158


equals

equals(x): Bool

Parameters

NameType
xPublicKey

Returns

Bool

Inherited from

CircuitValue.equals

Defined in

lib/circuit_value.ts:154


isConstant

isConstant(): boolean

Returns

boolean

Inherited from

CircuitValue.isConstant

Defined in

lib/circuit_value.ts:162


isEmpty

isEmpty(): Bool

Checks if a PublicKey is empty.

Returns

Bool

a Bool

Defined in

lib/signature.ts:172


toBase58

toBase58(): string

Encodes a PublicKey in base58 format.

Returns

string

a base58 encoded PublicKey

Defined in

lib/signature.ts:190


toConstant

toConstant(): PublicKey

Returns

PublicKey

Inherited from

CircuitValue.toConstant

Defined in

lib/circuit_value.ts:150


toFields

toFields(): Field[]

Returns

Field[]

Inherited from

CircuitValue.toFields

Defined in

lib/circuit_value.ts:142


toGroup

toGroup(): Group

Returns the Group representation of this PublicKey.

Returns

Group

A Group

Defined in

lib/signature.ts:121


toJSON

toJSON(): any

Returns

any

Inherited from

CircuitValue.toJSON

Defined in

lib/circuit_value.ts:146


check

Static check<T>(this, v): void

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
vInstanceType<T>

Returns

void

Inherited from

CircuitValue.check

Defined in

lib/circuit_value.ts:191


empty

Static empty(): PublicKey

Creates an empty PublicKey.

Returns

PublicKey

an empty PublicKey

Defined in

lib/signature.ts:164


from

Static from(g): PublicKey

Creates a PublicKey from a JSON structure element.

Parameters

NameType
gObject
g.isOddBool
g.xField

Returns

PublicKey

a PublicKey.

Defined in

lib/signature.ts:156


fromBase58

Static fromBase58(publicKeyBase58): PublicKey

Decodes a base58 encoded PublicKey into a PublicKey.

Parameters

NameType
publicKeyBase58string

Returns

PublicKey

a PublicKey

Defined in

lib/signature.ts:181


fromFields

Static fromFields<T>(this, xs): InstanceType<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
xsField[]

Returns

InstanceType<T>

Inherited from

CircuitValue.fromFields

Defined in

lib/circuit_value.ts:166


fromGroup

Static fromGroup(«destructured»): PublicKey

Creates a PublicKey from a Group element.

Parameters

NameType
«destructured»Group

Returns

PublicKey

a PublicKey.

Defined in

lib/signature.ts:139


fromJSON

Static fromJSON<T>(this, publicKey): InstanceType<T>

Deserializes a JSON string into a PublicKey.

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
publicKeystring

Returns

InstanceType<T>

a JSON string

Overrides

CircuitValue.fromJSON

Defined in

lib/signature.ts:217


fromObject

Static fromObject<T>(this, value): InstanceType<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
valueNonMethods<InstanceType<T>>

Returns

InstanceType<T>

Inherited from

CircuitValue.fromObject

Defined in

lib/circuit_value.ts:87


fromPrivateKey

Static fromPrivateKey(«destructured»): PublicKey

Derives a PublicKey from a PrivateKey.

Parameters

NameType
«destructured»PrivateKey

Returns

PublicKey

a PublicKey.

Defined in

lib/signature.ts:148


sizeInFields

Static sizeInFields(): number

Returns

number

Inherited from

CircuitValue.sizeInFields

Defined in

lib/circuit_value.ts:94


toAuxiliary

Static toAuxiliary(): []

Returns

[]

Inherited from

CircuitValue.toAuxiliary

Defined in

lib/circuit_value.ts:116


toBase58

Static toBase58(«destructured»): string

Static method to encode a PublicKey into base58 format.

Parameters

NameType
«destructured»PublicKey

Returns

string

a base58 encoded PublicKey

Defined in

lib/signature.ts:198


toConstant

Static toConstant<T>(this, t): InstanceType<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
tInstanceType<T>

Returns

InstanceType<T>

Inherited from

CircuitValue.toConstant

Defined in

lib/circuit_value.ts:205


toFields

Static toFields<T>(this, v): Field[]

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
vInstanceType<T>

Returns

Field[]

Inherited from

CircuitValue.toFields

Defined in

lib/circuit_value.ts:99


toInput

Static toInput<T>(this, v): HashInput

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
vInstanceType<T>

Returns

HashInput

Inherited from

CircuitValue.toInput

Defined in

lib/circuit_value.ts:120


toJSON

Static toJSON(publicKey): string

Serializes a PublicKey into its JSON representation.

Parameters

NameType
publicKeyPublicKey

Returns

string

a JSON string

Overrides

CircuitValue.toJSON

Defined in

lib/signature.ts:209