File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44# === REQUIRED CONFIGURATION ===
55ANTICAPTURE_GRAPHQL_ENDPOINT = https://api-gateway-production-0879.up.railway.app/graphql
6+ BLOCKFUL_API_TOKEN =
67
78# === NOTIFICATION PLATFORMS ===
89TELEGRAM_BOT_TOKEN =
Original file line number Diff line number Diff line change 11TELEGRAM_BOT_TOKEN = your_telegram_bot_token
22ANTICAPTURE_GRAPHQL_ENDPOINT = https://api-gateway/graphql
3+ BLOCKFUL_API_TOKEN =
34SUBSCRIPTION_SERVER_URL = http://localhost:3001
45API_PORT = 3000
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const envSchema = z.object({
1010 SLACK_SIGNING_SECRET : z . string ( ) ,
1111 TOKEN_ENCRYPTION_KEY : z . string ( ) ,
1212 ANTICAPTURE_GRAPHQL_ENDPOINT : z . string ( ) . url ( "ANTICAPTURE_GRAPHQL_ENDPOINT must be a valid URL" ) ,
13+ BLOCKFUL_API_TOKEN : z . string ( ) . optional ( ) ,
1314 SUBSCRIPTION_SERVER_URL : z . string ( ) ,
1415 RABBITMQ_URL : z . string ( ) . url ( ) ,
1516 PORT : z . coerce . number ( ) . positive ( ) . optional ( ) . default ( 3002 ) ,
@@ -24,6 +25,7 @@ export function loadConfig() {
2425 slackSigningSecret : env . SLACK_SIGNING_SECRET ,
2526 tokenEncryptionKey : env . TOKEN_ENCRYPTION_KEY ,
2627 anticaptureGraphqlEndpoint : env . ANTICAPTURE_GRAPHQL_ENDPOINT ,
28+ blockfulApiToken : env . BLOCKFUL_API_TOKEN ,
2729 subscriptionServerUrl : env . SUBSCRIPTION_SERVER_URL ,
2830 rabbitmqUrl : env . RABBITMQ_URL ,
2931 port : env . PORT ,
Original file line number Diff line number Diff line change @@ -35,7 +35,14 @@ const slackClient = new SlackClient(
3535// Create and start the application
3636const app = new App (
3737 config . subscriptionServerUrl ,
38- axios . create ( { baseURL : config . anticaptureGraphqlEndpoint } ) ,
38+ axios . create ( {
39+ baseURL : config . anticaptureGraphqlEndpoint ,
40+ headers : {
41+ ...( config . blockfulApiToken && {
42+ Authorization : `Bearer ${ config . blockfulApiToken } ` ,
43+ } ) ,
44+ } ,
45+ } ) ,
3946 config . rabbitmqUrl ,
4047 ensResolver ,
4148 telegramClient ,
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ export class App {
2323 private subscriptionServerUrl : string ,
2424 private rabbitmqUrl : string ,
2525 private anticaptureGraphqlEndpoint : string ,
26- private anticaptureHttpClient ?: any
26+ private anticaptureHttpClient ?: any ,
27+ private blockfulApiToken ?: string
2728 ) { }
2829
2930 private async setupServices ( ) : Promise < void > {
@@ -42,6 +43,9 @@ export class App {
4243 baseURL : this . anticaptureGraphqlEndpoint ,
4344 headers : {
4445 'Content-Type' : 'application/json' ,
46+ ...( this . blockfulApiToken && {
47+ Authorization : `Bearer ${ this . blockfulApiToken } ` ,
48+ } ) ,
4549 } ,
4650 } ) ;
4751 const anticaptureClient = new AnticaptureClient ( anticaptureAxiosClient ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const envSchema = z.object({
1111 SUBSCRIPTION_SERVER_URL : z . string ( ) . url ( ) ,
1212 RABBITMQ_URL : z . string ( ) . url ( ) ,
1313 ANTICAPTURE_GRAPHQL_ENDPOINT : z . string ( ) . url ( ) ,
14+ BLOCKFUL_API_TOKEN : z . string ( ) . optional ( ) ,
1415} ) ;
1516
1617export function loadConfig ( ) {
@@ -21,5 +22,6 @@ export function loadConfig() {
2122 subscriptionServerUrl : env . SUBSCRIPTION_SERVER_URL ,
2223 rabbitmqUrl : env . RABBITMQ_URL ,
2324 anticaptureGraphqlEndpoint : env . ANTICAPTURE_GRAPHQL_ENDPOINT ,
25+ blockfulApiToken : env . BLOCKFUL_API_TOKEN ,
2426 } as const ;
2527}
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ const config = loadConfig();
55const app = new App (
66 config . subscriptionServerUrl ,
77 config . rabbitmqUrl ,
8- config . anticaptureGraphqlEndpoint
8+ config . anticaptureGraphqlEndpoint ,
9+ undefined ,
10+ config . blockfulApiToken
911) ;
1012
1113( async ( ) => {
Original file line number Diff line number Diff line change 11# Anticapture GraphQL API
22ANTICAPTURE_GRAPHQL_ENDPOINT = " https://api-gateway/graphql"
3+ BLOCKFUL_API_TOKEN =
34
45# Dispatcher service configuration
56DISPATCHER_ENDPOINT = " http://localhost:3000/api/dispatch"
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ const validProposalStatuses = [
1313// Define environment variables schema with validation
1414const envSchema = z . object ( {
1515 ANTICAPTURE_GRAPHQL_ENDPOINT : z . string ( ) . url ( 'ANTICAPTURE_GRAPHQL_ENDPOINT must be a valid URL' ) ,
16+ BLOCKFUL_API_TOKEN : z . string ( ) . optional ( ) ,
1617 RABBITMQ_URL : z . string ( ) . url ( ) ,
1718 TRIGGER_INTERVAL : z . coerce . number ( ) . optional ( ) . default ( 60000 ) ,
1819 PROPOSAL_STATUS : z . enum ( validProposalStatuses ) ,
Original file line number Diff line number Diff line change @@ -5,7 +5,14 @@ import { env } from './config/env';
55const app = new App (
66 env . TRIGGER_INTERVAL ,
77 env . PROPOSAL_STATUS ,
8- axios . create ( { baseURL : env . ANTICAPTURE_GRAPHQL_ENDPOINT } ) ,
8+ axios . create ( {
9+ baseURL : env . ANTICAPTURE_GRAPHQL_ENDPOINT ,
10+ headers : {
11+ ...( env . BLOCKFUL_API_TOKEN && {
12+ Authorization : `Bearer ${ env . BLOCKFUL_API_TOKEN } ` ,
13+ } ) ,
14+ } ,
15+ } ) ,
916 env . RABBITMQ_URL ,
1017) ;
1118
You can’t perform that action at this time.
0 commit comments