🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@identity.com/solana-gateway-http-client

Package Overview
Dependencies
Maintainers
10
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@identity.com/solana-gateway-http-client

Client for interacting with OCIV gatekeepers

latest
npmnpm
Version
1.2.1
Version published
Maintainers
10
Created
Source

Solana Gateway Http Client library

This library provides a client for allowing decentralized Apps (dApps) to make use of on-chain identity methods like gateway token creation, lookup, and revocation.

  • Solana Gateway Http Client library

Usage

Installation

yarn add @identity.com/solana-gateway-http-client

Import

import { GatekeeperClient, GatekeeperClientConfig, GatekeeperRecord } from '@identity.com/solana-gateway-http-client';

Functions/Classes

GatekeeperClient

The GatekeeperClient is a class with helper methods to enable communication with a Gatekeeper server.

initialisation

The baseUrl of the gatekeeper server must be provided when creating a client instance. Additional headers can be passed in config that will be added to HTTP requests to the gatekeeper-api:

const baseUrl: string = 'http://<gateway url>';
const clientInst = new GatekeeperClient({ baseUrl });

requestGatewayToken

Requests that a gateway token be created for the given Solana public key. Returns the newly created gateway token as a string.

const gatewayToken = await gatekeeperClientInst.requestGatewayToken(walletPublicKey);

const gatewayToken = await gatekeeperClientInst.requestGatewayToken({ walletPublicKey });

A gateway token can be requested by providing a Civic presentationRequestId. The gatekeeper server validates that the presentation provided by the user is successful and a token is generated. The presentationRequest created by the DAPP should contain the publicKey address to create the gateway token for.

const gatewayToken = await gatekeeperClientInst.requestGatewayToken({ presentationRequestId });

auditGatewayToken

Requests a GatekeeperRecord for the given gateway token. The requester must have sufficient privileges to access the GatekeeperRecord.

const auditGatewayTokenResponse: GatekeeperRecord = await gatekeeperClientInst.auditGatewayToken(token);

requestAirdrop

Requests an airdrop of test tokens for predefined test market token accounts (defined in the gatekeeper server). Only available in test environments.

await gatekeeperClientInst.requestAirdrop(walletPublicKey);

FAQs

Package last updated on 06 Aug 2021

Did you know?

Socket

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.

Install

Related posts