npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apexfintechsolutions/ascend-sdk

v1.8.2

Published

Apex Ascend SDK

Readme

Introducing the Apex Typescript SDK

In today's fast-paced digital ecosystem, developers need tools that not only streamline the development process but also unlock new possibilities for innovation and efficiency.

Enter the Apex Typescript SDK, a cutting-edge software development kit designed to empower fintech app developers like never before. With our SDK, you can more easily integrate new account creation, optimize trading, and elevate your applications with realtime buying power, all through a seamless SDK interface.

Whether you're building complex, data-driven platforms or simplified, user-centric applications, Apex Typescript SDK was created to offer the flexibility, power, and ease of use to bring your visions to life faster and more effectively. Join us in redefining the boundaries of what your applications can achieve. Start your journey with Apex today.

SDK Installation

NPM

npm add @apexfintechsolutions/ascend-sdk

PNPM

pnpm add @apexfintechsolutions/ascend-sdk

Bun

bun add @apexfintechsolutions/ascend-sdk

Yarn

yarn add @apexfintechsolutions/ascend-sdk zod

# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.

Supported JavaScript Runtimes

This SDK is intended to be used in JavaScript runtimes that support the following features:

Runtime environments that are explicitly supported are:

  • Evergreen browsers which include: Chrome, Safari, Edge, Firefox
  • Node.js active and maintenance LTS releases
    • Currently, this is v18 and v20
  • Bun v1 and above
  • Deno v1.39
    • Note that Deno does not currently have native support for streaming file uploads backed by the filesystem (issue link)

Initializing the SDK

The following sample shows how to initialise the SDK, using the API Key and Service Account Credentials you received during sign-up:

import {Apexascend} from "@apexfintechsolutions/ascend-sdk";

const apexascend = new Apexascend({
    security: {
        apiKey: "ABCDEFGHIJ0123456789abcdefghij0123456789",
        serviceAccountCreds: {
            privateKey: "-----BEGIN PRIVATE KEY--{OMITTED FOR BREVITY}",
            name: "FinFirm",
            organization: "correspondents/00000000-0000-0000-0000-000000000000",
            type: "serviceAccount",
        },
    },
});

async function run() {
    // With an instance of the SDK, invoke any operation e.g.
    let resp = await apexascend.accountCreation.getAccount("VALID_ACCOUNT_ID");
    console.log(resp);
}

run();

Error Handling

ApexascendError is the base class for all HTTP error responses. It has the following properties:

| Property | Type | Description | | ------------------------- | ---------- | --------------------------------------------------------------------------------------- | | error.message | string | Error message | | error.httpMeta.response | Response | HTTP response. Access to headers and more. | | error.httpMeta.request | Request | HTTP request. Access to headers and more. | | error.data$ | | Optional. Some errors may contain structured data. See Error Classes. |

Example

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";
import * as errors from "@apexfintechsolutions/ascend-sdk/models/errors";

const apexascend = new Apexascend({
  security: {
    apiKey: "ABCDEFGHIJ0123456789abcdefghij0123456789",
    serviceAccountCreds: {
      privateKey: "-----BEGIN PRIVATE KEY--{OMITTED FOR BREVITY}",
      name: "FinFirm",
      organization: "correspondents/00000000-0000-0000-0000-000000000000",
      type: "serviceAccount",
    },
  },
});

async function run() {
  try {
    const result = await apexascend.accountCreation.getAccount(
      "01HC3MAQ4DR9QN1V8MJ4CN1HMK",
    );

    console.log(result);
  } catch (error) {
    // The base class for HTTP error responses
    if (error instanceof errors.ApexascendError) {
      console.log(error.message);
      console.log(error.httpMeta.response.status);
      console.log(error.httpMeta.response.headers);
      console.log(error.httpMeta.request);

      // Depending on the method different errors may be thrown
      if (error instanceof errors.Status) {
        console.log(error.data$.code); // number
        console.log(error.data$.details); // Any[]
        console.log(error.data$.message); // string
      }
    }
  }
}

run();

Error Classes

Primary errors:

  • ApexascendError: The base class for HTTP error responses.
    • Status: The status message serves as the general-purpose service error message. Each status message includes a gRPC error code, error message, and error details.

Network errors:

Inherit from ApexascendError:

  • ResponseValidationError: Type mismatch between the data returned from the server and the structure expected by the SDK. See error.rawValue for the raw value and error.pretty() for a nicely formatted multi-line string.

Server Selection

Select Server by Name

You can override the default server globally by passing a server name to the server: keyof typeof ServerList optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers:

| Name | Server | Description | | ------ | -------------------------- | -------------------------- | | uat | https://uat.apexapis.com | our uat environment | | prod | https://api.apexapis.com | our production environment | | sbx | https://sbx.apexapis.com | our sandbox environment |

Example

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";

const apexascend = new Apexascend({
  server: "sbx",
  security: {
    apiKey: "ABCDEFGHIJ0123456789abcdefghij0123456789",
    serviceAccountCreds: {
      privateKey: "-----BEGIN PRIVATE KEY--{OMITTED FOR BREVITY}",
      name: "FinFirm",
      organization: "correspondents/00000000-0000-0000-0000-000000000000",
      type: "serviceAccount",
    },
  },
});

async function run() {
  const result = await apexascend.accountCreation.getAccount(
    "01HC3MAQ4DR9QN1V8MJ4CN1HMK",
  );

  console.log(result);
}

run();

Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the serverURL: string optional parameter when initializing the SDK client instance. For example:

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";

const apexascend = new Apexascend({
  serverURL: "https://uat.apexapis.com",
  security: {
    apiKey: "ABCDEFGHIJ0123456789abcdefghij0123456789",
    serviceAccountCreds: {
      privateKey: "-----BEGIN PRIVATE KEY--{OMITTED FOR BREVITY}",
      name: "FinFirm",
      organization: "correspondents/00000000-0000-0000-0000-000000000000",
      type: "serviceAccount",
    },
  },
});

async function run() {
  const result = await apexascend.accountCreation.getAccount(
    "01HC3MAQ4DR9QN1V8MJ4CN1HMK",
  );

  console.log(result);
}

run();

Custom HTTP Client

The TypeScript SDK makes API calls using an HTTPClient that wraps the native Fetch API. This client is a thin wrapper around fetch and provides the ability to attach hooks around the request lifecycle that can be used to modify the request or handle errors and response.

The HTTPClient constructor takes an optional fetcher argument that can be used to integrate a third-party HTTP client or when writing tests to mock out the HTTP client and feed in fixtures.

The following example shows how to use the "beforeRequest" hook to to add a custom header and a timeout to requests and how to use the "requestError" hook to log errors:

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";
import { HTTPClient } from "@apexfintechsolutions/ascend-sdk/lib/http";

const httpClient = new HTTPClient({
  // fetcher takes a function that has the same signature as native `fetch`.
  fetcher: (request) => {
    return fetch(request);
  }
});

httpClient.addHook("beforeRequest", (request) => {
  const nextRequest = new Request(request, {
    signal: request.signal || AbortSignal.timeout(5000)
  });

  nextRequest.headers.set("x-custom-header", "custom value");

  return nextRequest;
});

httpClient.addHook("requestError", (error, request) => {
  console.group("Request Error");
  console.log("Reason:", `${error}`);
  console.log("Endpoint:", `${request.method} ${request.url}`);
  console.groupEnd();
});

const sdk = new Apexascend({ httpClient });

Available Resources and Operations

accountCreation

accountManagement

accountTransfers

achTransfers

assets

assetTradingConfig

authentication

bankRelationships

basketOrders

cashBalances

checks

dataRetrieval

enrollmentsAndAgreements

feesAndCredits

fixedIncomePricing

instantCashTransferICT

investigations

investorDocs

journals

ledger

margins

orders

personManagement

positionJournals

reader

retirements

scheduleTransfers

subscriber

testSimulation

tradeAllocation

tradeBooking

wires

Pagination

Some of the endpoints in this SDK support pagination. To use pagination, you make your SDK calls as usual, but the returned response object will also be an async iterable that can be consumed using the for await...of syntax.

Here's an example of one such pagination call:

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";

const apexascend = new Apexascend();

async function run() {
  const result = await apexascend.authentication.listSigningKeys({
    apiKeyAuth: "<YOUR_API_KEY_HERE>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Retries

Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.

To change the default retry strategy for a single API call, simply provide a retryConfig object to the call:

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";

const apexascend = new Apexascend();

async function run() {
  const result = await apexascend.authentication.generateServiceAccountToken({
    apiKeyAuth: "<YOUR_API_KEY_HERE>",
  }, {
    jws:
      "eyJhbGciOiAiUlMyNTYifQ.eyJuYW1lIjogImpkb3VnaCIsIm9yZ2FuaXphdGlvbiI6ICJjb3JyZXNwb25kZW50cy8xMjM0NTY3OC0xMjM0LTEyMzQtMTIzNC0xMjM0NTY3ODkxMDEiLCJkYXRldGltZSI6ICIyMDI0LTAyLTA1VDIxOjAyOjI3LjkwMTE4MFoifQ.IMy3KmYoG8Ppf+7hXN7tm7J4MrNpQLGL7WCWvhh4nZWAVKkluL3/u3KC6hZ6Mb/5p7Y54CgZ68aWT2BcP5y4VtzIZR1Chm5pxbLfgE4aJuk+FnF6K3Gc3bBjOWCL58pxY2aTb0iU/exDEA1cbMDvbCzmY5kRefDvorLOqgUS/tS2MJ2jv4RlZFPlmHv5PtOruJ8xUW19gEgGhsPXYYeSHFTE1ZlaDvyXrKtpOvlf+FVc2RTuEw529LZnzwH4/eJJR3BpSpHyJTjQqiaMT3wzpXXYKfCRqnDkSSKJDzCzTb0/uWK/Lf0uafxPXk5YLdis+dbo1zNQhVVKjwnMpk1vLw",
  }, {
    retries: {
      strategy: "backoff",
      backoff: {
        initialInterval: 1,
        maxInterval: 50,
        exponent: 1.1,
        maxElapsedTime: 100,
      },
      retryConnectionErrors: false,
    },
  });

  console.log(result);
}

run();

If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization:

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";

const apexascend = new Apexascend({
  retryConfig: {
    strategy: "backoff",
    backoff: {
      initialInterval: 1,
      maxInterval: 50,
      exponent: 1.1,
      maxElapsedTime: 100,
    },
    retryConnectionErrors: false,
  },
});

async function run() {
  const result = await apexascend.authentication.generateServiceAccountToken({
    apiKeyAuth: "<YOUR_API_KEY_HERE>",
  }, {
    jws:
      "eyJhbGciOiAiUlMyNTYifQ.eyJuYW1lIjogImpkb3VnaCIsIm9yZ2FuaXphdGlvbiI6ICJjb3JyZXNwb25kZW50cy8xMjM0NTY3OC0xMjM0LTEyMzQtMTIzNC0xMjM0NTY3ODkxMDEiLCJkYXRldGltZSI6ICIyMDI0LTAyLTA1VDIxOjAyOjI3LjkwMTE4MFoifQ.IMy3KmYoG8Ppf+7hXN7tm7J4MrNpQLGL7WCWvhh4nZWAVKkluL3/u3KC6hZ6Mb/5p7Y54CgZ68aWT2BcP5y4VtzIZR1Chm5pxbLfgE4aJuk+FnF6K3Gc3bBjOWCL58pxY2aTb0iU/exDEA1cbMDvbCzmY5kRefDvorLOqgUS/tS2MJ2jv4RlZFPlmHv5PtOruJ8xUW19gEgGhsPXYYeSHFTE1ZlaDvyXrKtpOvlf+FVc2RTuEw529LZnzwH4/eJJR3BpSpHyJTjQqiaMT3wzpXXYKfCRqnDkSSKJDzCzTb0/uWK/Lf0uafxPXk5YLdis+dbo1zNQhVVKjwnMpk1vLw",
  });

  console.log(result);
}

run();

Debugging

You can setup your SDK to emit debug logs for SDK requests and responses.

You can pass a logger that matches console's interface as an SDK option.

[!WARNING] Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production.

import { Apexascend } from "@apexfintechsolutions/ascend-sdk";

const sdk = new Apexascend({ debugLogger: console });