Updated the lib for the new api
This commit is contained in:
parent
9963ab79b7
commit
b1157af9cd
5 changed files with 227 additions and 93 deletions
17
lib/contracts.js
Normal file
17
lib/contracts.js
Normal 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,
|
||||
}});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue