-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/JustaName-id/JustaName-sdk…
… into anthony/poap-plugin
- Loading branch information
Showing
76 changed files
with
1,630 additions
and
362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
import { JustaName } from '@justaname.id/sdk'; | ||
|
||
export const justaname = JustaName.init({ | ||
dev: process.env.DEV === 'true', | ||
networks: [ | ||
{ | ||
chainId: 1, | ||
providerUrl: process.env.MAINNET_PROVIDER_URL as string, | ||
}, | ||
{ | ||
chainId: 11155111, | ||
providerUrl: process.env.SEPOLIA_PROVIDER_URL as string, | ||
}, | ||
], | ||
}); | ||
let justaname: JustaName | undefined; | ||
|
||
export const getJustaname = () => { | ||
if (!justaname) { | ||
justaname = JustaName.init({ | ||
dev: process.env.DEV === 'true', | ||
networks: [ | ||
{ | ||
chainId: 1, | ||
providerUrl: process.env.MAINNET_PROVIDER_URL as string, | ||
}, | ||
{ | ||
chainId: 11155111, | ||
providerUrl: process.env.SEPOLIA_PROVIDER_URL as string, | ||
}, | ||
], | ||
}); | ||
} | ||
|
||
return justaname; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import { NextRequest, NextResponse } from 'next/server'; | ||
import { justaname, Session, tap } from '../../../../../lib'; | ||
import { getJustaname, Session, tap } from '../../../../../lib'; | ||
|
||
export const GET = async (req: NextRequest): Promise<NextResponse> => { | ||
const session = await Session.fromRequest(req) | ||
if (!session?.nonce) session.nonce = justaname.signIn.generateNonce() | ||
const session = await Session.fromRequest(req); | ||
if (!session?.nonce) session.nonce = getJustaname().signIn.generateNonce(); | ||
|
||
return tap(new NextResponse(session.nonce), res => session.persist(res)) | ||
} | ||
return tap(new NextResponse(session.nonce), (res) => session.persist(res)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
VITE_APP_BACKEND_URL=http://localhost:3333 | ||
VITE_APP_ENS_DOMAIN=your_ens_domain | ||
VITE_APP_CHAIN_ID=your_chain_id | ||
VITE_APP_ORIGIN=yourwebsite.com | ||
VITE_APP_DOMAIN=yourwebsite | ||
VITE_APP_PROVIDER_URL=https://rpc.yourprovider.com | ||
VITE_CAPSULE_API_KEY=<your_capsule_api_key> | ||
VITE_JUSTANAME_API_KEY=<your_justaname_api_key> | ||
VITE_JUSTANAME_ENS_DOMAIN=<your_justaname_ens_domain> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": ["plugin:@nx/react", "../../.eslintrc.base.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="utf-8" /> | ||
<title>WithUseCapsule</title> | ||
<base href="/" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" type="image/x-icon" href="/favicon.ico" /> | ||
<link rel="stylesheet" href="/src/styles.css" /> | ||
</head> | ||
|
||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "with-usecapsule", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "apps/with-usecapsule/src", | ||
"projectType": "application", | ||
"targets": { | ||
"serve": { | ||
"executor": "@nx/vite:dev-server", | ||
"defaultConfiguration": "development", | ||
"options": { | ||
"buildTarget": "with-usecapsule:build" | ||
}, | ||
"configurations": { | ||
"production": { | ||
"buildTarget": "with-usecapsule:build:production" | ||
} | ||
}, | ||
"dependsOn": [ | ||
{ | ||
"projects": [ | ||
"@justweb3/widget", | ||
"@justweb3/ui", | ||
"@justaname.id/react", | ||
"@justaname.id/sdk" | ||
], | ||
"target": "build" | ||
} | ||
] | ||
}, | ||
"typecheck": { | ||
"executor": "nx:run-commands", | ||
"options": { | ||
"command": "yarn tsc --noEmit", | ||
"cwd": "apps/with-usecapsule" | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* Your styles goes here. */ |
Oops, something went wrong.