Options
All
  • Public
  • Public/Protected
  • All
Menu

Encapsulates actions performed by a gatekeeper

Hierarchy

  • GatekeeperService

Index

Constructors

constructor

  • Construct a new GatekeeperService instance

    Parameters

    • connection: Connection

      A solana connection object

    • gatekeeperNetwork: PublicKey

      The network that the gatekeeper belongs to

    • gatekeeperAuthority: Keypair

      The gatekeeper's key

    • config: GatekeeperConfig = {}

      Global default configuration for the gatekeeper

    Returns GatekeeperService

Methods

findGatewayTokenForOwner

  • findGatewayTokenForOwner(owner: PublicKey, includeRevoked?: boolean): Promise<null | GatewayToken>
  • Returns a gateway token owned by this owner, if it exists

    Parameters

    • owner: PublicKey

      PublicKey

    • includeRevoked: boolean = false

      boolean - whether to include revoked tokens (default: false)

    Returns Promise<null | GatewayToken>

    Promise<GatewayToken | null>

freeze

  • freeze(gatewayTokenKey: PublicKey, options?: TransactionOptions): Promise<SendableDataTransaction<GatewayToken>>
  • Freeze the gateway token. The token must have been issued by this gatekeeper.

    Parameters

    • gatewayTokenKey: PublicKey

      PublicKey

    • Optional options: TransactionOptions

      TransactionOptions

    Returns Promise<SendableDataTransaction<GatewayToken>>

    Promise<SendableDataTransaction>

issue

  • issue(recipient: PublicKey, options?: TransactionOptions): Promise<SendableDataTransaction<null | GatewayToken>>
  • Issue a token to this recipient

    Parameters

    • recipient: PublicKey

      PublicKey

    • Optional options: TransactionOptions

      TransactionOptions

    Returns Promise<SendableDataTransaction<null | GatewayToken>>

    Promise<SendableDataTransaction<GatewayToken | null>>

revoke

  • revoke(gatewayTokenKey: PublicKey, options?: TransactionOptions): Promise<SendableDataTransaction<GatewayToken>>
  • Revoke the gateway token. The token must have been issued by a gatekeeper in the same network

    Parameters

    • gatewayTokenKey: PublicKey

      PublicKey

    • Optional options: TransactionOptions

      TransactionOptions

    Returns Promise<SendableDataTransaction<GatewayToken>>

    Promise<SendableDataTransaction>

unfreeze

  • unfreeze(gatewayTokenKey: PublicKey, options?: TransactionOptions): Promise<SendableDataTransaction<GatewayToken>>
  • Unfreeze the gateway token. The token must have been issued by this gatekeeper.

    Parameters

    • gatewayTokenKey: PublicKey

      PublicKey

    • Optional options: TransactionOptions

      TransactionOptions

    Returns Promise<SendableDataTransaction<GatewayToken>>

    Promise<SendableDataTransaction>

updateExpiry

  • updateExpiry(gatewayTokenKey: PublicKey, expireTime: number, options?: TransactionOptions): Promise<SendableDataTransaction<GatewayToken>>
  • Update the expiry time of the gateway token. The token must have been issued by this gatekeeper.

    Parameters

    • gatewayTokenKey: PublicKey

      PublicKey

    • expireTime: number

      number

    • Optional options: TransactionOptions

      TransactionOptions

    Returns Promise<SendableDataTransaction<GatewayToken>>

    Promise<SendableDataTransaction>

Private updateToken

  • updateToken(gatewayTokenKey: PublicKey, instruction: TransactionInstruction, action: Action, options?: TransactionOptions): Promise<SendableDataTransaction<GatewayToken>>
  • Updates a GatewayToken by building a transaction with the given txBuilder function, and returning the existing token with the given updated state value and (optional) expiryTime.

    Parameters

    • gatewayTokenKey: PublicKey

      PublicKey

    • instruction: TransactionInstruction

      TransactionInstruction

    • action: Action

      The action being performed

    • Optional options: TransactionOptions

      TransactionOptions

    Returns Promise<SendableDataTransaction<GatewayToken>>

    Promise<SendableDataTransaction>

Generated using TypeDoc