
Product
Introducing Webhook Events for Pull Request Scans
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
@identity.com/solana-gateway-ts
Advanced tools
This library provides a utility methods for helping decentralized Apps (dApps) to make use of on-chain identity methods like gateway token retrieval, lookup, and revocation.
yarn add @identity.com/solana-gateway-ts
import {
addGatekeeper,
getGatekeeperAccountKeyFromGatekeeperAuthority,
getGatewayTokenKeyForOwner,
issueVanilla,
findGatewayTokens,
} from "@identity.com/solana-gateway-ts";
Utility method for finding gateway token created for a given public key. This method does the lookup against the Solana blockchain. Returns an empty array if gateway tokens doesn't exist for the given public key.
const gatewayToken: PublicKey = await findGatewayToken(connection, owner, gatekeeperKey);
Optionally, a 'revoked' flag can be passed to allow retrieval of all, even revoked, tokens.
Creates the instruction for adding a gatekeeper to the gatekeeper network Usage:
const payer: Keypair;
const gatekeeperNetwork: Keypair;
const gatekeeperAccount: PublicKey;
const gatekeeperAuthority: PublicKey;
const transaction = new Transaction().add(
addGatekeeper(
payer.publicKey,
gatekeeperAccount,
gatekeeperAuthority,
gatekeeperNetwork.publicKey
)
);
await send(
connection,
transaction,
payer,
gatekeeperNetwork
);
Retrieves the gatekeeperAccount for a gatekeeper authority key, so the caller doens't need to keep a record of the gatekeeper account.
const gatekeeperAccount =
await getGatekeeperAccountKeyFromGatekeeperAuthority(
this.gatekeeperAuthority.publicKey
);
Derives a gateway token key for an owner using the gateway program, additionally accepting a seed parameter
const gatewayTokenKey = await getGatewayTokenKeyForOwner(owner);
Issue a vanilla gatewayToken for an account
const owner: PublicKey;
const payer: Keypair;
const gatekeeperNetwork: Keypair;
const gatekeeperAccount: PublicKey;
const gatekeeperAuthority: PublicKey;
const gatewayTokenKey = await getGatewayTokenKeyForOwner(owner);
const gatekeeperAccount =
await getGatekeeperAccountKeyFromGatekeeperAuthority(
gatekeeperAuthority.publicKey
);
const transaction = new Transaction().add(
issueVanilla(
seed,
gatewayTokenKey,
payer.publicKey,
gatekeeperAccount,
owner,
gatekeeperAuthority.publicKey,
gatekeeperNetwork
)
);
await send(
connection,
transaction,
payer,
gatekeeperAuthority
);
Find gatewayTokens that have been created on a network for an account
const owner: PublicKey;
const gatekeeperNetwork: Keypair;
const accounts = await findGatewayTokens(
connection,
owner.publicKey,
gatekeeperNetworkKey
);
FAQs
Typescript adapters for interacting with Solana gateway program
The npm package @identity.com/solana-gateway-ts receives a total of 153 weekly downloads. As such, @identity.com/solana-gateway-ts popularity was classified as not popular.
We found that @identity.com/solana-gateway-ts demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 12 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.