maker-js
Typescript library which exposes the hashflow market maker APIs
Initializing the API
All necessary functions are exposed through the HashflowMaker
object. This API object takes the following arguments to its constructor:
- name: Your market maker's name. This must match the name that used when requesting the Hashflow team to add your market maker to the allowlist.
- authKey: Your authentication key. These are unique keys generated by the Hashflow team during the vetting phase. If you haven't gone through this process, you can contact us on Discord.
- engine: An instance of
MakerEngine
which defines the configuration, pricing strategy, and callback to handle trade confirmation. See next section.
- signer: An instance of
eths.Signer
that will be used to sign quotes on your behalf.
- environment (optional): Allows specifying
'staging'
for connecting to the non-production API. By default, this is set to 'production'
.
Start by importing and initializing the HashflowMaker
object.
import { Signer, VoidSigner } from 'ethers';
import { HashflowMaker } from '@hashflow/market-maker';
const signer: Signer = new VoidSigner('...');
const maker = new HashflowMaker(
'MyMakerName',
'!XYZ...ABC',
engine,
signer,
'staging',
);