Compare commits

..

1 Commits

Author SHA1 Message Date
a00dab8d06
Initial client for Tovarish Relayer 2024-09-29 18:15: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; var _a;
if (((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) { if (((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({ const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
eventType: this.getTovarishType(), type: this.getTovarishType(),
fromBlock fromBlock
}); });
return { return {
@ -3138,7 +3138,7 @@ class BaseTornadoService extends BaseEventsService {
var _a; var _a;
if ((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) { if ((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({ const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
eventType: this.getTovarishType(), type: this.getTovarishType(),
currency: this.currency, currency: this.currency,
amount: this.amount, amount: this.amount,
fromBlock fromBlock
@ -6835,7 +6835,7 @@ class TovarishClient extends RelayerClient {
} }
getEvents(_0) { getEvents(_0) {
return __async$1(this, arguments, function* ({ return __async$1(this, arguments, function* ({
eventType, type,
currency, currency,
amount, amount,
fromBlock, fromBlock,
@ -6853,7 +6853,7 @@ class TovarishClient extends RelayerClient {
"Content-Type": "application/json" "Content-Type": "application/json"
}, },
body: JSON.stringify({ body: JSON.stringify({
eventType, type,
currency, currency,
amount, amount,
fromBlock, fromBlock,

8
dist/index.mjs vendored
View File

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

8
dist/tornado.umd.js vendored
View File

@ -59281,7 +59281,7 @@ class BaseEventsService {
var _a; var _a;
if (((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) { if (((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({ const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
eventType: this.getTovarishType(), type: this.getTovarishType(),
fromBlock fromBlock
}); });
return { return {
@ -59459,7 +59459,7 @@ class BaseTornadoService extends BaseEventsService {
var _a; var _a;
if ((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) { if ((_a = this.tovarishClient) == null ? void 0 : _a.selectedRelayer) {
const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({ const { events, lastSyncBlock: lastBlock } = yield this.tovarishClient.getEvents({
eventType: this.getTovarishType(), type: this.getTovarishType(),
currency: this.currency, currency: this.currency,
amount: this.amount, amount: this.amount,
fromBlock fromBlock
@ -72209,7 +72209,7 @@ class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .Rela
} }
getEvents(_0) { getEvents(_0) {
return __async(this, arguments, function* ({ return __async(this, arguments, function* ({
eventType, type,
currency, currency,
amount, amount,
fromBlock, fromBlock,
@ -72227,7 +72227,7 @@ class TovarishClient extends _relayerClient__WEBPACK_IMPORTED_MODULE_0__/* .Rela
"Content-Type": "application/json" "Content-Type": "application/json"
}, },
body: JSON.stringify({ body: JSON.stringify({
eventType, type,
currency, currency,
amount, amount,
fromBlock, 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; syncStatus: TovarishSyncStatus;
} }
export interface TovarishEventsQuery { export interface TovarishEventsQuery {
eventType: string; type: string;
currency?: string; currency?: string;
amount?: string; amount?: string;
fromBlock: number; fromBlock: number;
@ -65,5 +65,5 @@ export declare class TovarishClient extends RelayerClient {
validRelayers: TovarishInfo[]; validRelayers: TovarishInfo[];
invalidRelayers: RelayerError[]; invalidRelayers: RelayerError[];
}>; }>;
getEvents<T extends MinimalEvents>({ eventType, currency, amount, fromBlock, recent, }: TovarishEventsQuery): Promise<BaseTovarishEvents<T>>; getEvents<T extends MinimalEvents>({ type, 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>> { async getLatestEvents({ fromBlock }: { fromBlock: number }): Promise<BaseEvents<EventType>> {
if (this.tovarishClient?.selectedRelayer && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) { if (this.tovarishClient?.selectedRelayer && ![DEPOSIT, WITHDRAWAL].includes(this.type.toLowerCase())) {
const { events, lastSyncBlock: lastBlock } = await this.tovarishClient.getEvents<EventType>({ const { events, lastSyncBlock: lastBlock } = await this.tovarishClient.getEvents<EventType>({
eventType: this.getTovarishType(), type: this.getTovarishType(),
fromBlock, fromBlock,
}); });
@ -504,7 +504,7 @@ export class BaseTornadoService extends BaseEventsService<DepositsEvents | Withd
const { events, lastSyncBlock: lastBlock } = await this.tovarishClient.getEvents< const { events, lastSyncBlock: lastBlock } = await this.tovarishClient.getEvents<
DepositsEvents | WithdrawalsEvents DepositsEvents | WithdrawalsEvents
>({ >({
eventType: this.getTovarishType(), type: this.getTovarishType(),
currency: this.currency, currency: this.currency,
amount: this.amount, amount: this.amount,
fromBlock, fromBlock,

View File

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