Skip to content

Commit

Permalink
Merge branch 'main' of github.com:input-output-hk/wsc-poc into amir/d…
Browse files Browse the repository at this point in the history
…eploy-all
  • Loading branch information
amirmrad committed Jan 10, 2025
2 parents 242ce17 + f80df85 commit 12db0da
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 30 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,3 @@ jobs:
cabal update
cabal build -j all --enable-tests
cabal test all
- name: check compiled scripts are consistent
# git diff --quiet implies --exit-code
run: |
cabal run export-smart-tokens
git diff --quiet
30 changes: 30 additions & 0 deletions frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'export',
async headers() {
return [
{
// matching all API routes
source: "/api/v1/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
{ key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" },
]
}
]
},
async rewrites() {
return [
{
source: '/api/v1/:path*', // Match all routes starting with /api/v1/
destination: 'http://localhost:8080/api/v1/:path*', // Proxy to backend server
},
];
},
};

module.exports = nextConfig;

14 changes: 0 additions & 14 deletions frontend/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +0,0 @@
/** @type {import('next').NextConfig} */
const nextConfig =
{ async rewrites() {
return [
{
source: '/api/v1/:path*',
destination: 'http://localhost:8080/:path*' // Proxy to Backend
}
]
},
output: 'export'
};

export default nextConfig;
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev -p 9000",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
Expand Down
7 changes: 3 additions & 4 deletions frontend/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,21 @@ export default function Home() {

const onMint = async () => {
const requestData = {
asset_name: 'WST',
asset_name: Buffer.from('WST', 'utf8').toString('hex'), // Convert "WST" to hex
issuer: mintAccount,
amount: mintTokens,
quantity: mintTokens,
};

try {
const response = await axios.post(
'http://localhost:9000/api/tx/programmable-token/issue',
'/api/v1/tx/programmable-token/issue',
requestData,
{
headers: {
'Content-Type': 'application/json;charset=utf-8',
},
}
);

console.log('Mint response:', response.data);
} catch (error) {
console.error('Minting failed:', error);
Expand Down
12 changes: 6 additions & 6 deletions generated/openapi/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,20 +179,20 @@
},
"UTxODat_ConwayEra_ProgrammableLogicGlobalParams": {
"properties": {
"atum": {
"datum": {
"$ref": "#/components/schemas/ProgrammableLogicGlobalParams"
},
"n": {
"in": {
"$ref": "#/components/schemas/TxIn"
},
"ut": {
"out": {
"$ref": "#/components/schemas/TxOut"
}
},
"required": [
"n",
"ut",
"atum"
"in",
"out",
"datum"
],
"type": "object"
},
Expand Down

0 comments on commit 12db0da

Please sign in to comment.