Skip to content

Latest commit

 

History

History
95 lines (55 loc) · 1.76 KB

Subscriber.md

File metadata and controls

95 lines (55 loc) · 1.76 KB

@elfo/sdk / Exports / Subscriber

Class: Subscriber

Represents a subscriber account

Table of contents

Properties

Methods

Properties

authority

authority: string


hasAlreadyBeenInitialized

hasAlreadyBeenInitialized: boolean


publicKey

publicKey: string


subscriberPaymentAccount

subscriberPaymentAccount: string


subscriptionAccounts

subscriptionAccounts: string[]

Methods

address

Static address(authority): string

Helper function to generate subscriber 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 subscriber authority

Returns

string

PDA of the subscriber account in base58 format


from

Static from(subscriberPublicKey, provider): Promise<Subscriber>

Fetches a subscriber instance from a public key

Parameters

Name Type Description
subscriberPublicKey string Public key of the subscription in base58 format
provider default Anchor connection provider

Returns

Promise<Subscriber>