diff --git a/src/background/services/keyAutoAdd.ts b/src/background/services/keyAutoAdd.ts index efbf6020..9a2369ee 100644 --- a/src/background/services/keyAutoAdd.ts +++ b/src/background/services/keyAutoAdd.ts @@ -189,6 +189,10 @@ export function walletAddressToProvider(walletAddress: WalletAddress): { return { url: 'https://wallet.interledger-test.dev/settings/developer-keys', }; + case 'ilp.interledger.cards': + return { + url: 'https://wallet.interledger.cards/settings/developer-keys', + }; case 'eu1.fynbos.me': return { url: 'https://eu1.fynbos.dev/settings/keys' }; case 'fynbos.me': diff --git a/src/content/keyAutoAdd/testWallet.ts b/src/content/keyAutoAdd/testWallet.ts index 0ea989b9..3a5f2658 100644 --- a/src/content/keyAutoAdd/testWallet.ts +++ b/src/content/keyAutoAdd/testWallet.ts @@ -26,6 +26,11 @@ type AccountDetails = { }; }; +const API_ORIGIN = + location.host === 'wallet.interledger.cards' + ? 'https://api.interledger.cards' + : `https://api.${location.host}`; + const waitForLogin: Run = async ( { keyAddUrl }, { skip, setNotificationSize }, @@ -125,7 +130,7 @@ const findWallet: Run<{ accountId: string; walletId: string }> = async ( const addKey: Run = async ({ publicKey, nickName }, { output }) => { const { accountId, walletId } = output(findWallet); - const url = `https://api.${location.host}/accounts/${accountId}/wallet-addresses/${walletId}/upload-key`; + const url = `${API_ORIGIN}/accounts/${accountId}/wallet-addresses/${walletId}/upload-key`; const res = await fetch(url, { method: 'POST', headers: { @@ -147,7 +152,7 @@ const addKey: Run = async ({ publicKey, nickName }, { output }) => { // region: Helpers async function revokeKey(accountId: string, walletId: string, keyId: string) { - const url = `https://api.${location.host}/accounts/${accountId}/wallet-addresses/${walletId}/${keyId}/revoke-key/`; + const url = `${API_ORIGIN}/accounts/${accountId}/wallet-addresses/${walletId}/${keyId}/revoke-key/`; const res = await fetch(url, { method: 'PATCH', headers: { diff --git a/src/manifest.json b/src/manifest.json index 03d916ad..e03401be 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -19,7 +19,10 @@ "all_frames": true }, { - "matches": ["https://wallet.interledger-test.dev/*"], + "matches": [ + "https://wallet.interledger-test.dev/*", + "https://wallet.interledger.cards/*" + ], "js": ["content/keyAutoAdd/testWallet.js"], "run_at": "document_end" },