From 7bada3e0a8a06629df95a946f26de3a0a4a95fbb Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:49:56 -0800 Subject: [PATCH 1/5] Remove sandboxnet and add crescendo --- README.md | 2 ++ data/services.json | 1 + helpers/constants.js | 6 +++--- pages/index.js | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8fba3537..54b9135a 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ fcl.config({ | ----------- | ---------------------------------------------------------------------- | | Mainnet | `http://localhost:3002/authn` or `http://localhost:3002/mainnet/authn` | | Testnet | `http://localhost:3002/testnet/authn` | +| Crescendo | `http://localhost:3002/crescendo/authn` | | Local | `http://localhost:3002/local/authn` | | Emulator | `http://localhost:3002/emulator/authn` | @@ -42,6 +43,7 @@ fcl.config({ | ----------- | ------------------------------------------------------------------------------ | | Mainnet | `http://localhost:3002/api/authn` or `http://localhost:3002/api/mainnet/authn` | | Testnet | `http://localhost:3002/api/testnet/authn` | +| Crescendo | `http://localhost:3002/api/crescendo/authn` | | Local | `http://localhost:3002/api/local/authn` | | Emulator | `http://localhost:3002/api/emulator/authn` | diff --git a/data/services.json b/data/services.json index 5cce378e..197c5639 100644 --- a/data/services.json +++ b/data/services.json @@ -247,6 +247,7 @@ } } ], + "crescendo": [], "canarynet": [ { "f_type": "Service", diff --git a/helpers/constants.js b/helpers/constants.js index 383d7e81..800aa972 100644 --- a/helpers/constants.js +++ b/helpers/constants.js @@ -1,11 +1,11 @@ import Enum from 'enum-xyz' -const { AUTHN, CANARYNET, TESTNET, SANDBOXNET, MAINNET, LOCAL, EMULATOR } = Enum.String({ casing: 'lowercase' }) +const { AUTHN, CANARYNET, TESTNET, CRESCENDO, MAINNET, LOCAL, EMULATOR } = Enum.String({ casing: 'lowercase' }) export const NETWORKS = { CANARYNET, // canarynet TESTNET, - SANDBOXNET, + CRESCENDO, MAINNET, LOCAL, EMULATOR @@ -31,7 +31,7 @@ export const PATHS = { MAINNET: '/authn', MAINNET_EXPLICIT: '/mainnet/authn', TESTNET: '/testnet/authn', - SANDBOXNET: '/sandboxnet/authn', + CRESCENDO: '/crescendo/authn', CANARYNET: '/canarynet/authn', LOCAL: '/local/authn', EMULATOR: '/emulator/authn', diff --git a/pages/index.js b/pages/index.js index e0b21555..12f4fc9e 100644 --- a/pages/index.js +++ b/pages/index.js @@ -11,6 +11,10 @@ export default function Home() { Testnet:{' '} https://fcl-discovery.onflow.org/api/testnet/authn +
+ Crescendo:{' '} + https://fcl-discovery.onflow.org/api/crescendo/authn +
Local:{' '} https://fcl-discovery.onflow.org/api/local/authn From 29828b659d07acd32d56e006da04823df9bac5a3 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:50:37 -0800 Subject: [PATCH 2/5] Remove sandboxnet --- data/services.json | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/data/services.json b/data/services.json index 197c5639..5c4251a0 100644 --- a/data/services.json +++ b/data/services.json @@ -120,26 +120,6 @@ } } ], - "sandboxnet": [ - { - "f_type": "Service", - "f_vsn": "1.0.0", - "type": "authn", - "method": "POP/RPC", - "uid": "dapper-wallet#authn", - "endpoint": "https://sandbox.accounts.meetdapper.com/fcl/authn-restricted", - "optIn": true, - "provider": { - "address": "0x6b0d5e229a66db2d", - "name": "Dapper Wallet", - "icon": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzE1IiBoZWlnaHQ9IjMxNSIgdmlld0JveD0iLTUwIC01MCA0MTUgNDE1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMxNC45OTkgMTYwLjk2NEMzMTQuOTk5IDc0LjA0MTMgMjQ0LjQ4NSAzLjU3NjQyI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WxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMzQuOTgxIDEyOC44NzZDMTM0Ljk4MSAxMzguNjU2IDEyNy4wNTIgMTQ2LjU4MSAxMTcuMjcxIDE0Ni41ODFDMTA3LjQ5NSAxNDYuNTgxIDk5LjU2NTkgMTM4LjY1NiA5OS41NjU5IDEyOC44NzZDOTkuNTY1OSAxMTkuMDk5IDEwNy40OTUgMTExLjE3IDExNy4yNzEgMTExLjE3QzEyNy4wNTIgMTExLjE3IDEzNC45ODEgMTE5LjA5OSAxMzQuOTgxIDEyOC44NzZaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTI1My4wMjEgMTI4Ljg3NkMyNTMuMDIxIDEzOC42NTYgMjQ1LjA5MyAxNDYuNTgxIDIzNS4zMTYgMTQ2LjU4MUMyMjUuNTM1IDE0Ni41ODEgMjE3LjYxIDEzOC42NTYgMjE3LjYxIDEyOC44NzZDMjE3LjYxIDExOS4wOTkgMjI1LjUzNSAxMTEuMTcgMjM1LjMxNiAxMTEuMTdDMjQ1LjA5MyAxMTEuMTcgMjUzLjAyMSAxMTkuMDk5IDI1My4wMjEgMTI4Ljg3NloiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPg==", - "description": "The trusted gateway to your digital world.", - "color": "#FF5A9D", - "supportEmail": "support@meetdapper.com", - "website": "https://meetdapper.com" - } - } - ], "testnet": [ { "f_type": "Service", From 79f84d3414027ac04affa02db7015b6bffd70572 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:51:25 -0800 Subject: [PATCH 3/5] Add isTestnet check --- helpers/networks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/networks.js b/helpers/networks.js index dc2beaa7..c975b87f 100644 --- a/helpers/networks.js +++ b/helpers/networks.js @@ -1,5 +1,5 @@ import { NETWORKS } from './constants' export const isTestnet = () => { - return window.location.pathname.split('/').includes(NETWORKS.TESTNET) + return window.location.pathname.split('/').includes(NETWORKS.TESTNET) || window.location.pathname.split('/').includes(NETWORKS.CRESCENDO) } From 7aaba1615f37c66f0502a46c700a9cc26e50777d Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:52:56 -0800 Subject: [PATCH 4/5] Fix test --- helpers/__tests__/paths.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helpers/__tests__/paths.test.js b/helpers/__tests__/paths.test.js index 156b2a60..e4687e84 100644 --- a/helpers/__tests__/paths.test.js +++ b/helpers/__tests__/paths.test.js @@ -6,13 +6,13 @@ describe('paths helpers: createPathFromArray', () => { const arrTwo = ['mainnet', 'authn'] const arrThree = ['testnet', 'authn'] const arrFour = ['canarynet', 'authn'] - const arrFive = ['sandboxnet', 'authn'] + const arrFive = ['crescendo', 'authn'] const expectedResponseOne = '/authn' const expectedResponseTwo = '/mainnet/authn' const expectedResponseThree = '/testnet/authn' const expectedResponseFour = '/canarynet/authn' - const expectedResponseFive = '/sandboxnet/authn' + const expectedResponseFive = '/crescendo/authn' expect(createPathFromArray(arrOne)).toEqual(expectedResponseOne) expect(createPathFromArray(arrTwo)).toEqual(expectedResponseTwo) @@ -29,7 +29,7 @@ describe('paths helpers: isValidPath', () => { const pathThree = ['testnet', 'authn'] const pathFour = ['canarynet', 'authn'] const pathFive = ['foo', 'bar'] - const pathSix = ['sandboxnet', 'authn'] + const pathSix = ['crescendo', 'authn'] expect(isValidPath(pathOne)).toBe(true) expect(isValidPath(pathTwo)).toBe(true) From 41b10435a70a4f2e876da497c724cdf32646ddb7 Mon Sep 17 00:00:00 2001 From: Chase Fleming <1666730+chasefleming@users.noreply.github.com> Date: Thu, 8 Feb 2024 15:55:01 -0800 Subject: [PATCH 5/5] Add emulator/local tests --- helpers/__tests__/paths.test.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/helpers/__tests__/paths.test.js b/helpers/__tests__/paths.test.js index e4687e84..4b205f5f 100644 --- a/helpers/__tests__/paths.test.js +++ b/helpers/__tests__/paths.test.js @@ -7,18 +7,24 @@ describe('paths helpers: createPathFromArray', () => { const arrThree = ['testnet', 'authn'] const arrFour = ['canarynet', 'authn'] const arrFive = ['crescendo', 'authn'] + const arrSix= ['local', 'authn'] + const arrSeven = ['emulator', 'authn'] const expectedResponseOne = '/authn' const expectedResponseTwo = '/mainnet/authn' const expectedResponseThree = '/testnet/authn' const expectedResponseFour = '/canarynet/authn' const expectedResponseFive = '/crescendo/authn' + const expectedResponseSix = '/local/authn' + const expectedResponseSeven = '/emulator/authn' expect(createPathFromArray(arrOne)).toEqual(expectedResponseOne) expect(createPathFromArray(arrTwo)).toEqual(expectedResponseTwo) expect(createPathFromArray(arrThree)).toEqual(expectedResponseThree) expect(createPathFromArray(arrFour)).toEqual(expectedResponseFour) expect(createPathFromArray(arrFive)).toEqual(expectedResponseFive) + expect(createPathFromArray(arrSix)).toEqual(expectedResponseSix) + expect(createPathFromArray(arrSeven)).toEqual(expectedResponseSeven) }) }) @@ -30,6 +36,8 @@ describe('paths helpers: isValidPath', () => { const pathFour = ['canarynet', 'authn'] const pathFive = ['foo', 'bar'] const pathSix = ['crescendo', 'authn'] + const pathSeven = ['local', 'authn'] + const pathEight = ['emulator', 'authn'] expect(isValidPath(pathOne)).toBe(true) expect(isValidPath(pathTwo)).toBe(true) @@ -37,6 +45,8 @@ describe('paths helpers: isValidPath', () => { expect(isValidPath(pathFour)).toBe(true) expect(isValidPath(pathFive)).toBe(false) expect(isValidPath(pathSix)).toBe(true) + expect(isValidPath(pathSeven)).toBe(true) + expect(isValidPath(pathEight)).toBe(true) expect(isValidPath(null)).toBe(false) }) })