Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add default quicknode #45

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }),
);
}