olympus-module
Version:
Module made by Olympus Labs for easier access to the Olympus protocol through Javascript/Typescript
23 lines (18 loc) • 570 B
text/typescript
import { getLatestABI } from './AbiService';
import Promisify from '../utils/Promisify';
import Services from '../Services';
export class MarketplaceService extends Services {
private address: string;
constructor(address: string) {
super();
this.address = address;
}
private get contract() {
return (async () => (this.rpcService.contract(await getLatestABI('MARKETPLACE_ABI'), this.address)))();
}
public getAllProducts(): Promise<string[]> {
return Promisify(async (cb) => {
(await this.contract).getAllProducts(cb);
});
}
}