Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open Nodes #9

Merged
merged 291 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
291 commits
Select commit Hold shift + click to select a range
0ae167e
fix: keep operator tag on expand
Aerilym Jul 1, 2024
7860f4a
fix: add flex wrapping rules for operator indicator
Aerilym Jul 1, 2024
9df6d42
fix: add text size clamp to token staked balance
Aerilym Jul 1, 2024
24ea4bd
fix: change chains test to use item equals and move deps to devdeps
Aerilym Jul 1, 2024
21a4855
feat: add session token icon
Aerilym Jul 1, 2024
ee469fa
feat: create bigint token value formatter
Aerilym Jul 1, 2024
ff3f25c
fix: change wallet drawer to show Session Token balance
Aerilym Jul 1, 2024
9170935
fix: optimise arbitrum icon and add reference network name via the chain
Aerilym Jul 1, 2024
df1fc3b
fix: add padding to heading hamburger menu
Aerilym Jul 1, 2024
19e8e79
fix: use black as the fallback colour for the wallet avatar
Aerilym Jul 1, 2024
bd4c88f
chore: add unit test github action
Aerilym Jul 1, 2024
3b8a006
chore: use pnpm for github action
Aerilym Jul 1, 2024
5f6f03b
chore: add node version to github action
Aerilym Jul 1, 2024
88b629e
chore: add corepack enable to github actions
Aerilym Jul 1, 2024
9c6b788
chore: add corepack to node
Aerilym Jul 1, 2024
903c3bc
chore: add yarn to pnpm
Aerilym Jul 1, 2024
e686812
chore: add abis to repo
Aerilym Jul 1, 2024
f1f4596
chore: merge jobs
Aerilym Jul 1, 2024
9d7f064
feat: add external link out icon
Aerilym Jul 1, 2024
456de0e
fix: add padding to disconnected wallet buttons state
Aerilym Jul 1, 2024
1dcd8b1
chore: update strings
Aerilym Jul 1, 2024
27975d4
feat: add leading and trailing chars to pubkey component
Aerilym Jul 1, 2024
b805b2a
fix: disable balance drawer on mobile
Aerilym Jul 1, 2024
4bbd2ce
fix: increase wallet button drawer translate duration
Aerilym Jul 1, 2024
98fb939
fix: wallet button outline blending issue
Aerilym Jul 2, 2024
4a8659f
fix: mainnet banner
Aerilym Jul 2, 2024
a9bf47e
fix: adjust containers and padding
Aerilym Jul 2, 2024
f339ed6
feat: add node operator to staked node cards
Aerilym Jul 2, 2024
4813dd8
fix: open nodes mobile view
Aerilym Jul 2, 2024
4c9f7c5
feat: add rounded button variants
Aerilym Jul 2, 2024
193bcb6
feat: create variant states for my stakes
Aerilym Jul 2, 2024
19e4bb9
fix: rewrite bigint float localisation function
Aerilym Jul 2, 2024
7a6ba78
chore: add new copy strings
Aerilym Jul 2, 2024
bdb488f
fix: update open node test data generation
Aerilym Jul 3, 2024
9b91736
fix: remove unused fields on staking module
Aerilym Jul 3, 2024
572ae5e
feat: create new landing card for staking page
Aerilym Jul 3, 2024
92d1b4d
feat: create feature flag library and dev sheet
Aerilym Jul 3, 2024
1e8e991
fix: disable mvp faucet
Aerilym Jul 3, 2024
3a49222
fix: add feature flag mock data test to open node view
Aerilym Jul 4, 2024
7ec8fee
fix: import feature flag library to mock data open node
Aerilym Jul 4, 2024
eeeaa8e
fix: add open node test data generation function to mock open node vi…
Aerilym Jul 4, 2024
6673b17
fix: add wallet address to mock node
Aerilym Jul 4, 2024
2e8918e
fix: add wallet import
Aerilym Jul 4, 2024
7ec1d69
feat: create @session/auth package
Aerilym Jul 4, 2024
cfa8d9d
feat: add telegram and discord connect buttons to faucet
Aerilym Jul 4, 2024
38137ef
fix: add callback to auth
Aerilym Jul 4, 2024
a7a0ab8
fix: add callback url
Aerilym Jul 4, 2024
702e33b
fix: add hidden button click
Aerilym Jul 4, 2024
a664418
fix: test real button
Aerilym Jul 4, 2024
a4a774a
fix: parse json from telegram
Aerilym Jul 4, 2024
d59c7af
chore: log
Aerilym Jul 4, 2024
8b00a97
chore: properly type telegram object
Aerilym Jul 4, 2024
a2eedd6
chore: test log
Aerilym Jul 4, 2024
7f6b1ff
fix: add telegram session passer
Aerilym Jul 4, 2024
85baeb9
chore: session checks
Aerilym Jul 4, 2024
c1809fe
chore: add telegram session handler
Aerilym Jul 4, 2024
616d5f9
fix: add workaround for telegram id
Aerilym Jul 4, 2024
d41b166
fix: use styled button for telegram auth
Aerilym Jul 4, 2024
96f9642
chore: resolve auth imports
Aerilym Jul 4, 2024
c68e8b9
fix: add layered button
Aerilym Jul 4, 2024
89a33c9
chore: remove unused csrf
Aerilym Jul 4, 2024
5a1990b
fix: copy to clipboard can now force collapse
yougotwill Jul 8, 2024
17d5238
feat: styled toast component
yougotwill Jul 8, 2024
9ead398
feat: add database logic to faucet
Aerilym Jul 8, 2024
0dc7afc
feat: create new auth module for the faucet
Aerilym Jul 8, 2024
a69ad50
fix: add correct telegram id logic to auth library
Aerilym Jul 8, 2024
6f8fa62
fix: update faucet constants and strings
Aerilym Jul 8, 2024
26ca5b0
chore: add eth decimals to wallet lib
Aerilym Jul 8, 2024
7e1559c
feat: add hide balance option to wallet button
Aerilym Jul 8, 2024
4404f7c
feat: add better-sqlite3-multiple-ciphers
Aerilym Jul 8, 2024
e530e76
fix: move wagmi wallet functions into useWallet hook
Aerilym Jul 8, 2024
b70cc5f
fix: render form error message in the faucet landing page if the subm…
Aerilym Jul 8, 2024
cd448e4
chore: comment spelling
Aerilym Jul 8, 2024
8b6a8ca
fix: add padding in mobile and add discord and telegram to faucet bac…
Aerilym Jul 8, 2024
5ad1a27
chore: capitalise back button on faucet
Aerilym Jul 9, 2024
0703003
fix: and earn rewards -> and earn rewards for securing the network
yougotwill Jul 9, 2024
8603a6a
fix: apply review changes
Aerilym Jul 9, 2024
3c759bb
fix: stake earn rewards -> stake secure the network
yougotwill Jul 9, 2024
8d3fdf6
fix: run tailwind with config file as root
yougotwill Jul 9, 2024
8ee0b01
fix: use jsx comment
yougotwill Jul 9, 2024
4073490
fix: render unsupport chain locale string
yougotwill Jul 9, 2024
8a710bb
chore: retype telegram auth callback
Aerilym Jul 9, 2024
28eeb71
fix: apply database fixes
Aerilym Jul 9, 2024
29f7050
chore: update faucet warning text
Aerilym Jul 9, 2024
4fac609
fix: remove lint ignoring from next config
Aerilym Jul 9, 2024
eefcf21
Merge pull request #12 from oxen-io/improved_faucet
Aerilym Jul 9, 2024
a370542
Merge pull request #11 from oxen-io/fix/web-192/copy_clipboard_button
Aerilym Jul 9, 2024
3010627
fix: mobile faucet scaling
Aerilym Jul 9, 2024
4f5bc6c
fix: telegram button click
Aerilym Jul 9, 2024
3cbb703
fix: reverse faucet direction on mobile
Aerilym Jul 9, 2024
9b6e690
fix: improved landinge page hero and header responsiveness
yougotwill Jul 5, 2024
31c2e9b
feat: added sharp package
yougotwill Jul 5, 2024
e0e80a6
chore: added vscode snippets for defining react classes
yougotwill Jul 5, 2024
f458b36
feat: added footer and social list components to ui package
yougotwill Jul 5, 2024
82113e5
fix: faucet action linting errors
Aerilym Jul 9, 2024
20e8447
feat: added footer to landing page
yougotwill Jul 5, 2024
4d5d8f3
feat: updated footer links
yougotwill Jul 8, 2024
768477f
fix: revert header button style override
yougotwill Jul 9, 2024
00ef76d
fix: build errors
yougotwill Jul 9, 2024
4bcf51b
fix: add revalidate on change to faucet form
Aerilym Jul 9, 2024
a635d3c
fix: disable localization
Aerilym Jul 9, 2024
a27d082
fix: disable staking
Aerilym Jul 9, 2024
99051cf
fix: add explorer to redirects
Aerilym Jul 9, 2024
07099df
fix: add z index to telegram iframe
Aerilym Jul 9, 2024
56f6558
fix: change opacity of test button
Aerilym Jul 9, 2024
9ec80ad
chore: add comment to transaparent button
Aerilym Jul 9, 2024
586d413
fix: can now click on all nav links
yougotwill Jul 9, 2024
d375b07
fix: hamburger circle
yougotwill Jul 9, 2024
8998740
Merge branch 'open_nodes' into fix/web-191/hero_header_layout
yougotwill Jul 9, 2024
57fa8c6
fix: find out how is no longer a link
yougotwill Jul 9, 2024
cc26de7
Merge branch 'open_nodes' into fix/web-193/copy_updates
yougotwill Jul 9, 2024
c9ee95a
fix: open nodes list renders real nodes
Aerilym Jul 9, 2024
97b55f6
fix: add comments and catch
Aerilym Jul 9, 2024
ca565d9
fix: update contract addresses
Aerilym Jul 9, 2024
2ff242a
Merge pull request #14 from oxen-io/fix/web-191/hero_header_layout
Aerilym Jul 9, 2024
86c5163
Merge pull request #13 from oxen-io/faucet_telegram_fixes
Aerilym Jul 9, 2024
af8ae1c
Merge pull request #15 from oxen-io/fix_open_node_list
Aerilym Jul 9, 2024
1143284
fix: faucet copy
yougotwill Jul 9, 2024
b9a5009
fix: add watch token to faucet on success
Aerilym Jul 9, 2024
50d8604
chore: remove lint-staged as it needs fixing
yougotwill Jul 9, 2024
69e8bd0
Merge branch 'open_nodes' into fix/web-193/copy_updates
yougotwill Jul 9, 2024
71dc68b
fix: update rewards links
yougotwill Jul 9, 2024
0882eb7
Merge pull request #16 from oxen-io/fix/web-193/copy_updates
Aerilym Jul 9, 2024
0cf0562
fix: new images for action modal
Aerilym Jul 9, 2024
2577723
feat: add block explorer link
Aerilym Jul 9, 2024
8273b30
fix: open block explorer in new link
Aerilym Jul 9, 2024
3c96a8e
fix: add success state to faucet form
Aerilym Jul 9, 2024
6d0aa42
fix: adjust success state check
Aerilym Jul 9, 2024
57ff1dc
feat: added site metadata and link preview
yougotwill Jul 9, 2024
8211ff6
Merge branch 'open_nodes' into feat/no-ref/metadata
yougotwill Jul 9, 2024
f520525
fix: update snapshot dates
Aerilym Jul 9, 2024
577c14d
fix: optimised images
yougotwill Jul 9, 2024
39f0f61
Merge branch 'open_nodes' into feat/no-ref/metadata
yougotwill Jul 9, 2024
4c9a8f4
fix: add 404 page
yougotwill Jul 9, 2024
d205024
fix: path for image link preview resolves for env
yougotwill Jul 9, 2024
8afa95d
Merge pull request #17 from oxen-io/feat/no-ref/metadata
Aerilym Jul 9, 2024
e826194
chore: fix landing copy
Aerilym Jul 9, 2024
ea132ec
Merge branch 'open_nodes' of github.com:oxen-io/websites into open_nodes
Aerilym Jul 9, 2024
97eef76
fix: merge regression on redirects
yougotwill Jul 9, 2024
007f7bc
fix: disable claim button
Aerilym Jul 9, 2024
171e181
fix: use 0 eth instead of null eth
Aerilym Jul 9, 2024
53002df
fix: only allow bigint eth balance as a valid balance
Aerilym Jul 9, 2024
d0de3c9
fix: use 0 gas amount as default for faucet error
Aerilym Jul 10, 2024
3c5e7b8
feat: add table shadcn component
Aerilym Jul 10, 2024
15d1d56
fix: add nonce manager to server wallet
Aerilym Jul 10, 2024
0ed15da
feat: add destructive outline variant to button component
Aerilym Jul 10, 2024
8c29b02
feat: create faucet transactions component
Aerilym Jul 10, 2024
5874366
feat: add eth to faucet
Aerilym Jul 10, 2024
ca3f708
fix: faucet table styles
Aerilym Jul 10, 2024
7e814a2
feat: change min faucet eth to 0.001
Aerilym Jul 10, 2024
b47e3b4
feat: add transaction history to requests
Aerilym Jul 10, 2024
8d58bd7
feat: add token icon to add token button
Aerilym Jul 11, 2024
d1e3d43
fix: use arr.length for conditionally rendering a map
Aerilym Jul 11, 2024
a2c20a8
fix: localize the transaction table
Aerilym Jul 11, 2024
67dca72
fix: token watch strings
Aerilym Jul 11, 2024
d0b2e2c
Merge pull request #18 from oxen-io/add_eth_to_faucet
Aerilym Jul 11, 2024
79860c6
feat: create new query client
Aerilym Jul 14, 2024
df08f26
fix: move providers into GlobalProvider
Aerilym Jul 14, 2024
56c3762
feat: create SSR header
Aerilym Jul 14, 2024
19fccd2
feat: add skeleton shadcn component
Aerilym Jul 14, 2024
4a6c3e8
feat: separate navlink component
Aerilym Jul 14, 2024
805f907
fix: update type imports and add button skeleton
Aerilym Jul 14, 2024
b2d1479
feat: add keepDesktopHeaderOnMobile option to ModuleGridHeader component
Aerilym Jul 14, 2024
5d42f18
feat: create getDateFromUnixTimestampSeconds function
Aerilym Jul 14, 2024
b7739b1
fix: properly type Web3ModalProvider
Aerilym Jul 14, 2024
f7da1f0
chore: style fixes
Aerilym Jul 14, 2024
13770a4
feat: create session staking backend query handlers
Aerilym Jul 14, 2024
cbc53eb
feat: create pending node components
Aerilym Jul 14, 2024
80f3f85
fix: open nodes use the query library
Aerilym Jul 14, 2024
bc4a4ab
fix: update staking form use the query library
Aerilym Jul 14, 2024
1ae576e
feat: add node registration components
Aerilym Jul 14, 2024
93ed467
fix: move modules to use query library
Aerilym Jul 14, 2024
8fa77fa
feat: update dev sheet to use any path name match
Aerilym Jul 14, 2024
9ba0f41
chore: fix providers
Aerilym Jul 14, 2024
7652207
chore: add new data test ids
Aerilym Jul 14, 2024
f52f847
feat: migrate open node logic to info node card
Aerilym Jul 14, 2024
fd59e18
fix: determine env on start
Aerilym Jul 14, 2024
e430522
fix: add missing constants and open node query
Aerilym Jul 14, 2024
482e6cc
chore: update strings
Aerilym Jul 14, 2024
501b399
fix: move tailwind keyframe and animation to extend
Aerilym Jul 14, 2024
165f06a
feat: create pending node generator
Aerilym Jul 14, 2024
1057793
feat: add tanstack react query
Aerilym Jul 14, 2024
dc4ef74
fix: staking api url resolution
Aerilym Jul 14, 2024
9ec38f2
chore: add TODO for any types
Aerilym Jul 14, 2024
9496515
fix: package.json error
Aerilym Jul 14, 2024
d046116
fix: remove logger package from util
Aerilym Jul 15, 2024
f72a336
fix: remove unused pathname prop
Aerilym Jul 15, 2024
d627269
fix: remove pathname
Aerilym Jul 15, 2024
3f886df
fix: remove logger from staking backend
Aerilym Jul 15, 2024
4e8088e
chore: fix css indenting
Aerilym Jul 15, 2024
6c64fd3
fix: block explorer link text
Aerilym Jul 15, 2024
7cfba5f
feat: add error toasts to chain swapping
Aerilym Jul 15, 2024
0c3303e
fix: add external link checking to nav link and fix style issues
Aerilym Jul 15, 2024
9d39474
chore: add comments
Aerilym Jul 15, 2024
7560756
fix: backend api route path
Aerilym Jul 15, 2024
cec663e
feat: add mock data options to stake and register forms
Aerilym Jul 15, 2024
8bbc9e0
fix: arbitrum block explorer url
Aerilym Jul 15, 2024
f83fe10
chore: made registration mock data generator use realistic dates
Aerilym Jul 15, 2024
d5867ee
chore: fix missing dep array
Aerilym Jul 15, 2024
8e82dbb
feat: add hideCloseButton prop to dialog
Aerilym Jul 16, 2024
811cf68
feat: add checkbox shadcn component
Aerilym Jul 16, 2024
641f57b
feat: create session node registration contract hooks for approval an…
Aerilym Jul 16, 2024
c62164a
fix: eslint file path error in tests
Aerilym Jul 16, 2024
82c3262
feat: add radix checkbox package
Aerilym Jul 16, 2024
cf859dc
fix: add fee and amount types to sent backend js library
Aerilym Jul 16, 2024
f6895b5
fix: nextauth types
Aerilym Jul 16, 2024
27e86e8
feat: add modular primary and secondary buttons to the landing page
Aerilym Jul 16, 2024
b03d82b
feat: add terms and conditions logic for testnet involvement
Aerilym Jul 16, 2024
77f8877
feat: add TOS provider and handler
Aerilym Jul 16, 2024
caa8abb
feat: add node registration hooks and logic to form
Aerilym Jul 16, 2024
b333bd4
fix: update node staking logic
Aerilym Jul 16, 2024
ef5207d
fix: staked amount calculation on node cards
Aerilym Jul 16, 2024
7f8c20f
fix: styles and linting
Aerilym Jul 16, 2024
451c1a5
fix: pnpm lock refresh
Aerilym Jul 16, 2024
7793955
Merge pull request #20 from oxen-io/query_provider
Aerilym Jul 16, 2024
c523269
fix: add already registered state and filter out registered nodes
Aerilym Jul 17, 2024
8a56aa8
fix: balance module enable issue
Aerilym Jul 17, 2024
ecfe94e
fix: registration not found page
Aerilym Jul 17, 2024
b6ea262
fix: getPendingNodes now filters out already registered nodes
Aerilym Jul 17, 2024
4dc5901
fix: getPendingNodes now filters out already registered nodes
Aerilym Jul 17, 2024
4e620f8
fix: remove handeError from network dropdown child element
Aerilym Jul 17, 2024
6bb0df5
fix: add running node check to new node registration forms
Aerilym Jul 17, 2024
6394204
feat: add error reporting toasts to registration steps
Aerilym Jul 17, 2024
1f0a165
fix: remove staged linting
Aerilym Jul 17, 2024
5421c83
feat: add hover handling to tooltips
Aerilym Jul 17, 2024
320db93
feat: create pending status indicator
Aerilym Jul 17, 2024
30935a8
feat: add joining network logic to registration steps
Aerilym Jul 17, 2024
f825629
fix: add suffix to staked node uptime
Aerilym Jul 17, 2024
4277766
tests: add missing unit tests to date utils
Aerilym Jul 17, 2024
8c02a5e
feat: create areHexesEqual util function for determining equality of …
Aerilym Jul 17, 2024
8c81bfe
fix: use areHexesEqual util function for all address and pubkey equal…
Aerilym Jul 17, 2024
e85692f
fix: remove unused dropdown shadow
Aerilym Jul 17, 2024
c67f0f5
chore: simplify XIcon export
Aerilym Jul 18, 2024
ce8da2c
feat: hide operator fee for solo nodes
Aerilym Jul 18, 2024
c2c5d51
feat: create timeBetweenEvents function to handle blockchain block ti…
Aerilym Jul 18, 2024
44d8174
chore: add end region comment tags for all regions
Aerilym Jul 18, 2024
a5b0ab6
feat: add block height calculation to node logic
Aerilym Jul 18, 2024
385d645
fix: strings hex equals logic works for different hex initial lengths
Aerilym Jul 18, 2024
97f0e68
chore: fixed comments
Aerilym Jul 18, 2024
62240a3
chore: minor style fixes
Aerilym Jul 18, 2024
531665b
chore: add to dep array
Aerilym Jul 19, 2024
73d9f37
chore: fix missing deps array items
Aerilym Jul 19, 2024
da4cd4a
chore: add nodeId to deps array
Aerilym Jul 19, 2024
43286c6
Merge pull request #21 from oxen-io/node_registration
Aerilym Jul 19, 2024
cad1f59
Merge pull request #23 from oxen-io/staked_node_card_value_changes
Aerilym Jul 19, 2024
31dbb4e
feat: add registration polling
Aerilym Jul 19, 2024
164e89a
chore: rename query key in registration check query
Aerilym Jul 19, 2024
ddfedfe
Merge pull request #24 from oxen-io/registration-polling
Aerilym Jul 19, 2024
fc3c39c
fix: add new network time calcs
Aerilym Jul 19, 2024
561650c
fix: rpc check node key passing
Aerilym Jul 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Unit Tests
on:
- push
- pull_request

jobs:
unit-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm
with:
run_install: false

- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'
node-version-file: '.tool-versions'

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Run unit tests
run: pnpm test
yougotwill marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,9 @@ yarn-error.log*
# Misc
.DS_Store
*.pem
.cache
.cache

# Databases
*.sqlite
*.sqlite3
*.db
1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

1 change: 0 additions & 1 deletion .lintstagedrc.json

This file was deleted.

13 changes: 13 additions & 0 deletions apps/staking/.env.local.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=
NEXT_PUBLIC_SENT_STAKING_API_URL=
NEXT_PUBLIC_SENT_EXPLORER_API_URL=
FAUCET_WALLET_PRIVATE_KEY=
FAUCET_DB_SECRET_KEY=
FAUCET_HOURS_BETWEEN_USES=
FAUCET_CHAIN=testnet
NEXT_PUBLIC_ENV_FLAG= pick from dev, qa, stg, prd
DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET=
TELEGRAM_BOT_TOKEN=
NEXTAUTH_SECRET=
NEXTAUTH_URL=
1 change: 0 additions & 1 deletion apps/staking/.lintstagedrc.json

This file was deleted.

20 changes: 20 additions & 0 deletions apps/staking/.vscode/snippets.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Place your session-website workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
"cn Class Definition": {
"scope": "typescriptreact",
"prefix": ["cl", "class"],
"body": ["className={cn('$0')}"],
"description": "Define classes using cn package",
},
"cn to existing Class Definition": {
"scope": "typescriptreact",
"prefix": ["cn"],
"body": ["cn($0'')"],
"description": "Define classes using cn package when className is already defined",
},
}
33 changes: 33 additions & 0 deletions apps/staking/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { createAuthHandler } from '@session/auth/api';
import { DiscordProvider, handleDiscordSession } from '@session/auth/providers/discord';
import { handleTelegramSession, TelegramProvider } from '@session/auth/providers/telegram';
import { NextAuthJWT, NextAuthSession } from '@session/auth/types';

const discordClientId = process.env.DISCORD_CLIENT_ID;
const discordClientSecret = process.env.DISCORD_CLIENT_SECRET;
const telegramBotToken = process.env.TELEGRAM_BOT_TOKEN;

if (!discordClientId || !discordClientSecret) {
throw new Error('Discord client ID and client secret must be provided');
}

if (!telegramBotToken) {
throw new Error('Telegram bot token must be provided');
}

export const { GET, POST } = createAuthHandler({
providers: [
DiscordProvider({
clientId: discordClientId,
clientSecret: discordClientSecret,
}),
TelegramProvider({ botToken: telegramBotToken }),
],
callbacks: {
async session({ session, token }: { session: NextAuthSession; token: NextAuthJWT }) {
handleDiscordSession({ session, token });
handleTelegramSession({ session, token });
return session;
},
},
});
Loading