Consensys / starknet-snap

The MetaMask Snap for Starknet
https://snaps.consensys.net/starknet
Apache License 2.0
74 stars 26 forks source link

fix: sf 606 fix voyager cors with official provider #229

Closed stanleyyconsensys closed 5 months ago

stanleyyconsensys commented 5 months ago

This PR is to fix voyager cors issue by updating the provider to a official voyager beta provider

this PR should as quick fix to resolve the cors issue ASAP

note: there is a request limit 30K request per day

mario-christopher commented 5 months ago

On the PR as a whole, we are naming all functions, consts etc with the word voyager. If we changes our indexer service to another Provider, we would need to rename all these to the other provider. Instead should we name with a generic indexer instead of voyager ? Eg.

SNAP_ENV=staging VOYAGER_API_KEY=${{ secrets.VOYAGER_API_KEY }} yarn workspace @consensys/starknet-snap build

// to

SNAP_ENV=staging INDEXER_API_KEY=${{ secrets.INDEXER_API_KEY }} yarn workspace @consensys/starknet-snap build
export function getVoyagerUrl(chainId: string) {

// to

export function getIndexerUrl(chainId: string) {
stanleyyconsensys commented 5 months ago

no worry on the naming, as the fix is a quick fix, we will take care in revamp version

for the ENV var, i will strongly recommend to keep as VOYAGER_API_KEY rather than INDEXER_API_KEY, to make less confusion and easier to maintain

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-starknet-snap'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
88.2% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed for 'consensys_starknet-snap-wallet-ui'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud