The payer of the transaction (used to pay rent into the gatekeeper account)
The gatekeeper network that the account is being added to.
The NetworkFeature Enum value
Add a gatekeeper to a gatekeeper network. Returns a Solana instruction that must be signed by the gatekeeper network authority.
The payer of the transaction (used to pay rent into the gatekeeper account)
An uninitialised gatekeeper account PDA. The address must be derived via getGatekeeperAccountKeyFromGatekeeperAuthority()
The gatekeeper to add to the network
The gatekeeper network that the account is being added to.
Burn a gateway token. Returns a Solana instruction that must be signed by the gatekeeper authority.
The gateway token to burn
The gatekeeper burning the token (must be in the same network as the issuing gatekeeper)
The account in the gatekeeper network of the gatekeeper revoking the token
The account to receive the SOL from the burn
For a gatekeeper network that supports it, create an expireToken instruction, that is to be signed by the gateway token owner.
Return true if an address feature exists.
The feature to check
The gatekeeper network
Get a gateway token for the owner and network, if it exists.
A solana connection object
The token owner
The network to find a token for
If false (default), filter out revoked tokens
Promise<GatewayToken | null> A gateway token, if one exists for the owner
Find all gateway tokens (optionally for a user) on a gatekeeper network, optionally filtering out revoked tokens.
Warning - this uses the Solana getProgramAccounts RPC endpoint, which is inefficient and may be blocked by some RPC services.
A solana connection object
The token owner (optional)
The network to find a token for
If false (default), filter out revoked tokens
If a large number of tokens has been issued, the request to the RPC endpoint may time out. In this case, enable pagination by setting page variable Pagination is not supported in the RPC API per-se, but this approximates it by adding another filter on the first byte of the owner address. Each page requests the accounts that match that byte.
All tokens for the owner
Finds all gateway tokens for a user by iterating through the index seed and requesting a page of addresses at a time.
It assumes a small number of passes per GKN, so the page size by default is 5. Sorts the result by active status and expiry, so unexpired active passes appear first
Freeze a gateway token. Returns a Solana instruction that must be signed by the gatekeeper authority.
The gateway token to freeze
The gatekeeper freezing the token (must be equal to the issuing gatekeeper)
The account in the gatekeeper network of the gatekeeper freezing the token
Returns whether or not a gatekeeper exists from a network and authority
A solana connection
The authority of the gatekeeper
The network of the gatekeeper
Derive the address of the feature PDA
The feature to set.
The network
Derive the address of the gatekeeper PDA for this gatekeeper
The gatekeeper
The network
Lookup the gateway token at a given address
A solana connection object
The address of the gateway token
Derive the address of the gateway token PDA for this owner address and optional seed.
The owner of the gateway token
The network of the gateway token
The index of the gateway token (default 0)
Issue a gateway token to the owner publicKey. Returns a Solana instruction that must be signed by the gatekeeper authority.
An uninitialised gateway token account PDA. The address must be derived via getGatewayTokenAddressForOwnerAndGatekeeperNetwork
The payer of the transaction (used to pay rent into the gatekeeper account).
The account in the gatekeeper network of the gatekeeper issuing the token
The recipient of the token
The gatekeeper issuing the token
The network that the gatekeeper belongs to
An 8-byte seed array, used to add multiple tokens to the same owner. Must be unique to each token, if present
The unix timestamp at which the token is no longer valid
Converts a number to a buffer of U8 integers, for use in the gateway token address derivation as the seed value.
Register a callback to be called whenever a gateway token is created or changes state
A solana connection object
The gateway token owner
The callback to register
The solana commitment level at which to register gateway token changes. Defaults to 'confirmed'
The subscription id
Register a callback to be called whenever a gateway token changes state
A solana connection object
The address of the gateway token
The callback to register
The solana commitment level at which to register gateway token changes. Defaults to 'confirmed'
The subscription id
Stops listening to gateway state changes
A solana connection object
The subscription id to deregister
Remove a feature to an existing Gatekeeper Network. Returns a Solana instruction that must be signed by the gatekeeper authority.
The payer of the transaction (used to pay rent into the gatekeeper account)
The gatekeeper network that the account is being added to.
The NetworkFeature Enum value
Revoke a gateway token. Returns a Solana instruction that must be signed by the gatekeeper authority.
The gateway token to revoke
The gatekeeper revoking the token (must be in the same network as the issuing gatekeeper)
The account in the gatekeeper network of the gatekeeper revoking the token
Removes a gatekeeper from a gatekeeper network. Returns a Solana instruction that must be signed by the gatekeeper network authority.
The account the gatekeeper account's rent goes to
The gatekeeper account PDA. The address must be derived via getGatekeeperAccountKeyFromGatekeeperAuthority()
The gatekeeper to remove from the network
The gatekeeper network that the account is being removed from.
Unfreeze a gateway token. Returns a Solana instruction that must be signed by the gatekeeper authority.
The gateway token to unfreeze
The gatekeeper unfreezing the token (must be equal to the issuing gatekeeper)
The account in the gatekeeper network of the gatekeeper unfreezing the token
Update the expiry time of a gateway token. Returns a Solana instruction that must be signed by the gatekeeper authority.
The gateway token to be updated (must have an expiry time)
The gatekeeper (must be equal to the issuing gatekeeper)
The account in the gatekeeper network of the gatekeeper
The new expiry time
Generated using TypeDoc
Add a feature to an existing Gatekeeper Network. Returns a Solana instruction that must be signed by the gatekeeper authority.