Skip to content

Commit

Permalink
Use Alchemy API for testnet Polygon access as well
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Jul 17, 2023
1 parent 66abad3 commit 27a0112
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
# local env files
.env.local
.env.*.local
public/k_*

# Log files
npm-debug.log*
Expand Down
4 changes: 2 additions & 2 deletions src/config/config.local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default {
usdc: {
enabled: true,
networkId: 80001,
rpcEndpoint: 'https://matic-mumbai.chainstacklabs.com',
rpcMaxBlockRange: 10_000,
rpcEndpoint: 'wss://polygon-mumbai.g.alchemy.com/v2/#ALCHEMY_API_KEY#',
rpcMaxBlockRange: 1_296_000, // 30 days - Range not limited, only limited by number of logs returned
// eslint-disable-next-line max-len
// rpcEndpoint: 'wss://shy-sparkling-wind.matic-testnet.discover.quiknode.pro/4461ca78cea96dd6a168a58d8fc30a021cabf01d/',
usdcContract: '0x0FA8781a83E46826621b3BC094Ea2A0212e71B23',
Expand Down
4 changes: 2 additions & 2 deletions src/config/config.testnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export default {
usdc: {
enabled: true,
networkId: 80001,
rpcEndpoint: 'https://matic-mumbai.chainstacklabs.com',
rpcMaxBlockRange: 10_000,
rpcEndpoint: 'wss://polygon-mumbai.g.alchemy.com/v2/#ALCHEMY_API_KEY#',
rpcMaxBlockRange: 1_296_000, // 30 days - Range not limited, only limited by number of logs returned
usdcContract: '0x0FA8781a83E46826621b3BC094Ea2A0212e71B23',
transferContract: '0x2805f3187dcDfa424EFA8c55Db6012Cf08Fa6eEc', // v3
htlcContract: '0x2EB7cd7791b947A25d629219ead941fCd8f364BF', // v3
Expand Down
2 changes: 1 addition & 1 deletion src/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ msgstr "Acheter du NIM sur une plateforme d'échange :"
#: src/components/UsdcTransactionList.vue:48
#: src/components/UsdcTransactionList.vue:58
msgid "Buy USDC"
msgstr ""
msgstr "Acheter de l'USDC"

#: src/components/modals/overlays/BuyCryptoBankCheckOverlay.vue:25
msgid "Buy with Credit Card"
Expand Down
6 changes: 4 additions & 2 deletions src/lib/KeyReplacer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ export async function replaceKey(input: string): Promise<string> {

const keyName = sections[1];
const fileName = `k_${btoa(keyName)}`;
const encodedKey = await fetch(`/${fileName}`).then((res) => res.text());
const encodedKey = await fetch(`/${fileName}`)
.then((res) => res.text())
.then((text) => text.replace(/\s/g, '')); // Remove any whitespace & newlines

// Replace the key name with the key itself
sections[1] = atob(encodedKey.replace(/\s/g, ''));
sections[1] = atob(encodedKey);

// Create the resulting string without the delimiters
return sections.join('');
Expand Down

0 comments on commit 27a0112

Please sign in to comment.