From 7af7278d9534ae5a03f5274409d8aa0cbb6ee550 Mon Sep 17 00:00:00 2001 From: Randika Dilshan Date: Wed, 9 Jul 2025 12:00:07 +0530 Subject: [PATCH 1/3] add @supabase/supabase-js package --- package-lock.json | 150 +++++++++++++++++++++++++++++++++++++++++++++- package.json | 1 + 2 files changed, 150 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 16b6a0f..954a7bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "@radix-ui/react-toast": "^1.2.1", "@radix-ui/themes": "^3.0.5", "@reown/walletkit": "^1.1.2", + "@supabase/supabase-js": "^2.50.3", "@walletconnect/core": "^2.17.5", "@walletconnect/utils": "^2.17.5", "class-variance-authority": "^0.7.0", @@ -5446,6 +5447,102 @@ "@stablelib/wipe": "^1.0.1" } }, + "node_modules/@supabase/auth-js": { + "version": "2.70.0", + "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.70.0.tgz", + "integrity": "sha512-BaAK/tOAZFJtzF1sE3gJ2FwTjLf4ky3PSvcvLGEgEmO4BSBkwWKu8l67rLLIBZPDnCyV7Owk2uPyKHa0kj5QGg==", + "license": "MIT", + "dependencies": { + "@supabase/node-fetch": "^2.6.14" + } + }, + "node_modules/@supabase/functions-js": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.4.5.tgz", + "integrity": "sha512-v5GSqb9zbosquTo6gBwIiq7W9eQ7rE5QazsK/ezNiQXdCbY+bH8D9qEaBIkhVvX4ZRW5rP03gEfw5yw9tiq4EQ==", + "license": "MIT", + "dependencies": { + "@supabase/node-fetch": "^2.6.14" + } + }, + "node_modules/@supabase/node-fetch": { + "version": "2.6.15", + "resolved": "https://registry.npmjs.org/@supabase/node-fetch/-/node-fetch-2.6.15.tgz", + "integrity": "sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/@supabase/postgrest-js": { + "version": "1.19.4", + "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.19.4.tgz", + "integrity": "sha512-O4soKqKtZIW3olqmbXXbKugUtByD2jPa8kL2m2c1oozAO11uCcGrRhkZL0kVxjBLrXHE0mdSkFsMj7jDSfyNpw==", + "license": "MIT", + "dependencies": { + "@supabase/node-fetch": "^2.6.14" + } + }, + "node_modules/@supabase/realtime-js": { + "version": "2.11.15", + "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.11.15.tgz", + "integrity": "sha512-HQKRnwAqdVqJW/P9TjKVK+/ETpW4yQ8tyDPPtRMKOH4Uh3vQD74vmj353CYs8+YwVBKubeUOOEpI9CT8mT4obw==", + "license": "MIT", + "dependencies": { + "@supabase/node-fetch": "^2.6.13", + "@types/phoenix": "^1.6.6", + "@types/ws": "^8.18.1", + "isows": "^1.0.7", + "ws": "^8.18.2" + } + }, + "node_modules/@supabase/realtime-js/node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@supabase/storage-js": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.7.1.tgz", + "integrity": "sha512-asYHcyDR1fKqrMpytAS1zjyEfvxuOIp1CIXX7ji4lHHcJKqyk+sLl/Vxgm4sN6u8zvuUtae9e4kDxQP2qrwWBA==", + "license": "MIT", + "dependencies": { + "@supabase/node-fetch": "^2.6.14" + } + }, + "node_modules/@supabase/supabase-js": { + "version": "2.50.3", + "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.50.3.tgz", + "integrity": "sha512-Ld42AbfSXKnbCE2ObRvrGC5wj9OrfTOzswQZg0OcGQGx+QqcWYN/IqsLqrt4gCFrD57URbNRfGESSWzchzKAuQ==", + "license": "MIT", + "dependencies": { + "@supabase/auth-js": "2.70.0", + "@supabase/functions-js": "2.4.5", + "@supabase/node-fetch": "2.6.15", + "@supabase/postgrest-js": "1.19.4", + "@supabase/realtime-js": "2.11.15", + "@supabase/storage-js": "2.7.1" + } + }, "node_modules/@swc/counter": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", @@ -5565,7 +5662,6 @@ "version": "20.17.14", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.14.tgz", "integrity": "sha512-w6qdYetNL5KRBiSClK/KWai+2IMEJuAj+EujKCumalFOwXtvOXaEan9AuwcRID2IcOIAWSIfR495hBtgKlx2zg==", - "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -5577,6 +5673,12 @@ "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==", "license": "MIT" }, + "node_modules/@types/phoenix": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.6.tgz", + "integrity": "sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==", + "license": "MIT" + }, "node_modules/@types/react": { "version": "19.0.8", "resolved": "https://registry.npmjs.org/@types/react/-/react-19.0.8.tgz", @@ -5604,6 +5706,15 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yargs": { "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", @@ -9768,6 +9879,21 @@ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/isows": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz", + "integrity": "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "peerDependencies": { + "ws": "*" + } + }, "node_modules/istanbul-lib-coverage": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", @@ -13296,6 +13422,12 @@ "node": ">=8.0" } }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT" + }, "node_modules/ts-api-utils": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.0.1.tgz", @@ -13909,6 +14041,22 @@ "makeerror": "1.0.12" } }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index f901416..c422ce4 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "@radix-ui/react-toast": "^1.2.1", "@radix-ui/themes": "^3.0.5", "@reown/walletkit": "^1.1.2", + "@supabase/supabase-js": "^2.50.3", "@walletconnect/core": "^2.17.5", "@walletconnect/utils": "^2.17.5", "class-variance-authority": "^0.7.0", From 395e6106adabe7e49bcba6ecb11d589e51c95081 Mon Sep 17 00:00:00 2001 From: Randika Dilshan Date: Wed, 9 Jul 2025 12:01:59 +0530 Subject: [PATCH 2/3] implement community service and Supabase client initialization --- src/services/top-db/community.ts | 30 ++++++++++++++++++++++++++++++ src/services/top-db/index.ts | 20 ++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/services/top-db/community.ts create mode 100644 src/services/top-db/index.ts diff --git a/src/services/top-db/community.ts b/src/services/top-db/community.ts new file mode 100644 index 0000000..da97034 --- /dev/null +++ b/src/services/top-db/community.ts @@ -0,0 +1,30 @@ +import "server-only"; + +import { Config } from "@citizenwallet/sdk"; +import { + PostgrestMaybeSingleResponse, + PostgrestResponse, + SupabaseClient, +} from "@supabase/supabase-js"; + +export interface CommunityT { + alias: string; + chain_id: number; + active: boolean; + created_at: Date; + updated_at: Date; + json: Config; +} + +const TABLE_NAME = "communities"; + +export const getCommunityByAlias = async ( + client: SupabaseClient, + alias: string +): Promise> => { + return await client + .from(TABLE_NAME) + .select("*") + .eq("alias", alias) + .maybeSingle(); +}; diff --git a/src/services/top-db/index.ts b/src/services/top-db/index.ts new file mode 100644 index 0000000..ad18025 --- /dev/null +++ b/src/services/top-db/index.ts @@ -0,0 +1,20 @@ +import "server-only"; + +import { SupabaseClient, createClient } from "@supabase/supabase-js"; + +export const getServiceRoleClient = (): SupabaseClient => { + const serviceRoleKey = process.env.SUPABASE_SERVICE_ROLE_KEY; + const url = process.env.SUPABASE_URL; + const anonKey = process.env.SUPABASE_ANON_KEY; + + if (!serviceRoleKey || !url || !anonKey) { + throw new Error("Missing Supabase environment variables"); + } + + return createClient(url, serviceRoleKey, { + auth: { + autoRefreshToken: true, + persistSession: true, + }, + }); +}; From 63adf045dc13eca960bd75205933843f7f13cc0d Mon Sep 17 00:00:00 2001 From: Randika Dilshan Date: Wed, 9 Jul 2025 12:02:33 +0530 Subject: [PATCH 3/3] remove communities.json and communities.local.json files; refactor community file handling to use Supabase client for fetching community data --- src/services/config/communities.json | 775 --------------------- src/services/config/communities.local.json | 775 --------------------- src/services/config/index.ts | 32 +- 3 files changed, 14 insertions(+), 1568 deletions(-) delete mode 100644 src/services/config/communities.json delete mode 100644 src/services/config/communities.local.json diff --git a/src/services/config/communities.json b/src/services/config/communities.json deleted file mode 100644 index 669974c..0000000 --- a/src/services/config/communities.json +++ /dev/null @@ -1,775 +0,0 @@ -[ - { - "community": { - "name": "Citizen Wallet (CTZN)", - "description": "The token powering the Citizen Wallet economy.", - "url": "https://citizenwallet.xyz", - "alias": "ctzn", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/ctzn.svg", - "theme": { - "primary": "#9563D3" - }, - "profile": { - "address": "0x8dA817724Eb6A2aA47c0F8d8b8A98b9B3C2Ddb68", - "chain_id": 137 - }, - "primary_token": { - "address": "0x0D9B0790E97e3426C161580dF4Ee853E4A7C4607", - "chain_id": 137 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 137 - } - }, - "tokens": { - "137:0x0D9B0790E97e3426C161580dF4Ee853E4A7C4607": { - "standard": "erc20", - "name": "Citizen Wallet", - "address": "0x0D9B0790E97e3426C161580dF4Ee853E4A7C4607", - "symbol": "CTZN", - "decimals": 18, - "chain_id": 137 - } - }, - "scan": { - "url": "https://polygonscan.com", - "name": "Polygon Explorer" - }, - "accounts": { - "137:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 137, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x3A3E25871c5C6C84D5f397829FF316a37F7FD596", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "137": { - "id": 137, - "node": { - "url": "https://137.engine.citizenwallet.xyz", - "ws_url": "wss://137.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "About", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/ctzn.svg", - "url": "https://citizenwallet.xyz/pay-with-ctzn", - "launch_mode": "webview" - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/ctzn.json", - "version": 4 - }, - { - "community": { - "name": "Brussels Pay", - "description": "Open and local payments for Brussels", - "url": "https://pay.brussels", - "alias": "wallet.pay.brussels", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/wallet.pay.brussels.png", - "custom_domain": "wallet.pay.brussels", - "hidden": false, - "theme": { - "primary": "#3331c4" - }, - "profile": { - "address": "0x56Cc38bDa01bE6eC6D854513C995f6621Ee71229", - "chain_id": 100 - }, - "primary_token": { - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "chain_id": 100 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 100 - }, - "primary_card_manager": { - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "chain_id": 100 - } - }, - "tokens": { - "100:0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1": { - "standard": "erc20", - "name": "pay.brussels", - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "symbol": "EURb", - "decimals": 6, - "chain_id": 100, - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/wallet.pay.brussels.png" - }, - "100:0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20": { - "standard": "erc20", - "name": "La Caisse Locale d'Alimentation Solidaire de Schaerbeek", - "address": "0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20", - "symbol": "CLASS", - "decimals": 6, - "chain_id": 100, - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/class.png" - } - }, - "scan": { - "url": "https://gnosisscan.io", - "name": "Gnosis Explorer" - }, - "accounts": { - "100:0xBABCf159c4e3186cf48e4a48bC0AeC17CF9d90FE": { - "chain_id": 100, - "entrypoint_address": "0xAAEb9DC18aDadae9b3aE7ec2b47842565A81113f", - "paymaster_address": "0xcA1B9EC1117340818C1c1fdd1B48Ea79E57C140F", - "account_factory_address": "0xBABCf159c4e3186cf48e4a48bC0AeC17CF9d90FE", - "paymaster_type": "cw" - }, - "100:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 100, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0xE69C843898E21C0E95eA7DD310cD850AAc0aB897", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "cards": { - "100:0x1EaF6B6A6967608aF6c77224f087b042095891EB": { - "chain_id": 100, - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "type": "classic" - }, - "100:0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28": { - "chain_id": 100, - "instance_id": "brussels-pay", - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "type": "safe" - } - }, - "chains": { - "100": { - "id": 100, - "node": { - "url": "https://engine.pay.brussels", - "ws_url": "wss://engine.pay.brussels" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "Top Up", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/wallet.pay.brussels.png", - "url": "https://checkout.pay.brussels/topup", - "action": "topup", - "signature": true, - "token_address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1" - }, - { - "name": "La CLASS", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/class.png", - "url": "https://class.collectif-ssa.be", - "token_address": "0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20" - }, - { - "name": "Participer", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/class.png", - "url": "https://class.collectif-ssa.be/en-pratique/", - "action": "topup", - "signature": true, - "token_address": "0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20" - } - ], - "config_location": "https://wallet.pay.brussels/config/community.json", - "version": 4 - }, - { - "community": { - "name": "Gratitude Token", - "description": "Express your gratitude towards someone by sending them a token of gratitude.", - "url": "https://citizenwallet.xyz/gratitude", - "alias": "gratitude", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/gt.svg", - "theme": { - "primary": "#4EC19D" - }, - "profile": { - "address": "0xEEc0F3257369c6bCD2Fd8755CbEf8A95b12Bc4c9", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 42220 - }, - "primary_card_manager": { - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1": { - "standard": "erc20", - "name": "Gratitude Token", - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "symbol": "GT", - "decimals": 0, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "Celo Explorer" - }, - "accounts": { - "42220:0xAE6E18a9Cd26de5C8f89B886283Fc3f0bE5f04DD": { - "chain_id": 42220, - "entrypoint_address": "0x985ec7d08D9d15Ea79876E35FAdEFD58A627187E", - "paymaster_address": "0x8dd43eE72f6A816b8eB0411B712D96cDd95246d8", - "account_factory_address": "0xAE6E18a9Cd26de5C8f89B886283Fc3f0bE5f04DD", - "paymaster_type": "cw" - }, - "42220:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 42220, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0xF05ba2641b31AF70c2678e3324eD8b9C53093FbE", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "cards": { - "42220:0x1EaF6B6A6967608aF6c77224f087b042095891EB": { - "chain_id": 42220, - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "type": "classic" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [], - "config_location": "https://gratitude.citizenwallet.xyz/config/community.json", - "version": 4 - }, - { - "community": { - "name": "SFLUV Community", - "description": "A community currency for the city of San Francisco.", - "url": "https://sfluv.org", - "alias": "wallet.sfluv.org", - "custom_domain": "wallet.sfluv.org", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/sfluv.svg", - "theme": { - "primary": "#eb6c6c" - }, - "profile": { - "address": "0x05e2Fb34b4548990F96B3ba422eA3EF49D5dAa99", - "chain_id": 137 - }, - "primary_token": { - "address": "0x58a2993A618Afee681DE23dECBCF535A58A080BA", - "chain_id": 137 - }, - "primary_account_factory": { - "address": "0x5e987a6c4bb4239d498E78c34e986acf29c81E8e", - "chain_id": 137 - } - }, - "tokens": { - "137:0x58a2993A618Afee681DE23dECBCF535A58A080BA": { - "standard": "erc20", - "name": "SFLUV V1.1", - "address": "0x58a2993A618Afee681DE23dECBCF535A58A080BA", - "symbol": "SFLUV", - "decimals": 6, - "chain_id": 137 - } - }, - "scan": { - "url": "https://polygonscan.com", - "name": "Polygon Explorer" - }, - "accounts": { - "137:0x5e987a6c4bb4239d498E78c34e986acf29c81E8e": { - "chain_id": 137, - "entrypoint_address": "0x2d01C5E40Aa6a8478eD0FFbF2784EBb9bf67C46A", - "paymaster_address": "0x7FC98D0a2bd7f766bAca37388eB0F6Db37666B33", - "account_factory_address": "0x5e987a6c4bb4239d498E78c34e986acf29c81E8e", - "paymaster_type": "cw" - } - }, - "chains": { - "137": { - "id": 137, - "node": { - "url": "https://137.engine.citizenwallet.xyz", - "ws_url": "wss://137.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "About", - "icon": "https://wallet.sfluv.org/uploads/logo.svg", - "url": "https://app.sfluv.org", - "launch_mode": "webview", - "signature": true, - "hidden": true - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/wallet.sfluv.org.json", - "version": 4 - }, - { - "community": { - "name": "Bolivia Pay", - "description": "A community for Ethereum Bolivia.", - "url": "https://www.ethereumbolivia.org", - "alias": "boliviapay", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/boliviapay.png", - "theme": { - "primary": "#009393" - }, - "profile": { - "address": "0x898C2737f2Cb52622711A89D85A1D5E0B881BDeA", - "chain_id": 137 - }, - "primary_token": { - "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "chain_id": 137 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 137 - } - }, - "tokens": { - "137:0xc2132D05D31c914a87C6611C10748AEb04B58e8F": { - "standard": "erc20", - "name": "(PoS) Tether USD", - "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "symbol": "USDT", - "decimals": 6, - "chain_id": 137 - } - }, - "scan": { - "url": "https://polygonscan.com", - "name": "Polygon Explorer" - }, - "accounts": { - "137:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 137, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x9a81Bd50D56485Cc863Ecb169812c7a821996C8c", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "137": { - "id": 137, - "node": { - "url": "https://137.engine.citizenwallet.xyz", - "ws_url": "wss://137.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "config_location": "https://config.internal.citizenwallet.xyz/v4/boliviapay.json", - "version": 4 - }, - { - "community": { - "name": "Breadchain Community Token", - "description": "BREAD is a digital community token and solidarity primitive developed by Breadchain Cooperative that generates yield for post-capitalist organizations", - "url": "https://breadchain.xyz/", - "alias": "bread", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/bread.svg", - "profile": { - "address": "0x6b3a1f4277391526413F583c23D5B9EF4d2fE986", - "chain_id": 100 - }, - "primary_token": { - "address": "0xa555d5344f6fb6c65da19e403cb4c1ec4a1a5ee3", - "chain_id": 100 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 100 - } - }, - "tokens": { - "100:0xa555d5344f6fb6c65da19e403cb4c1ec4a1a5ee3": { - "standard": "erc20", - "name": "Breadchain Community Token", - "address": "0xa555d5344f6fb6c65da19e403cb4c1ec4a1a5ee3", - "symbol": "BREAD", - "decimals": 18, - "chain_id": 100 - } - }, - "scan": { - "url": "https://gnosisscan.io", - "name": "Gnosis Explorer" - }, - "accounts": { - "100:0xAE76B1C6818c1DD81E20ccefD3e72B773068ABc9": { - "chain_id": 100, - "entrypoint_address": "0xcA0a75EF803a364C83c5EAE7Eb889aE7419c9dF2", - "paymaster_address": "0xbE2Cb3358aa14621134e923B68b8429315368E32", - "account_factory_address": "0xAE76B1C6818c1DD81E20ccefD3e72B773068ABc9", - "paymaster_type": "cw" - }, - "100:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 100, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x5C41F1114AB13aF5d66bac485924D03556d0cd51", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "100": { - "id": 100, - "node": { - "url": "https://100.engine.citizenwallet.xyz", - "ws_url": "wss://100.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "Market", - "icon": "https://bread.citizenwallet.xyz/uploads/logo.svg", - "url": "https://marketplace.citizenwallet.xyz/bread", - "launch_mode": "webview" - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/bread.citizenwallet.xyz.json", - "version": 4 - }, - { - "community": { - "name": "Commons Hub Brussels", - "description": "Community Token for the Commons Hub Brussels community", - "url": "https://commonshub.brussels", - "alias": "wallet.commonshub.brussels", - "custom_domain": "wallet.commonshub.brussels", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/chb.png", - "theme": { - "primary": "#ff4c02" - }, - "profile": { - "address": "0xc06bE1BbbeEAF2f34F3d5b76069D2560aee184Ae", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x65DD32834927de9E57E72a3E2130a19f81C6371D", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x307A9456C4057F7C7438a174EFf3f25fc0eA6e87", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x65DD32834927de9E57E72a3E2130a19f81C6371D": { - "standard": "erc20", - "name": "Commons Hub Token", - "address": "0x65DD32834927de9E57E72a3E2130a19f81C6371D", - "symbol": "CHT", - "decimals": 6, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "CELO Explorer" - }, - "accounts": { - "42220:0x307A9456C4057F7C7438a174EFf3f25fc0eA6e87": { - "chain_id": 42220, - "entrypoint_address": "0xb7608dDA592d319687C89c4479e320b5a7740117", - "paymaster_address": "0x4E127A1DAa66568B4a91E8c5615120a6Ea5442E3", - "account_factory_address": "0x307A9456C4057F7C7438a174EFf3f25fc0eA6e87", - "paymaster_type": "cw" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "cards": { - "42220:0xc0F9e0907C8de79fd5902b61e463dFEdc5dc8570": { - "chain_id": 42220, - "address": "0xc0F9e0907C8de79fd5902b61e463dFEdc5dc8570", - "type": "classic" - } - }, - "plugins": [ - { - "name": "Market", - "icon": "https://marketplace.citizenwallet.xyz/marketplace.svg", - "url": "https://marketplace.citizenwallet.xyz/wallet.commonshub.brussels", - "launch_mode": "webview" - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/wallet.commonshub.brussels.json", - "version": 4 - }, - { - "community": { - "name": "Sel de Salm", - "description": "La communauté de Sel de Salm", - "url": "https://citizenwallet.xyz/community-currency-documentation/sel-de-salm", - "alias": "seldesalm", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/myrt.png", - "theme": { - "primary": "#6B5CA4" - }, - "profile": { - "address": "0x4083724953cC1cC13e76b436149B2b1e1a3E5970", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x83DfEB42347a7Ce46F1497F307a5c156D1f19CB2", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 42220 - }, - "primary_card_manager": { - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x83DfEB42347a7Ce46F1497F307a5c156D1f19CB2": { - "standard": "erc20", - "name": "Myrtille", - "address": "0x83DfEB42347a7Ce46F1497F307a5c156D1f19CB2", - "symbol": "MYRT", - "decimals": 6, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "Celo Explorer" - }, - "accounts": { - "42220:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 42220, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0xd07412020dA5054c3b49f47Ca61224637F1703af", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "cards": { - "42220:0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28": { - "chain_id": 42220, - "instance_id": "cw-seldesalm", - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "type": "safe" - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "Informations Générales", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/myrt.png", - "url": "https://citizenwallet.xyz/community-currency-documentation/sel-de-salm", - "launch_mode": "webview" - }, - { - "name": "Échanges", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/myrt.png", - "url": "https://marketplace.citizenwallet.xyz/seldesalm", - "launch_mode": "webview" - } - ], - "config_location": "https://seldesalm.citizenwallet.xyz/config/community.json", - "version": 4 - }, - { - "community": { - "name": "TECHI", - "description": "A community for TECHI users", - "url": "https://my.techi.be", - "alias": "my.techi.be", - "logo": "https://my.techi.be/assets/token.svg", - "hidden": false, - "theme": { - "primary": "#617FF8" - }, - "profile": { - "address": "0x80C141861607b8FEfD53C9E71a9c7D2D3e2e76dc", - "chain_id": 100 - }, - "primary_token": { - "address": "0x01D0E7117510b371Ac38f52Cc6689ff8875280FA", - "chain_id": 100 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 100 - }, - "primary_card_manager": { - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "chain_id": 100 - } - }, - "tokens": { - "100:0x01D0E7117510b371Ac38f52Cc6689ff8875280FA": { - "standard": "erc20", - "name": "TECHI", - "address": "0x01D0E7117510b371Ac38f52Cc6689ff8875280FA", - "symbol": "TECHI", - "decimals": 6, - "chain_id": 100 - } - }, - "scan": { - "url": "https://gnosisscan.io", - "name": "Gnosis Explorer" - }, - "accounts": { - "100:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 100, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x68c5a20f233264DB124a3c95a200bbD20b3b9762", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "100": { - "id": 100, - "node": { - "url": "https://engine.my.techi.be", - "ws_url": "wss://engine.my.techi.be" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [], - "config_location": "https://my.techi.be/assets/community.json", - "version": 4 - }, - { - "community": { - "name": "KFMEDIA℠", - "description": "Certified Education Organization. Solving systemic educational disparity using Web3 solutions, removing barriers of entry for underdeveloped economies.", - "url": "https://kingfishersmedia.io", - "alias": "wallet.kingfishersmedia.io", - "custom_domain": "wallet.kingfishersmedia.io", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/kfmpfl.png", - "theme": { - "primary": "#88292c" - }, - "profile": { - "address": "0x5f6FEb03ad8EfeCdD2a837FAA1a29DEA2bAcfd55", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x56744910f7dEcD48c1a7FA61B4C317b15E99F156", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 42220 - }, - "primary_card_manager": { - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x56744910f7dEcD48c1a7FA61B4C317b15E99F156": { - "standard": "erc1155", - "name": "KFMEDIA℠ Pathways for LATAM™", - "address": "0x56744910f7dEcD48c1a7FA61B4C317b15E99F156", - "symbol": "KFMPFL", - "decimals": 0, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "Celo Explorer" - }, - "accounts": { - "42220:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 42220, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x02BDA8370d9497A5C808B2db237cfaA8f0733F36", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "config_location": "https://config.internal.citizenwallet.xyz/v4/wallet.kingfishersmedia.io.json", - "version": 4 - } -] \ No newline at end of file diff --git a/src/services/config/communities.local.json b/src/services/config/communities.local.json deleted file mode 100644 index 712e6ac..0000000 --- a/src/services/config/communities.local.json +++ /dev/null @@ -1,775 +0,0 @@ -[ - { - "community": { - "name": "Citizen Wallet (CTZN)", - "description": "The token powering the Citizen Wallet economy.", - "url": "https://citizenwallet.xyz", - "alias": "ctzn", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/ctzn.svg", - "theme": { - "primary": "#9563D3" - }, - "profile": { - "address": "0x8dA817724Eb6A2aA47c0F8d8b8A98b9B3C2Ddb68", - "chain_id": 137 - }, - "primary_token": { - "address": "0x0D9B0790E97e3426C161580dF4Ee853E4A7C4607", - "chain_id": 137 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 137 - } - }, - "tokens": { - "137:0x0D9B0790E97e3426C161580dF4Ee853E4A7C4607": { - "standard": "erc20", - "name": "Citizen Wallet", - "address": "0x0D9B0790E97e3426C161580dF4Ee853E4A7C4607", - "symbol": "CTZN", - "decimals": 18, - "chain_id": 137 - } - }, - "scan": { - "url": "https://polygonscan.com", - "name": "Polygon Explorer" - }, - "accounts": { - "137:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 137, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x3A3E25871c5C6C84D5f397829FF316a37F7FD596", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "137": { - "id": 137, - "node": { - "url": "https://137.engine.citizenwallet.xyz", - "ws_url": "wss://137.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "About", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/ctzn.svg", - "url": "https://citizenwallet.xyz/pay-with-ctzn", - "launch_mode": "webview" - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/ctzn.json", - "version": 4 - }, - { - "community": { - "name": "Brussels Pay", - "description": "Open and local payments for Brussels", - "url": "https://pay.brussels", - "alias": "wallet.pay.brussels", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/wallet.pay.brussels.png", - "custom_domain": "wallet.pay.brussels", - "hidden": false, - "theme": { - "primary": "#3331c4" - }, - "profile": { - "address": "0x56Cc38bDa01bE6eC6D854513C995f6621Ee71229", - "chain_id": 100 - }, - "primary_token": { - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "chain_id": 100 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 100 - }, - "primary_card_manager": { - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "chain_id": 100 - } - }, - "tokens": { - "100:0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1": { - "standard": "erc20", - "name": "pay.brussels", - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "symbol": "EURb", - "decimals": 6, - "chain_id": 100, - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/wallet.pay.brussels.png" - }, - "100:0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20": { - "standard": "erc20", - "name": "La Caisse Locale d'Alimentation Solidaire de Schaerbeek", - "address": "0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20", - "symbol": "CLASS", - "decimals": 6, - "chain_id": 100, - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/class.png" - } - }, - "scan": { - "url": "https://gnosisscan.io", - "name": "Gnosis Explorer" - }, - "accounts": { - "100:0xBABCf159c4e3186cf48e4a48bC0AeC17CF9d90FE": { - "chain_id": 100, - "entrypoint_address": "0xAAEb9DC18aDadae9b3aE7ec2b47842565A81113f", - "paymaster_address": "0xcA1B9EC1117340818C1c1fdd1B48Ea79E57C140F", - "account_factory_address": "0xBABCf159c4e3186cf48e4a48bC0AeC17CF9d90FE", - "paymaster_type": "cw" - }, - "100:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 100, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0xE69C843898E21C0E95eA7DD310cD850AAc0aB897", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "cards": { - "100:0x1EaF6B6A6967608aF6c77224f087b042095891EB": { - "chain_id": 100, - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "type": "classic" - }, - "100:0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28": { - "chain_id": 100, - "instance_id": "brussels-pay", - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "type": "safe" - } - }, - "chains": { - "100": { - "id": 100, - "node": { - "url": "https://engine.pay.brussels", - "ws_url": "wss://engine.pay.brussels" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "Top Up", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/wallet.pay.brussels.png", - "url": "https://checkout.pay.brussels/topup", - "action": "topup", - "signature": true, - "token_address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1" - }, - { - "name": "La CLASS", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/class.png", - "url": "https://class.collectif-ssa.be", - "token_address": "0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20" - }, - { - "name": "Participer", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/class.png", - "url": "https://class.collectif-ssa.be/en-pratique/", - "action": "topup", - "signature": true, - "token_address": "0x601D2Dc12bE367d1653d803827875c2Bcaeb4A20" - } - ], - "config_location": "https://wallet.pay.brussels/config/community.json", - "version": 4 - }, - { - "community": { - "name": "Gratitude Token", - "description": "Express your gratitude towards someone by sending them a token of gratitude.", - "url": "https://citizenwallet.xyz/gratitude", - "alias": "gratitude", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/gt.svg", - "theme": { - "primary": "#4EC19D" - }, - "profile": { - "address": "0xEEc0F3257369c6bCD2Fd8755CbEf8A95b12Bc4c9", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 42220 - }, - "primary_card_manager": { - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1": { - "standard": "erc20", - "name": "Gratitude Token", - "address": "0x5815E61eF72c9E6107b5c5A05FD121F334f7a7f1", - "symbol": "GT", - "decimals": 0, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "Celo Explorer" - }, - "accounts": { - "42220:0xAE6E18a9Cd26de5C8f89B886283Fc3f0bE5f04DD": { - "chain_id": 42220, - "entrypoint_address": "0x985ec7d08D9d15Ea79876E35FAdEFD58A627187E", - "paymaster_address": "0x8dd43eE72f6A816b8eB0411B712D96cDd95246d8", - "account_factory_address": "0xAE6E18a9Cd26de5C8f89B886283Fc3f0bE5f04DD", - "paymaster_type": "cw" - }, - "42220:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 42220, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0xF05ba2641b31AF70c2678e3324eD8b9C53093FbE", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "cards": { - "42220:0x1EaF6B6A6967608aF6c77224f087b042095891EB": { - "chain_id": 42220, - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "type": "classic" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [], - "config_location": "https://gratitude.citizenwallet.xyz/config/community.json", - "version": 4 - }, - { - "community": { - "name": "SFLUV Community", - "description": "A community currency for the city of San Francisco.", - "url": "https://sfluv.org", - "alias": "wallet.sfluv.org", - "custom_domain": "wallet.sfluv.org", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/sfluv.svg", - "theme": { - "primary": "#eb6c6c" - }, - "profile": { - "address": "0x05e2Fb34b4548990F96B3ba422eA3EF49D5dAa99", - "chain_id": 137 - }, - "primary_token": { - "address": "0x58a2993A618Afee681DE23dECBCF535A58A080BA", - "chain_id": 137 - }, - "primary_account_factory": { - "address": "0x5e987a6c4bb4239d498E78c34e986acf29c81E8e", - "chain_id": 137 - } - }, - "tokens": { - "137:0x58a2993A618Afee681DE23dECBCF535A58A080BA": { - "standard": "erc20", - "name": "SFLUV V1.1", - "address": "0x58a2993A618Afee681DE23dECBCF535A58A080BA", - "symbol": "SFLUV", - "decimals": 6, - "chain_id": 137 - } - }, - "scan": { - "url": "https://polygonscan.com", - "name": "Polygon Explorer" - }, - "accounts": { - "137:0x5e987a6c4bb4239d498E78c34e986acf29c81E8e": { - "chain_id": 137, - "entrypoint_address": "0x2d01C5E40Aa6a8478eD0FFbF2784EBb9bf67C46A", - "paymaster_address": "0x7FC98D0a2bd7f766bAca37388eB0F6Db37666B33", - "account_factory_address": "0x5e987a6c4bb4239d498E78c34e986acf29c81E8e", - "paymaster_type": "cw" - } - }, - "chains": { - "137": { - "id": 137, - "node": { - "url": "https://137.engine.citizenwallet.xyz", - "ws_url": "wss://137.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "About", - "icon": "https://wallet.sfluv.org/uploads/logo.svg", - "url": "https://app.sfluv.org", - "launch_mode": "webview", - "signature": true, - "hidden": true - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/wallet.sfluv.org.json", - "version": 4 - }, - { - "community": { - "name": "Bolivia Pay", - "description": "A community for Ethereum Bolivia.", - "url": "https://www.ethereumbolivia.org", - "alias": "boliviapay", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/boliviapay.png", - "theme": { - "primary": "#009393" - }, - "profile": { - "address": "0x898C2737f2Cb52622711A89D85A1D5E0B881BDeA", - "chain_id": 137 - }, - "primary_token": { - "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "chain_id": 137 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 137 - } - }, - "tokens": { - "137:0xc2132D05D31c914a87C6611C10748AEb04B58e8F": { - "standard": "erc20", - "name": "(PoS) Tether USD", - "address": "0xc2132D05D31c914a87C6611C10748AEb04B58e8F", - "symbol": "USDT", - "decimals": 6, - "chain_id": 137 - } - }, - "scan": { - "url": "https://polygonscan.com", - "name": "Polygon Explorer" - }, - "accounts": { - "137:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 137, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x9a81Bd50D56485Cc863Ecb169812c7a821996C8c", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "137": { - "id": 137, - "node": { - "url": "https://137.engine.citizenwallet.xyz", - "ws_url": "wss://137.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "config_location": "https://config.internal.citizenwallet.xyz/v4/boliviapay.json", - "version": 4 - }, - { - "community": { - "name": "Breadchain Community Token", - "description": "BREAD is a digital community token and solidarity primitive developed by Breadchain Cooperative that generates yield for post-capitalist organizations", - "url": "https://breadchain.xyz/", - "alias": "bread", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/bread.svg", - "profile": { - "address": "0x6b3a1f4277391526413F583c23D5B9EF4d2fE986", - "chain_id": 100 - }, - "primary_token": { - "address": "0xa555d5344f6fb6c65da19e403cb4c1ec4a1a5ee3", - "chain_id": 100 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 100 - } - }, - "tokens": { - "100:0xa555d5344f6fb6c65da19e403cb4c1ec4a1a5ee3": { - "standard": "erc20", - "name": "Breadchain Community Token", - "address": "0xa555d5344f6fb6c65da19e403cb4c1ec4a1a5ee3", - "symbol": "BREAD", - "decimals": 18, - "chain_id": 100 - } - }, - "scan": { - "url": "https://gnosisscan.io", - "name": "Gnosis Explorer" - }, - "accounts": { - "100:0xAE76B1C6818c1DD81E20ccefD3e72B773068ABc9": { - "chain_id": 100, - "entrypoint_address": "0xcA0a75EF803a364C83c5EAE7Eb889aE7419c9dF2", - "paymaster_address": "0xbE2Cb3358aa14621134e923B68b8429315368E32", - "account_factory_address": "0xAE76B1C6818c1DD81E20ccefD3e72B773068ABc9", - "paymaster_type": "cw" - }, - "100:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 100, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x5C41F1114AB13aF5d66bac485924D03556d0cd51", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "100": { - "id": 100, - "node": { - "url": "https://100.engine.citizenwallet.xyz", - "ws_url": "wss://100.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "Market", - "icon": "https://bread.citizenwallet.xyz/uploads/logo.svg", - "url": "https://marketplace.citizenwallet.xyz/bread", - "launch_mode": "webview" - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/bread.citizenwallet.xyz.json", - "version": 4 - }, - { - "community": { - "name": "Commons Hub Brussels", - "description": "Community Token for the Commons Hub Brussels community", - "url": "https://commonshub.brussels", - "alias": "wallet.commonshub.brussels", - "custom_domain": "wallet.commonshub.brussels", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/chb.png", - "theme": { - "primary": "#ff4c02" - }, - "profile": { - "address": "0xc06bE1BbbeEAF2f34F3d5b76069D2560aee184Ae", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x65DD32834927de9E57E72a3E2130a19f81C6371D", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x307A9456C4057F7C7438a174EFf3f25fc0eA6e87", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x65DD32834927de9E57E72a3E2130a19f81C6371D": { - "standard": "erc20", - "name": "Commons Hub Token", - "address": "0x65DD32834927de9E57E72a3E2130a19f81C6371D", - "symbol": "CHT", - "decimals": 6, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "CELO Explorer" - }, - "accounts": { - "42220:0x307A9456C4057F7C7438a174EFf3f25fc0eA6e87": { - "chain_id": 42220, - "entrypoint_address": "0xb7608dDA592d319687C89c4479e320b5a7740117", - "paymaster_address": "0x4E127A1DAa66568B4a91E8c5615120a6Ea5442E3", - "account_factory_address": "0x307A9456C4057F7C7438a174EFf3f25fc0eA6e87", - "paymaster_type": "cw" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "cards": { - "42220:0xc0F9e0907C8de79fd5902b61e463dFEdc5dc8570": { - "chain_id": 42220, - "address": "0xc0F9e0907C8de79fd5902b61e463dFEdc5dc8570", - "type": "classic" - } - }, - "plugins": [ - { - "name": "Market", - "icon": "https://marketplace.citizenwallet.xyz/marketplace.svg", - "url": "https://marketplace.citizenwallet.xyz/wallet.commonshub.brussels", - "launch_mode": "webview" - } - ], - "config_location": "https://config.internal.citizenwallet.xyz/v4/wallet.commonshub.brussels.json", - "version": 4 - }, - { - "community": { - "name": "Sel de Salm", - "description": "La communauté de Sel de Salm", - "url": "https://citizenwallet.xyz/community-currency-documentation/sel-de-salm", - "alias": "seldesalm", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/myrt.png", - "theme": { - "primary": "#6B5CA4" - }, - "profile": { - "address": "0x4083724953cC1cC13e76b436149B2b1e1a3E5970", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x83DfEB42347a7Ce46F1497F307a5c156D1f19CB2", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 42220 - }, - "primary_card_manager": { - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x83DfEB42347a7Ce46F1497F307a5c156D1f19CB2": { - "standard": "erc20", - "name": "Myrtille", - "address": "0x83DfEB42347a7Ce46F1497F307a5c156D1f19CB2", - "symbol": "MYRT", - "decimals": 6, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "Celo Explorer" - }, - "accounts": { - "42220:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 42220, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0xd07412020dA5054c3b49f47Ca61224637F1703af", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "cards": { - "42220:0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28": { - "chain_id": 42220, - "instance_id": "cw-seldesalm", - "address": "0xBA861e2DABd8316cf11Ae7CdA101d110CF581f28", - "type": "safe" - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [ - { - "name": "Informations Générales", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/myrt.png", - "url": "https://citizenwallet.xyz/community-currency-documentation/sel-de-salm", - "launch_mode": "webview" - }, - { - "name": "Échanges", - "icon": "https://assets.citizenwallet.xyz/wallet-config/_images/myrt.png", - "url": "https://marketplace.citizenwallet.xyz/seldesalm", - "launch_mode": "webview" - } - ], - "config_location": "https://seldesalm.citizenwallet.xyz/config/community.json", - "version": 4 - }, - { - "community": { - "name": "TECHI", - "description": "A community for TECHI users", - "url": "https://my.techi.be", - "alias": "my.techi.be", - "logo": "https://my.techi.be/assets/token.svg", - "hidden": false, - "theme": { - "primary": "#617FF8" - }, - "profile": { - "address": "0x80C141861607b8FEfD53C9E71a9c7D2D3e2e76dc", - "chain_id": 100 - }, - "primary_token": { - "address": "0x01D0E7117510b371Ac38f52Cc6689ff8875280FA", - "chain_id": 100 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 100 - }, - "primary_card_manager": { - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "chain_id": 100 - } - }, - "tokens": { - "100:0x01D0E7117510b371Ac38f52Cc6689ff8875280FA": { - "standard": "erc20", - "name": "TECHI", - "address": "0x01D0E7117510b371Ac38f52Cc6689ff8875280FA", - "symbol": "TECHI", - "decimals": 6, - "chain_id": 100 - } - }, - "scan": { - "url": "https://gnosisscan.io", - "name": "Gnosis Explorer" - }, - "accounts": { - "100:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 100, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x68c5a20f233264DB124a3c95a200bbD20b3b9762", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "100": { - "id": 100, - "node": { - "url": "https://engine.my.techi.be", - "ws_url": "wss://engine.my.techi.be" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "plugins": [], - "config_location": "https://my.techi.be/assets/community.json", - "version": 4 - }, - { - "community": { - "name": "KFMEDIA℠", - "description": "Certified Education Organization. Solving systemic educational disparity using Web3 solutions, removing barriers of entry for underdeveloped economies.", - "url": "https://kingfishersmedia.io", - "alias": "wallet.kingfishersmedia.io", - "custom_domain": "wallet.kingfishersmedia.io", - "logo": "https://assets.citizenwallet.xyz/wallet-config/_images/kfmpfl.png", - "theme": { - "primary": "#88292c" - }, - "profile": { - "address": "0x5f6FEb03ad8EfeCdD2a837FAA1a29DEA2bAcfd55", - "chain_id": 42220 - }, - "primary_token": { - "address": "0x56744910f7dEcD48c1a7FA61B4C317b15E99F156", - "chain_id": 42220 - }, - "primary_account_factory": { - "address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "chain_id": 42220 - }, - "primary_card_manager": { - "address": "0x1EaF6B6A6967608aF6c77224f087b042095891EB", - "chain_id": 42220 - } - }, - "tokens": { - "42220:0x56744910f7dEcD48c1a7FA61B4C317b15E99F156": { - "standard": "erc1155", - "name": "KFMEDIA℠ Pathways for LATAM™", - "address": "0x56744910f7dEcD48c1a7FA61B4C317b15E99F156", - "symbol": "KFMPFL", - "decimals": 0, - "chain_id": 42220 - } - }, - "scan": { - "url": "https://celoscan.io", - "name": "Celo Explorer" - }, - "accounts": { - "42220:0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2": { - "chain_id": 42220, - "entrypoint_address": "0x7079253c0358eF9Fd87E16488299Ef6e06F403B6", - "paymaster_address": "0x02BDA8370d9497A5C808B2db237cfaA8f0733F36", - "account_factory_address": "0x940Cbb155161dc0C4aade27a4826a16Ed8ca0cb2", - "paymaster_type": "cw-safe" - } - }, - "chains": { - "42220": { - "id": 42220, - "node": { - "url": "https://42220.engine.citizenwallet.xyz", - "ws_url": "wss://42220.engine.citizenwallet.xyz" - } - } - }, - "ipfs": { - "url": "https://ipfs.internal.citizenwallet.xyz" - }, - "config_location": "https://config.internal.citizenwallet.xyz/v4/wallet.kingfishersmedia.io.json", - "version": 4 - } -] \ No newline at end of file diff --git a/src/services/config/index.ts b/src/services/config/index.ts index db04a0c..4f1d0f6 100644 --- a/src/services/config/index.ts +++ b/src/services/config/index.ts @@ -1,40 +1,36 @@ import { Config, parseAliasFromDomain } from "@citizenwallet/sdk"; import { ReadonlyHeaders } from "next/dist/server/web/spec-extension/adapters/headers"; - -import CommunitiesJson from "./communities.json"; -import LocalCommunitiesJson from "./communities.local.json"; +import { getServiceRoleClient } from "../top-db"; +import { getCommunityByAlias } from "../top-db/community"; import ManualMappingJson from "./manualMapping.json"; // Define type for manual mapping to allow string indexing type ManualMapping = { [key: string]: string }; const typedManualMapping = ManualMappingJson as ManualMapping; -const getCommunityFile = async (): Promise => { - if (process.env.NODE_ENV === "production") { - return CommunitiesJson as unknown as Config[]; - } - - return LocalCommunitiesJson as unknown as Config[]; -}; - export const readCommunityFile = async ( _alias = process.env.FALLBACK_COMMUNITY_ALIAS ?? "" ): Promise => { let alias = _alias; + if (process.env.NODE_ENV === "development") { alias = process.env.FALLBACK_COMMUNITY_ALIAS ?? ""; } - const configs = await getCommunityFile(); - if (!configs) { - return undefined; - } + const client = getServiceRoleClient(); + + try { + const community = await getCommunityByAlias(client, alias); - if (configs.length === 0) { + if (community.data) { + return community.data.json; + } + + return undefined; + } catch (error) { + console.error("Error fetching community by alias:", error); return undefined; } - - return configs.find((c) => c.community.alias === alias); }; export const getCommunityFromHeaders = async (