@infosel-sdk/xignite
v0.2.1
Published
Xignite adapter SDK for the Infosel financial services platform
Readme
@infosel-sdk/xignite
SDK of the Infosel Xignite adapter (am-xignite-adapter).
Install
npm install @infosel-sdk/xignite @infosel-sdk/coreUse
import { InfoselXignite } from '@infosel-sdk/xignite';
const xignite = InfoselXignite.init({ sdkManager });
const symbol = await xignite.getSymbol({ instrumentKey: '32/2/21/ADT' });
// { marketTypeId: 32, valueTypeId: 2, exchangeId: 21, symbol: 'ADT', securityTypeId: 1, xigniteSymbolName: 'ADT' }A symbol outside the catalog answers 404, and getSymbol rejects with an SdkError whose message is Symbol not found: <instrumentKey>. With @infosel-sdk/core 0.0.7 or later the error also carries status: 404, so there is no need to compare the text. The key must match exactly: 32/101/16/ADT is not ADT, which lists on NYSE.
The adapter keeps the catalog in the memory of each pod and reloads it hourly through its service, so right after a symbol is activated some pods may still answer 404.
US equity documents
const page = await xignite.getUsEquityDocuments({ limit: 10000 });
// {
// instruments: [
// { id: 'US:A', type: 'stock', market: 'US', symbol: 'A', instrumentDescription: 'Agilent Technologies Inc.',
// isin: null, currency: 'USD', marketIdentifierCode: 'XNYS', referenceClosingPrice: 180.17,
// maximumPrice12Months: 182.99, sharesOutstanding: null },
// ],
// totalRows: 3640, countRows: 1, offset: 0, limit: 10000,
// }GET /am-xignite-adapter/api/v1/instruments/equities/documents: one search document per stock and ETF listed on NYSE, Nasdaq, NYSE Arca, Cboe BZX and NYSE American. offset defaults to 0 and limit to 100, up to 10,000.
Ask for the whole universe in one call: each pod of the adapter keeps its own snapshot, so the pages of a paginated read can come from different snapshots. While a pod has no snapshot the adapter answers 503 and the promise rejects with that SdkError. A 2xx page whose fields do not have the documented types rejects with SdkError(INVALID_DATA_RESPONSE); optional fields the API omits come back as null.
Options
| Option | Default | Purpose |
| ------------ | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| sdkManager | required | InfoselSdkManager with the auth provider |
| baseUrl | host by mode | Base URL up to /am-xignite-adapter/api, e.g. a ClusterIP. Required in preprod, where the adapter has no route: init throws without it |
| timeoutMs | 30000 | Timeout per request |
