Skip to content

Commit

Permalink
fix: add default quicknode (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakulstra authored Nov 26, 2024
1 parent a345d50 commit cd4ea52
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ inputs:
ALCHEMY_API_KEY:
description: "Alchemy API key"
required: false
QUICKNODE_TOKEN:
description: "Quicknode token"
required: false
QUICKNODE_ENDPOINT_NAME:
description: "Quicknode endpoint name"
required: false

runs:
using: "node20"
Expand Down
7 changes: 6 additions & 1 deletion dist/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -23850,10 +23850,15 @@ var getRPCUrl = (chainId, options) => {

// src/action.ts
var alchemyKey = (0, import_core.getInput)("ALCHEMY_API_KEY") !== "" ? (0, import_core.getInput)("ALCHEMY_API_KEY") : void 0;
var quicknodeToken = (0, import_core.getInput)("QUICKNODE_TOKEN") !== "" ? (0, import_core.getInput)("QUICKNODE_TOKEN") : "5196b99cdae04535ecd62906c3b618876686618a";
var quicknodeEndpointName = (0, import_core.getInput)("QUICKNODE_ENDPOINT_NAME") !== "" ? (0, import_core.getInput)("QUICKNODE_ENDPOINT_NAME") : "quaint-still-liquid";
for (const chainId of Object.values(ChainId)) {
const envVarName = getNetworkEnv(chainId);
(0, import_core.debug)(`Setting ${envVarName}`);
(0, import_core.exportVariable)(envVarName, getRPCUrl(chainId, { alchemyKey }));
(0, import_core.exportVariable)(
envVarName,
getRPCUrl(chainId, { alchemyKey, quicknodeToken, quicknodeEndpointName })
);
}
/*! Bundled license information:

Expand Down
7 changes: 6 additions & 1 deletion dist/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23848,10 +23848,15 @@ var getRPCUrl = (chainId, options) => {

// src/action.ts
var alchemyKey = (0, import_core.getInput)("ALCHEMY_API_KEY") !== "" ? (0, import_core.getInput)("ALCHEMY_API_KEY") : void 0;
var quicknodeToken = (0, import_core.getInput)("QUICKNODE_TOKEN") !== "" ? (0, import_core.getInput)("QUICKNODE_TOKEN") : "5196b99cdae04535ecd62906c3b618876686618a";
var quicknodeEndpointName = (0, import_core.getInput)("QUICKNODE_ENDPOINT_NAME") !== "" ? (0, import_core.getInput)("QUICKNODE_ENDPOINT_NAME") : "quaint-still-liquid";
for (const chainId of Object.values(ChainId)) {
const envVarName = getNetworkEnv(chainId);
(0, import_core.debug)(`Setting ${envVarName}`);
(0, import_core.exportVariable)(envVarName, getRPCUrl(chainId, { alchemyKey }));
(0, import_core.exportVariable)(
envVarName,
getRPCUrl(chainId, { alchemyKey, quicknodeToken, quicknodeEndpointName })
);
}
/*! Bundled license information:

Expand Down
15 changes: 14 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ import { ChainId, getNetworkEnv, getRPCUrl } from "./lib";
const alchemyKey =
getInput("ALCHEMY_API_KEY") !== "" ? getInput("ALCHEMY_API_KEY") : undefined;

const quicknodeToken =
getInput("QUICKNODE_TOKEN") !== ""
? getInput("QUICKNODE_TOKEN")
: "5196b99cdae04535ecd62906c3b618876686618a";

const quicknodeEndpointName =
getInput("QUICKNODE_ENDPOINT_NAME") !== ""
? getInput("QUICKNODE_ENDPOINT_NAME")
: "quaint-still-liquid";

/**
* Iterates over the supported chain ids and sets the corresponding env var
* if the input is not empty.
Expand All @@ -12,5 +22,8 @@ const alchemyKey =
for (const chainId of Object.values(ChainId)) {
const envVarName = getNetworkEnv(chainId);
debug(`Setting ${envVarName}`);
exportVariable(envVarName, getRPCUrl(chainId, { alchemyKey: alchemyKey }));
exportVariable(
envVarName,
getRPCUrl(chainId, { alchemyKey, quicknodeToken, quicknodeEndpointName }),
);
}

0 comments on commit cd4ea52

Please sign in to comment.