diff --git a/extras/demo-anypay/.env.sample b/extras/demo-anypay/.env.sample new file mode 100644 index 000000000..9d127567d --- /dev/null +++ b/extras/demo-anypay/.env.sample @@ -0,0 +1,7 @@ +# Sequence Project Access Key (Required) +VITE_ENV= +VITE_USE_V3_API=true +VITE_USE_V3_RELAYERS=true +VITE_PROJECT_ACCESS_KEY= +VITE_API_URL=https://api.sequence.app +VITE_INDEXER_URL=https://indexer.sequence.app \ No newline at end of file diff --git a/extras/demo-anypay/.gitignore b/extras/demo-anypay/.gitignore new file mode 100644 index 000000000..39946e7b0 --- /dev/null +++ b/extras/demo-anypay/.gitignore @@ -0,0 +1,44 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# env files (can opt-in for commiting if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts + +# env files +.env +.env.local +.env.development +.env.production +.env.test +!.env.sample diff --git a/extras/demo-anypay/Makefile b/extras/demo-anypay/Makefile new file mode 100644 index 000000000..6f64bda45 --- /dev/null +++ b/extras/demo-anypay/Makefile @@ -0,0 +1,8 @@ +cors-anywhere: + docker run -d -p 8080:8080 --dns 8.8.4.4 --name cors-anywhere testcab/cors-anywhere + +cors-anywhere-stop: + docker stop cors-anywhere + +cors-anywhere-start: + docker start cors-anywhere diff --git a/extras/demo-anypay/README.md b/extras/demo-anypay/README.md new file mode 100644 index 000000000..5d67a2069 --- /dev/null +++ b/extras/demo-anypay/README.md @@ -0,0 +1,28 @@ +# Anypay Demo App + +A simple application demonstrating Sequence Anypay intent configuration. + +## Setup + +1. Clone the `sequence-core` repo if you haven't already. +2. Install dependencies and build the core packages: + ```bash + pnpm install + pnpm build + ``` +3. Copy `.env.sample` to `.env` and add your Sequence Project Access Key: + ```bash + cp apps/demo-anypay/.env.sample apps/demo-anypay/.env + ``` +4. Run the development server: + ```bash + pnpm --filter demo-anypay dev + ``` + +## Usage + +1. Open the app in your browser. +2. Connect your wallet (e.g., Metamask). +3. Select a token from your balance list. +4. Click "Pay" or "Mock Contract Interaction". +5. Observe the generated intent configuration details. diff --git a/extras/demo-anypay/eslint.config.js b/extras/demo-anypay/eslint.config.js new file mode 100644 index 000000000..3d2c2e9d4 --- /dev/null +++ b/extras/demo-anypay/eslint.config.js @@ -0,0 +1,4 @@ +import { nextJsConfig } from '@repo/eslint-config/next-js' + +/** @type {import("eslint").Linter.Config} */ +export default nextJsConfig diff --git a/extras/demo-anypay/index.html b/extras/demo-anypay/index.html new file mode 100644 index 000000000..c5c8cabed --- /dev/null +++ b/extras/demo-anypay/index.html @@ -0,0 +1,31 @@ + + +
+ + +
+ {JSON.stringify(committedIntentConfigData, (_, v) => (typeof v === 'bigint' ? v.toString() : v), 2)}
+
+ )}
+
+ {JSON.stringify(intentCallsPayloads, null, 2)}
+
+
+ {JSON.stringify(metaTxns, null, 2)}
+
+
+ {JSON.stringify(lifiInfos, null, 2)}
+
+
+ {JSON.stringify(cond, (_, value) => (typeof value === 'bigint' ? value.toString() : value), 2)}
+
+
+ {JSON.stringify(
+ monitorStatus,
+ (_, value) => (typeof value === 'bigint' ? value.toString() : value),
+ 2,
+ )}
+
+ Connect your wallet and explore cross-chain intents
++ This demo showcases a multi-step transfer flow using the Anypay SDK. Connect your wallet, select a token, + specify the amount and recipient, and see the transaction confirmation process in action. +
+