Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .envrc.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export CIP_143_BLOCKFROST_TOKEN=preprod...
export WST_STATIC_FILES=frontend/out
export WST_DEMO_ENV=preprod-network/preprod-env.json
export WST_POLICY_ISSUER_STORE=preprod-network/policy-issuers.sqlite
4 changes: 2 additions & 2 deletions .github/workflows/ci-compiled-scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
# git diff --quiet implies --exit-code
run: |
cabal run export-smart-tokens ./generated/scripts/unapplied
cabal run export-smart-tokens ./generated/scripts/preview 08a8d0bb8717839931b0a594f7c28b0a3b7c78f6e9172e977e250eab7637d879.0 08a8d0bb8717839931b0a594f7c28b0a3b7c78f6e9172e977e250eab7637d879.0 '"addr_test1qq986m3uel86pl674mkzneqtycyg7csrdgdxj6uf7v7kd857kquweuh5kmrj28zs8czrwkl692jm67vna2rf7xtafhpqk3hecm"'
cabal run export-smart-tokens ./generated/scripts/mainnet b1977c1eb33590ca1311384ab68cd36209832213ad4483feb8a1b7cb64828946.0 b1977c1eb33590ca1311384ab68cd36209832213ad4483feb8a1b7cb64828946.0 '"addr_test1qq986m3uel86pl674mkzneqtycyg7csrdgdxj6uf7v7kd857kquweuh5kmrj28zs8czrwkl692jm67vna2rf7xtafhpqk3hecm"'
cabal run export-smart-tokens ./generated/scripts/preview 08a8d0bb8717839931b0a594f7c28b0a3b7c78f6e9172e977e250eab7637d879#0 08a8d0bb8717839931b0a594f7c28b0a3b7c78f6e9172e977e250eab7637d879#0 addr_test1qq986m3uel86pl674mkzneqtycyg7csrdgdxj6uf7v7kd857kquweuh5kmrj28zs8czrwkl692jm67vna2rf7xtafhpqk3hecm
cabal run export-smart-tokens ./generated/scripts/mainnet b1977c1eb33590ca1311384ab68cd36209832213ad4483feb8a1b7cb64828946#0 b1977c1eb33590ca1311384ab68cd36209832213ad4483feb8a1b7cb64828946#0 addr_test1qq986m3uel86pl674mkzneqtycyg7csrdgdxj6uf7v7kd857kquweuh5kmrj28zs8czrwkl692jm67vna2rf7xtafhpqk3hecm
cabal run write-openapi-schema -- generated/openapi/schema.json
nix develop --accept-flake-config --command bash -c "aiken build src/examples/aiken/aiken --out ./src/examples/aiken/haskell/data/aiken-scripts.json"
git diff --quiet
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ get-protocol-parameters.sh
protocol-parameters-mainnet.json
.pre-commit-config.yaml
tags
/mainnet
/mainnet
operator/*
11 changes: 3 additions & 8 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ index-state:
, hackage.haskell.org 2025-04-15T08:13:08Z
, cardano-haskell-packages 2025-04-11T16:42:25Z


constraints:
plutus-core == 1.40.0.0,
plutus-ledger-api == 1.40.0.0
Expand All @@ -26,11 +27,6 @@ allow-newer:
*:plutus-core,
*:plutus-ledger-api,

allow-older:
-- NOTE: Currently, plutarch depends on plutus-core version 1.40, while the rest of the (cardano) world is at 1.37.
-- TODO: Delete when plutarch is moving to 1.37
plutarch:plutus-core

with-compiler: ghc-9.6.6

packages:
Expand All @@ -43,8 +39,8 @@ packages:
source-repository-package
type: git
location: https://github.com/j-mueller/sc-tools
tag: 100452e6b64200cdffcb2582be07c47e1efebb6b
--sha256: sha256-65swdL2zk1mbqdjten6SIX/2v8tADOX4AhzyE0ocpwY=
tag: dd881e1ab29ba10e3e5b0d163dfde00016c70b8f
--sha256: sha256-/21xOErXZon3rlYUzSkMRRZkFjxi3CrmkeSpJ7MtGSo=
subdir:
src/devnet
src/coin-selection
Expand Down Expand Up @@ -74,4 +70,3 @@ source-repository-package
--sha256: sha256-sdeDXUiL1MbEtJYbN4URwpQ8CbUKjxxGXUxjj1qqi3E=
subdir:
src/plutarch-onchain-lib

7 changes: 7 additions & 0 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ This is a front-end web application for the Cardano Wyoming stable token poc tha

## Getting Started

Make sure to set the environmental variable:
```
export NEXT_PUBLIC_BLOCKFROST_API_KEY=your_blockfrost_key_here
```

Before running `npm run dev`

### Running the Application

To get the application running, follow these steps:
Expand Down
31 changes: 31 additions & 0 deletions frontend/middleware.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { NextRequest, NextResponse } from 'next/server';

const allowedUserRoutes = new Set(['alice', 'bob', 'connected-wallet']);

export function middleware(request: NextRequest) {
const { pathname } = request.nextUrl;

if (
pathname.startsWith('/_next') ||
pathname.startsWith('/api') ||
pathname.startsWith('/assets') ||
pathname === '/favicon.ico'
) {
return NextResponse.next();
}

if (pathname === '/' || pathname === '/mint-authority') {
return NextResponse.redirect(new URL('/connected-wallet', request.url));
}

const segments = pathname.split('/').filter(Boolean);
if (segments.length > 0 && allowedUserRoutes.has(segments[0])) {
return NextResponse.next();
}

return NextResponse.redirect(new URL('/connected-wallet', request.url));
}

export const config = {
matcher: ['/((?!_next/static|_next/image|favicon.ico|api).*)'],
};
20 changes: 10 additions & 10 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ module.exports = (phase, {defaultConfig}) => {
},
];
},
async redirects() {
return [
{
source: '/',
destination: '/mint-authority',
permanent: true, // Use true for a 301 redirect, false for 302
},
];
},
async redirects() {
return [
{
source: '/',
destination: '/connected-wallet',
permanent: true, // Use true for a 301 redirect, false for 302
},
];
},
experimental: {
esmExternals: true, // Ensure modern module support
},
Expand All @@ -87,4 +87,4 @@ module.exports = (phase, {defaultConfig}) => {
"@lucid-evolution/lucid"
]
}
}
}
10 changes: 10 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"react": "^18",
"react-dom": "^18",
"regenerator-runtime": "^0.14.1",
"use-sync-external-store": "^1.6.0",
"zustand": "^5.0.2"
},
"devDependencies": {
Expand All @@ -42,4 +43,4 @@
"tsconfig-paths-webpack-plugin": "^4.2.0",
"typescript": "^5"
}
}
}
Loading
Loading