Compare commits

..

1 Commits

Author SHA1 Message Date
7747e6038f
Initial client for Tovarish Relayer 2024-09-29 17:58:28 +00:00
7 changed files with 20 additions and 20 deletions

8
dist/index.js vendored
View File

@ -2960,7 +2960,7 @@ class BaseEventsService {
var _a;
if (((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
fromBlock
});
return {
@ -3138,7 +3138,7 @@ class BaseTornadoService extends BaseEventsService {
var _a;
if ((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
currency: this.currency,
amount: this.amount,
fromBlock
@ -6835,7 +6835,7 @@ class TovarishClient extends RelayerClient {
}
getEvents(_0) {
return __async$1(this, arguments, function* ({
type,
eventType,
currency,
amount,
fromBlock,
@ -6853,7 +6853,7 @@ class TovarishClient extends RelayerClient {
"Content-Type": "application/json"
},
body: JSON.stringify({
type,
eventType,
currency,
amount,
fromBlock,

8
dist/index.mjs vendored
View File

@ -2939,7 +2939,7 @@ class BaseEventsService {
var _a;
if (((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
fromBlock
});
return {
@ -3117,7 +3117,7 @@ class BaseTornadoService extends BaseEventsService {
var _a;
if ((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
currency: this.currency,
amount: this.amount,
fromBlock
@ -6814,7 +6814,7 @@ class TovarishClient extends RelayerClient {
}
getEvents(_0) {
return __async$1(this, arguments, function* ({
type,
eventType,
currency,
amount,
fromBlock,
@ -6832,7 +6832,7 @@ class TovarishClient extends RelayerClient {
"Content-Type": "application/json"
},
body: JSON.stringify({
type,
eventType,
currency,
amount,
fromBlock,

8
dist/tornado.umd.js vendored
View File

@ -59281,7 +59281,7 @@ class BaseEventsService {
var _a;
if (((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
fromBlock
});
return {
@ -59459,7 +59459,7 @@ class BaseTornadoService extends BaseEventsService {
var _a;
if ((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
currency: this.currency,
amount: this.amount,
fromBlock
@ -72209,7 +72209,7 @@ class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .Rela
}
getEvents(_0) {
return __async(this, arguments, function* ({
type,
eventType,
currency,
amount,
fromBlock,
@ -72227,7 +72227,7 @@ class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .Rela
"Content-Type": "application/json"
},
body: JSON.stringify({
type,
eventType,
currency,
amount,
fromBlock,

File diff suppressed because one or more lines are too long

View File

@ -42,7 +42,7 @@ export interface TovarishInfo extends RelayerInfo {
syncStatus: TovarishSyncStatus;
}
export interface TovarishEventsQuery {
type: string;
eventType: string;
currency?: string;
amount?: string;
fromBlock: number;
@ -65,5 +65,5 @@ export declare class TovarishClient extends RelayerClient {
validRelayers: TovarishInfo[];
invalidRelayers: RelayerError[];
}>;
getEvents<T extends MinimalEvents>({ type, currency, amount, fromBlock, recent, }: TovarishEventsQuery): Promise<BaseTovarishEvents<T>>;
getEvents<T extends MinimalEvents>({ eventType, currency, amount, fromBlock, recent, }: TovarishEventsQuery): Promise<BaseTovarishEvents<T>>;
}

View File

@ -270,7 +270,7 @@ export class BaseEventsService<EventType extends MinimalEvents> {
async getLatestEvents({ fromBlock }: { fromBlock: number }): Promise<BaseEvents<EventType>> {
if (this.tovarishClient?.selectedRelayer && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) {
const { events, lastSyncBlock: lastBlock } = await this.tovarishClient.getEvents<EventType>({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
fromBlock,
});
@ -504,7 +504,7 @@ export class BaseTornadoService extends BaseEventsService<DepositsEvents | Withd
const { events, lastSyncBlock: lastBlock } = await this.tovarishClient.getEvents<
DepositsEvents | WithdrawalsEvents
>({
type: this.getTovarishType(),
eventType: this.getTovarishType(),
currency: this.currency,
amount: this.amount,
fromBlock,

View File

@ -65,7 +65,7 @@ export interface TovarishInfo extends RelayerInfo {
// Query input for TovarishEvents
export interface TovarishEventsQuery {
type: string;
eventType: string;
currency?: string;
amount?: string;
fromBlock: number;
@ -170,7 +170,7 @@ export class TovarishClient extends RelayerClient {
}
async getEvents<T extends MinimalEvents>({
type,
eventType,
currency,
amount,
fromBlock,
@ -192,7 +192,7 @@ export class TovarishClient extends RelayerClient {
'Content-Type': 'application/json',
},
body: JSON.stringify({
type,
eventType,
currency,
amount,
fromBlock,