1.0.3 • Published 1 year ago

backend-market-lib v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago
▶ Market SPW library

Summary

Market Spw lib is a library to communicate with the Market spw server.

Quick start

Install using yarn

yarn add @coin98/market-spw-lib

How to get data from Market spw server

For example: index.ts

import { MarketService, envOrThrow } from "market-spw-lib";

const marketService = new MarketService({
  queueUrl: envOrThrow('your-env'), // AWS SQS url
  region: envOrThrow('your-env'),
  accessKeyId: envOrThrow('your-env'),
  secretAccessKey: envOrThrow('your-env'),
})

// get default token data
marketService.getDefaultToken()
  .then((data) => console.log(data))
  .catch((err) => console.log(err))

// or
const result = await marketService.getDefaultToken()

How to send data

For example: index.ts

import { ProducerService, envOrThrow } from 'market-spw-lib'

const producer = new ProducerService({
  queueUrl: envOrThrow('your-env'), // AWS SQS url
  region: envOrThrow('your-env'),
  accessKeyId: envOrThrow('your-env'),
  secretAccessKey: envOrThrow('your-env'),
})

producer.send(/* Your message here */)