New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@settlemint/sdk-portal

Package Overview
Dependencies
Maintainers
0
Versions
1856
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@settlemint/sdk-portal

Portal API client module for SettleMint SDK, providing access to smart contract portal services and APIs

  • 1.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

SettleMint logo

SettleMint SDK

https://settlemint.com
Integrate SettleMint into your application with ease.

CI status License npm stars

Documentation   •   NPM   •   Issues

Table of Contents

About

The SettleMint Smart Contract Portal SDK provides a seamless way to interact with the Smart Contract Portal Middleware API. It enables you to easily interact with your smart contracts using a REST or GraphQL API.

The SDK offers a type-safe interface for all Portal API operations, with comprehensive error handling and validation. It integrates smoothly with modern TypeScript applications while providing a simple and intuitive developer experience.

For detailed information about using the Smart Contract Portal Middleware, check out our official documentation.

API Reference

Functions

createPortalClient()

createPortalClient<Setup>(options, clientOptions?): object

Defined in: sdk/portal/src/portal.ts:118

Creates a Portal GraphQL client with the provided configuration.

Type Parameters
Type Parameter
Setup extends AbstractSetupSchema
Parameters
ParameterTypeDescription
optionsOmit<{ accessToken: string; instance: string; runtime: "server"; } | { runtime: "browser"; }, "runtime"> & Record<string, unknown>Configuration options for the Portal client
clientOptions?RequestConfigAdditional GraphQL client configuration options
Returns

object

An object containing the configured GraphQL client and graphql helper function

NameTypeDefined in
clientGraphQLClientsdk/portal/src/portal.ts:122
graphqlinitGraphQLTada<Setup>sdk/portal/src/portal.ts:123
Throws

If the provided options fail validation

Example
import { createPortalClient } from '@settlemint/sdk-portal';
import type { introspection } from "@schemas/portal-env";

// Server-side usage
export const { client: portalClient, graphql: portalGraphql } = createPortalClient<{
  introspection: introspection;
  disableMasking: true;
  scalars: {
    DateTime: Date;
    JSON: Record<string, unknown>;
    Bytes: string;
    Int8: string;
    BigInt: string;
    BigDecimal: string;
    Timestamp: string;
  };
}>({
  instance: process.env.SETTLEMINT_PORTAL_GRAPHQL_ENDPOINT,
  runtime: "server",
  accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,
});

// Browser-side usage
export const { client: portalBrowserClient, graphql: portalBrowserGraphql } = createPortalClient<{
  introspection: introspection;
  disableMasking: true;
  scalars: {
    DateTime: Date;
    JSON: Record<string, unknown>;
    Bytes: string;
    Int8: string;
    BigInt: string;
    BigDecimal: string;
    Timestamp: string;
  };
}>({});

// Making GraphQL queries
const query = graphql(`
  query GetPendingTransactions {
    getPendingTransactions {
      count
    }
  }
`);

const result = await client.request(query);

Type Aliases

ClientOptions

ClientOptions: { accessToken: string; instance: string; runtime: "server"; } | { runtime: "browser"; }

Defined in: sdk/portal/src/portal.ts:30

Type representing the validated client options.


RequestConfig

RequestConfig: ConstructorParameters<typeof GraphQLClient>[1]

Defined in: sdk/portal/src/portal.ts:10

Configuration options for the GraphQL client, excluding 'url' and 'exchanges'.

Variables

ClientOptionsSchema

const ClientOptionsSchema: ZodDiscriminatedUnion<ClientOptions>

Defined in: sdk/portal/src/portal.ts:16

Schema for validating Portal client configuration options. Discriminates between server and browser runtime environments.

Contributing

We welcome contributions from the community! Please check out our Contributing guide to learn how you can help improve the SettleMint SDK through bug reports, feature requests, documentation updates, or code contributions.

License

The SettleMint SDK is released under the FSL Software License. See the LICENSE file for more details.

Keywords

FAQs

Package last updated on 13 Feb 2025

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc