@edgex-fe/typescript-sdk
Version:
Official TypeScript SDK for EdgeX API - Comprehensive trading and market data integration
58 lines (38 loc) • 1.15 kB
Markdown
# EdgeX TypeScript SDK
Browser-focused TypeScript SDK for EdgeX API with authentication support.
## Installation
```bash
npm install @edgex-fe/typescript-sdk
```
## Quick Start
```typescript
import { EdgeXSDK } from '@edgex-fe/typescript-sdk';
// Initialize SDK
const sdk = new EdgeXSDK({ testnet: true });
// Generate keystore from wallet signatures
const keystore = sdk.generateKeystore(apiSignature, starkSignature);
// Set keystore for authentication
sdk.setKeystore(keystore);
// Generate authentication headers
const { headers } = await sdk.generateAuthHeaders({
method: 'GET',
path: '/api/v1/private/account/info'
});
```
## Development Setup
For local development with edgex-web:
```bash
# In typescript-sdk
npm link
# In edgex-web
npm link @edgex-fe/typescript-sdk
# After changes
npm run build:watch # Changes auto-sync to edgex-web
```
## API
### Main Methods
- `generateKeystore(apiSignature, starkSignature)` - Generate keystore from wallet signatures
- `setKeystore(keystore)` - Set keystore for authentication
- `generateAuthHeaders(request)` - Generate authentication headers for API requests
## License
MIT