Skip to content

Commit 27a0112

Browse files
committed
Use Alchemy API for testnet Polygon access as well
1 parent 66abad3 commit 27a0112

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ node_modules
55
# local env files
66
.env.local
77
.env.*.local
8+
public/k_*
89

910
# Log files
1011
npm-debug.log*

src/config/config.local.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export default {
1414
usdc: {
1515
enabled: true,
1616
networkId: 80001,
17-
rpcEndpoint: 'https://matic-mumbai.chainstacklabs.com',
18-
rpcMaxBlockRange: 10_000,
17+
rpcEndpoint: 'wss://polygon-mumbai.g.alchemy.com/v2/#ALCHEMY_API_KEY#',
18+
rpcMaxBlockRange: 1_296_000, // 30 days - Range not limited, only limited by number of logs returned
1919
// eslint-disable-next-line max-len
2020
// rpcEndpoint: 'wss://shy-sparkling-wind.matic-testnet.discover.quiknode.pro/4461ca78cea96dd6a168a58d8fc30a021cabf01d/',
2121
usdcContract: '0x0FA8781a83E46826621b3BC094Ea2A0212e71B23',

src/config/config.testnet.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export default {
1414
usdc: {
1515
enabled: true,
1616
networkId: 80001,
17-
rpcEndpoint: 'https://matic-mumbai.chainstacklabs.com',
18-
rpcMaxBlockRange: 10_000,
17+
rpcEndpoint: 'wss://polygon-mumbai.g.alchemy.com/v2/#ALCHEMY_API_KEY#',
18+
rpcMaxBlockRange: 1_296_000, // 30 days - Range not limited, only limited by number of logs returned
1919
usdcContract: '0x0FA8781a83E46826621b3BC094Ea2A0212e71B23',
2020
transferContract: '0x2805f3187dcDfa424EFA8c55Db6012Cf08Fa6eEc', // v3
2121
htlcContract: '0x2EB7cd7791b947A25d629219ead941fCd8f364BF', // v3

src/i18n/fr.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ msgstr "Acheter du NIM sur une plateforme d'échange :"
543543
#: src/components/UsdcTransactionList.vue:48
544544
#: src/components/UsdcTransactionList.vue:58
545545
msgid "Buy USDC"
546-
msgstr ""
546+
msgstr "Acheter de l'USDC"
547547

548548
#: src/components/modals/overlays/BuyCryptoBankCheckOverlay.vue:25
549549
msgid "Buy with Credit Card"

src/lib/KeyReplacer.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ export async function replaceKey(input: string): Promise<string> {
88

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

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

1618
// Create the resulting string without the delimiters
1719
return sections.join('');

0 commit comments

Comments
 (0)