Skip to content

Latest commit

 

History

History
102 lines (61 loc) · 1.81 KB

ElfoNode.md

File metadata and controls

102 lines (61 loc) · 1.81 KB

@elfo/sdk / Exports / ElfoNode

Class: ElfoNode

Represents a elfo node account

Table of contents

Properties

Methods

Properties

authority

authority: string


isRegistered

isRegistered: boolean


nodePaymentAccount

nodePaymentAccount: string


nodePaymentWallet

nodePaymentWallet: string


publicKey

publicKey: string

Methods

address

Static address(authority): string

Helper function to generate node PDA Address

example

const provider: Provider = getProvider();
const nodeAddress: string = ElfoNode.address(provider.wallet.publicKey.toBase58());

Parameters

Name Type Description
authority string Public Key of node authority in base58 format

Returns

string

PDA of the node in base58 format


from

Static from(nodePublicKey, provider): Promise<ElfoNode>

Fetches a node instance from a public key

example

const provider: Provider = getProvider();
const nodeAddress: string = ElfoNode.address(provider.wallet.publicKey.toBase58());
const node: ElfoNode = ElfoNode.from(nodeAddress, provider);

Parameters

Name Type Description
nodePublicKey string Public key of the node
provider default Anchor connection provider

Returns

Promise<ElfoNode>