Skip to content

Commit

Permalink
add filter by bids support
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Jun 6, 2024
1 parent 7fff7f0 commit 6865684
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/OpenAgentsNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {NodeMetaData} from "./NodeConfig";
import NodeConfig from "./NodeConfig";
import JobRunner from "./JobRunner";
import Logger from "./Logger";
import { PoolConnectorClient } from "openagents-grpc-proto";
import { PoolConnectorClient } from "openagents-grpc-proto";
import * as GRPC from "@grpc/grpc-js";
import type { UnaryCall, RpcOutputStream, ServerStreamingCall, RpcOptions, ClientStreamingCall, RpcInputStream } from "@protobuf-ts/runtime-rpc";
import { GrpcTransport } from "@protobuf-ts/grpc-transport";
Expand Down Expand Up @@ -216,6 +216,15 @@ export default class OpenAgentsNode {
filterByKind: filter.filterByKind,
wait: 60000,
excludeId: this.lockedJobs.map((j) => j.jobId),
filterByBids: filter.filterByBids
? filter.filterByBids
: [
{
amount: 0,
currency: "bitcoin",
protocol: "lightning",
}
],
})
);
jobs.push(...res.jobs);
Expand Down
5 changes: 5 additions & 0 deletions src/RunnerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export type JobFilter = {
filterByDescription?: string;
filterById?: string;
filterByKind?: string;
filterByBids?: [{
amount: number;
currency: string;
protocol: string;
}];
};

export type SocketsSchema = {
Expand Down

0 comments on commit 6865684

Please sign in to comment.