0.3.1 • Published 11 months ago

@afintech/sdk v0.3.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

Architect JavaScript SDK

Architect provides several options for programmatic access to marketdata, order entry, portfolio management, and execution algos. Learn more about our language SDKs at https://docs.architect.co/architect-api-and-sdk-guide.

Prereqs

  • Ensure you have node@lts (v22.x preferred)
  • npm install

Environment Setup

  • Create your API key. Guidelines: Creating an API key.
  • Create a .env file with the following keys:
ARCHITECT_API_KEY=<your-api-key>
ARCHITECT_API_SECRET=<your-api-secret>
# Paper trading only available for GraphQL endpoints at this time
ARCHITECT_TRADING_MODE=paper|live
ARCHITECT_HOST=https://app.architect.co/

Examples

For further examples, see docs at https://docs.architect.co/architect-api-and-sdk-guide.

GraphQL Example

Run with `node --env-file=.env example.mjs

// example.mjs
import { create } from '@afintech/sdk';

const client = create({
  host: /** @type {string} */ (process.env.ARCHITECT_HOST),
  apiKey: /** @type {string} */ (process.env.ARCHITECT_API_KEY),
  apiSecret: /** @type {string} */ (process.env.ARCHITECT_API_SECRET),
  tradingMode: /** @type {'paper' | 'live'} */ (
    process.env.ARCHITECT_TRADING_MODE
  ),
});

const markets = await c.filterMarkets([], {
  venue: 'CME',
  searchString: 'Ether',
});
console.log('CME Ether markets', markets);

const accounts = await c.accounts([]);
console.log(
    'Your FCM accounts:\n',
    accounts.map('* %s', account.name').join('\n')
);

gRPC Example

!NOTE Available soon.

0.3.1

11 months ago

0.3.0

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.2.0-alpha.1

1 year ago

0.2.0-alpha

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

2 years ago