Types.PublicKey
o1js / 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
↳
PublicKey
Table of contents
Constructors
Properties
Methods
- assertEquals
- equals
- isConstant
- isEmpty
- toBase58
- toConstant
- toFields
- toGroup
- toJSON
- check
- empty
- from
- fromBase58
- fromFields
- fromGroup
- fromJSON
- fromObject
- fromPrivateKey
- sizeInFields
- toAuxiliary
- toBase58
- toConstant
- toFields
- toInput
- toJSON
Constructors
constructor
• new PublicKey(...props
)
Parameters
Name | Type |
---|---|
...props | any [] |
Inherited from
Defined in
Properties
isOdd
• isOdd: Bool
Defined in
x
• x: Field
Defined in
Methods
assertEquals
▸ assertEquals(x
): void
Parameters
Name | Type |
---|---|
x | PublicKey |
Returns
void
Inherited from
Defined in
equals
▸ equals(x
): Bool
Parameters
Name | Type |
---|---|
x | PublicKey |
Returns
Inherited from
Defined in
isConstant
▸ isConstant(): boolean
Returns
boolean
Inherited from
Defined in
isEmpty
▸ isEmpty(): Bool
Checks if a PublicKey is empty.
Returns
a Bool
Defined in
toBase58
▸ toBase58(): string
Encodes a PublicKey in base58 format.
Returns
string
a base58 encoded PublicKey
Defined in
toConstant
▸ toConstant(): PublicKey
Returns
Inherited from
Defined in
toFields
▸ toFields(): Field
[]
Returns
Field
[]
Inherited from
Defined in
toGroup
▸ toGroup(): Group
Returns the Group representation of this PublicKey.
Returns
A Group
Defined in
toJSON
▸ toJSON(): any
Returns
any
Inherited from
Defined in
check
▸ Static
check<T
>(this
, v
): void
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
v | InstanceType <T > |
Returns
void
Inherited from
Defined in
empty
▸ Static
empty(): PublicKey
Creates an empty PublicKey.
Returns
an empty PublicKey
Defined in
from
▸ Static
from(g
): PublicKey
Creates a PublicKey from a JSON structure element.
Parameters
Name | Type |
---|---|
g | Object |
g.isOdd | Bool |
g.x | Field |
Returns
a PublicKey.
Defined in
fromBase58
▸ Static
fromBase58(publicKeyBase58
): PublicKey
Decodes a base58 encoded PublicKey into a PublicKey.
Parameters
Name | Type |
---|---|
publicKeyBase58 | string |
Returns
Defined in
fromFields
▸ Static
fromFields<T
>(this
, xs
): InstanceType
<T
>
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
xs | Field [] |
Returns
InstanceType
<T
>
Inherited from
Defined in
fromGroup
▸ Static
fromGroup(«destructured»
): PublicKey
Creates a PublicKey from a Group element.
Parameters
Name | Type |
---|---|
«destructured» | Group |
Returns
a PublicKey.
Defined in
fromJSON
▸ Static
fromJSON<T
>(this
, publicKey
): InstanceType
<T
>
Deserializes a JSON string into a PublicKey.
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
publicKey | string |
Returns
InstanceType
<T
>
a JSON string
Overrides
Defined in
fromObject
▸ Static
fromObject<T
>(this
, value
): InstanceType
<T
>
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
value | NonMethods <InstanceType <T >> |
Returns
InstanceType
<T
>
Inherited from
Defined in
fromPrivateKey
▸ Static
fromPrivateKey(«destructured»
): PublicKey
Derives a PublicKey from a PrivateKey.
Parameters
Name | Type |
---|---|
«destructured» | PrivateKey |
Returns
a PublicKey.
Defined in
sizeInFields
▸ Static
sizeInFields(): number
Returns
number
Inherited from
Defined in
toAuxiliary
▸ Static
toAuxiliary(): []
Returns
[]
Inherited from
Defined in
toBase58
▸ Static
toBase58(«destructured»
): string
Static method to encode a PublicKey into base58 format.
Parameters
Name | Type |
---|---|
«destructured» | PublicKey |
Returns
string
a base58 encoded PublicKey
Defined in
toConstant
▸ Static
toConstant<T
>(this
, t
): InstanceType
<T
>
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
t | InstanceType <T > |
Returns
InstanceType
<T
>
Inherited from
Defined in
toFields
▸ Static
toFields<T
>(this
, v
): Field
[]
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
v | InstanceType <T > |
Returns
Field
[]
Inherited from
Defined in
toInput
▸ Static
toInput<T
>(this
, v
): HashInput
Type parameters
Name | Type |
---|---|
T | extends AnyConstructor |
Parameters
Name | Type |
---|---|
this | T |
v | InstanceType <T > |
Returns
HashInput
Inherited from
Defined in
toJSON
▸ Static
toJSON(publicKey
): string
Serializes a PublicKey into its JSON representation.
Parameters
Name | Type |
---|---|
publicKey | PublicKey |
Returns
string
a JSON string