1
0
Fork 0

Updated the lib for the new api

This commit is contained in:
Julien Dessaux 2023-05-25 01:20:56 +02:00
parent 9963ab79b7
commit b1157af9cd
Signed by: adyxax
GPG key ID: F92E51B86E07177E
5 changed files with 227 additions and 93 deletions

17
lib/contracts.js Normal file
View file

@ -0,0 +1,17 @@
import * as api from './api.js';
export async function accept(ctx) {
return await api.send({endpoint: `/my/contracts/${ctx.id}/accept`, method: 'POST'});
}
export async function contracts() {
return await api.send({endpoint: '/my/contracts'});
}
export async function deliver(ctx) {
return await api.send({ endpoint: `/my/contracts/${ctx.contract}/deliver`, method: 'POST', payload: {
shipSymbol: ctx.ship,
tradeSymbol: ctx.good,
units: ctx.units,
}});
}