amt-graphql
v0.0.1
Published
GraphQL queries, mutations, subscriptions, and services for autonomous mesh trading.
Downloads
38
Maintainers
Readme
amt-graphql
GraphQL queries, mutations, subscriptions, and services for autonomous mesh trading.
Installation
npm install amt-graphql
Usage
QueryService example
import { QueryService } from 'amt-graphql';
QueryService.ListAllNotClosedPositions(client).then((positions: Position[]) =>
{
// Do something with positions.
})
.catch((err: any) =>
{
// Handle error.
});
MutationService example
import { MutationService } from 'amt-graphql';
let position: Position =
{
OwnerID: 'OWNER-ID',
PositionID: 'POSITION-ID',
UpdatedAt: '2018-08-16T01:02:03Z',
};
MutationService.ClosePosition(client, position).then((closedPosition: Position) =>
{
// Do something with closed position.
})
.catch((err: any) =>
{
// Handle error.
});
SubscriptionService example
import { SubscriptionService } from 'amt-graphql';
SubscriptionService.OnCancelEntryExchangeOrderAccepted((position: Position) =>
{
// Do something with mutated position.
},
(err: any) =>
{
// Handle error.
}
);
Build
npm run build