Skip to content

Commit 4f20592

Browse files
committed
fix starknet rpc
1 parent edbcd72 commit 4f20592

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

.github/workflows/master.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ jobs:
4848
DUNE_API_KEY: ${{ secrets.DUNE_API_KEY}}
4949
HYPERLIQUID_RPC: ${{ secrets.HYPERLIQUID_RPC }}
5050
PLASMA_RPC: ${{ secrets.PLASMA_RPC }}
51+
STARKNET_RPC: ${{ secrets.STARKNET_RPC }}

env.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ module.exports = {
3030
DUNE_API_KEY: process.env.DUNE_API_KEY,
3131
HYPERLIQUID_RPC: process.env.HYPERLIQUID_RPC,
3232
PLASMA_RPC: process.env.PLASMA_RPC,
33+
STARKNET_RPC: process.env.STARKNET_RPC,
3334
};

serverless.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ functions:
8383
DUNE_API_KEY: ${file(./env.js):DUNE_API_KEY}
8484
HYPERLIQUID_RPC: ${file(./env.js):HYPERLIQUID_RPC}
8585
PLASMA_RPC: ${file(./env.js):PLASMA_RPC}
86+
STARKNET_RPC: ${file(./env.js):STARKNET_RPC}
8687

8788
# --- data enrichment
8889
triggerEnrichment:

src/adaptors/vesu/starknet-helper.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const { Contract, validateAndParseAddress, number, hash, uint256, } = require('starknet')
22
const axios = require('axios')
33

4-
const STARKNET_RPC = 'https://starknet-mainnet.public.blastapi.io'
5-
64
function formCallBody({ abi, target, params = [] }, id = 0) {
75
if ((params || params === 0) && !Array.isArray(params))
86
params = [params]
@@ -116,7 +114,7 @@ function parseOutput(result, abi) {
116114
async function call({ abi, target, params = [] } = {}) {
117115
const callBody = formCallBody({ abi, target, params })
118116

119-
const { data } = await axios.post(STARKNET_RPC, callBody)
117+
const { data } = await axios.post(process.env.STARKNET_RPC, callBody)
120118

121119
if (data.error) {
122120
throw new Error(`RPC Error: ${data.error.message}`)

src/helper/starknet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { sliceIntoChunks, sleep } = require('./utils')
77
const _rateLimited = plimit(1)
88
const rateLimited = fn => (...args) => _rateLimited(() => fn(...args))
99

10-
const STARKNET_RPC = 'https://starknet-mainnet.public.blastapi.io'
10+
const STARKNET_RPC = process.env.STARKNET_RPC
1111

1212
function formCallBody({ abi, target, params = [], allAbi = [] }, id = 0) {
1313
if ((params || params === 0) && !Array.isArray(params))

0 commit comments

Comments
 (0)