Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
27ebf04
Before running with prettier
CoveMB Feb 21, 2025
7c7828e
After running with prettier
CoveMB Feb 21, 2025
ce5fcd3
Add consistent-type-imports rule
CoveMB Feb 21, 2025
3cd0b59
Add lint step in ci action
CoveMB Feb 21, 2025
31f0c78
resolve prettier conflict
CoveMB Feb 21, 2025
365421b
After running with prettier
CoveMB Feb 21, 2025
cedaeaa
resolve prettier conflict
CoveMB Feb 21, 2025
98bd8af
Add lint step in ci action
CoveMB Feb 21, 2025
a9098d0
resolve prettier conflict
CoveMB Feb 21, 2025
6e9df26
resolve prettier conflict
CoveMB Feb 21, 2025
574a739
Remove .vscode directory from Git tracking
CoveMB Feb 21, 2025
c0e9002
move linter action in it's own job
CoveMB Feb 21, 2025
86c65dc
add lint note in readme
CoveMB Feb 21, 2025
a1111d3
Update .github/workflows/test.yml
CoveMB Feb 21, 2025
abbd5a4
Merge remote-tracking branch 'upstream/master'
CoveMB Feb 21, 2025
beffa34
Merge branch 'master' into master
ericglau Feb 21, 2025
d6bec2a
lint script files
CoveMB Feb 21, 2025
315b775
Merge branch 'master' of github.com:CoveMB/contracts-wizard
CoveMB Feb 21, 2025
6ed6e4f
Merge remote-tracking branch 'upstream/master'
CoveMB Feb 24, 2025
ea90cd1
Merge remote-tracking branch 'upstream/master'
CoveMB Feb 28, 2025
abf687a
Merge remote-tracking branch 'upstream/master'
CoveMB Mar 4, 2025
426b62d
Merge remote-tracking branch 'upstream/master'
CoveMB Mar 20, 2025
ea25cc1
Merge remote-tracking branch 'upstream/master'
CoveMB Mar 20, 2025
0911f87
Merge remote-tracking branch 'upstream/master'
CoveMB Mar 25, 2025
4914083
Merge remote-tracking branch 'upstream/master'
CoveMB Mar 27, 2025
5ce527f
Merge remote-tracking branch 'upstream/master'
CoveMB Apr 4, 2025
03a32fc
Merge remote-tracking branch 'upstream/master'
CoveMB Apr 7, 2025
b3c0347
Merge remote-tracking branch 'upstream/master'
CoveMB Apr 12, 2025
0a52a65
Merge remote-tracking branch 'upstream/master'
CoveMB May 13, 2025
9e74342
Merge remote-tracking branch 'upstream/master'
CoveMB May 19, 2025
d727f51
Merge remote-tracking branch 'upstream/master'
CoveMB May 21, 2025
60fb18f
Merge remote-tracking branch 'upstream/master'
CoveMB May 26, 2025
cbb7631
Merge remote-tracking branch 'upstream/master'
CoveMB May 27, 2025
0f1267f
Merge remote-tracking branch 'upstream/master'
CoveMB Jun 5, 2025
acc5e6e
Merge remote-tracking branch 'upstream/master'
CoveMB Jun 16, 2025
e3b74c8
Merge remote-tracking branch 'upstream/master'
CoveMB Jun 17, 2025
16ba867
Merge remote-tracking branch 'upstream/master'
CoveMB Jun 26, 2025
10442ac
Merge remote-tracking branch 'upstream/master'
CoveMB Jun 27, 2025
f3d5bea
Merge remote-tracking branch 'upstream/master'
CoveMB Jul 7, 2025
4427128
Merge remote-tracking branch 'upstream/master'
CoveMB Jul 10, 2025
e4734df
Merge remote-tracking branch 'upstream/master'
CoveMB Jul 24, 2025
52bd1e0
Merge remote-tracking branch 'upstream/master'
CoveMB Jul 28, 2025
0de594f
Merge branch 'master' of github.com:CoveMB/contracts-wizard
CoveMB Jul 28, 2025
66695d7
add Dokerfile
CoveMB Jul 30, 2025
d78e5f0
Merge remote-tracking branch 'upstream/master' into stellar-scafold-f…
CoveMB Jul 30, 2025
0376b76
initial api
CoveMB Jul 31, 2025
8509514
cargo build
CoveMB Jul 31, 2025
091a69b
Add middlewares
CoveMB Aug 4, 2025
becb85e
remove target
CoveMB Aug 4, 2025
dc007ae
Add dev dokerfile
CoveMB Aug 5, 2025
8b63041
move stellaer api
CoveMB Aug 11, 2025
9538a3d
Add Deno container
CoveMB Aug 11, 2025
bf0b818
Update deserialization
CoveMB Aug 11, 2025
8519b30
Add zip utilities
CoveMB Aug 12, 2025
84ba5f9
Update Dokerfile, more secure unzip
CoveMB Aug 13, 2025
c288120
update unzip
CoveMB Aug 20, 2025
f3c0312
Merge remote-tracking branch 'upstream/master' into stellar-scafold-f…
CoveMB Aug 21, 2025
61ffb5f
file by file unzip
CoveMB Aug 25, 2025
8dfee0c
Download from UI
CoveMB Aug 25, 2025
b9462b4
Add github actions
CoveMB Aug 26, 2025
2fa7d31
Update Dokerfile.prod
CoveMB Aug 26, 2025
9468e21
Address comments
CoveMB Sep 8, 2025
9cfd00c
Merge remote-tracking branch 'upstream/master' into stellar-scafold-f…
CoveMB Sep 8, 2025
b2b01cc
Adjust docker context in ci
CoveMB Sep 12, 2025
448cdef
use setup instead of prepare
CoveMB Sep 12, 2025
a017ba9
Merge remote-tracking branch 'upstream/master' into stellar-scafold-f…
CoveMB Sep 12, 2025
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
45 changes: 45 additions & 0 deletions .github/actions/oidc/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
name: AWS OIDC Credentials via Role Assume Chaining
description: Retrieve AWS credentials by chaining role assumes
inputs:
role-for-oidc:
description: The role that should be used for GitHub OIDC authentication
required: true
role-to-assume:
description: The role that should be finally assumed
required: true
role-session-name:
description: The session name that should be used when assuming roles
required: true
default: github-actions
role-duration-seconds:
description: duration of the credentials validity
required: true
default: "3600"
aws-region:
description: The AWS region
required: false
default: us-east-1

runs:
using: composite
steps:
- name: assume oidc role
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
aws-region: us-east-1
role-to-assume: ${{ inputs.role-for-oidc }}
role-session-name: ${{ inputs.role-session-name }}
role-duration-seconds: 900
- name: assume target role
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
id: assume-target-role
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ env.AWS_SESSION_TOKEN }}
aws-region: ${{ inputs.aws-region }}
role-chaining: true
role-to-assume: ${{ inputs.role-to-assume }}
role-session-name: ${{ inputs.role-session-name }}
role-duration-seconds: ${{ inputs.role-duration-seconds }}
133 changes: 133 additions & 0 deletions .github/workflows/docker-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# This workflow runs whenever a release is created.
# The image is tagged with latest and the release version.
name: (Production) Build and Push Docker Images

on:
release:
types: [published]

permissions:
contents: read

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: write
attestations: write
security-events: write
env:
REGISTRY: ${{ secrets.RESEARCH_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com
ROLE_FOR_OIDC: 'arn:aws:iam::${{ secrets.ROOT_ACCOUNT_ID }}:role/github-actions-research-account-oidc-role'
ROLE_TO_ASSUME: 'arn:aws:iam::${{ secrets.RESEARCH_ACCOUNT_ID }}:role/GithubOIDCResearchAccountRole'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit

- uses: actions/create-github-app-token@af35edadc00be37caa72ed9f3e6d5f7801bfdf09 # v1.11.7
id: gh-app-token
with:
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}

- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ steps.gh-app-token.outputs.token }}
fetch-depth: 0

- name: Setup pre-requisites
uses: ./.github/actions/setup
with:
token: ${{ steps.gh-app-token.outputs.token }}

- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: 'arm64'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2

- name: Set up AWS credentials via OIDC and role chaining
uses: ./.github/actions/oidc
with:
role-for-oidc: ${{ env.ROLE_FOR_OIDC }}
role-to-assume: ${{ env.ROLE_TO_ASSUME }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1

- name: Build Stellar API Docker image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
id: build
with:
context: .
platforms: linux/amd64 # linux/arm64 causes anchore/scan-action to fail
tags: |
${{ env.REGISTRY }}/wizard-stellar-api-prod:latest
${{ env.REGISTRY }}/wizard-stellar-api-prod:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true

- name: Scan Stellar API Docker image
uses: anchore/scan-action@df395807f4554463d4455b8047cf58e37b6acaae # v6.5.0
id: scan
with:
image: ${{ env.REGISTRY }}/wizard-stellar-api-prod:${{ github.sha }}
fail-build: false

- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
with:
sarif_file: ${{ steps.scan.outputs.sarif }}

- name: Build and push Stellar API Docker image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
id: push
with:
context: packages/ui/api/stellar
file: Dockerfile.prod
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/wizard-stellar-api-prod:latest
${{ env.REGISTRY }}/wizard-stellar-api-prod:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
runs-on: ubuntu-latest
needs: build-and-push
env:
ROLE_FOR_OIDC: 'arn:aws:iam::${{ secrets.ROOT_ACCOUNT_ID }}:role/github-actions-research-account-oidc-role'
ROLE_TO_ASSUME: 'arn:aws:iam::${{ secrets.RESEARCH_ACCOUNT_ID }}:role/GithubOIDCResearchAccountRole'
ECS_CLUSTER: 'wizard-prod-cluster'
ECS_SERVICE: 'wizard-prod-service'
AWS_REGION: 'us-east-1'
permissions:
contents: read
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up AWS credentials via OIDC and role chaining
uses: ./.github/actions/oidc
with:
role-for-oidc: ${{ env.ROLE_FOR_OIDC }}
role-to-assume: ${{ env.ROLE_TO_ASSUME }}

- name: AWS ECS force new deployment
run: |
aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment --region $AWS_REGION
126 changes: 126 additions & 0 deletions .github/workflows/docker-stg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# This workflow runs whenever a release is created.
# The image is tagged with latest and the release version.
name: (Staging) Build and Push Docker Images

on:
push:
branches: [staging]
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from'
required: true
default: 'ci-cd'
type: string

permissions:
contents: read

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: write
attestations: write
security-events: write
env:
REGISTRY: ${{ secrets.RESEARCH_ACCOUNT_ID }}.dkr.ecr.us-east-1.amazonaws.com
ROLE_FOR_OIDC: 'arn:aws:iam::${{ secrets.ROOT_ACCOUNT_ID }}:role/github-actions-research-account-oidc-role'
ROLE_TO_ASSUME: 'arn:aws:iam::${{ secrets.RESEARCH_ACCOUNT_ID }}:role/GithubOIDCResearchAccountRole'
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
with:
platforms: 'arm64'

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2

- name: Set up AWS credentials via OIDC and role chaining
uses: ./.github/actions/oidc
with:
role-for-oidc: ${{ env.ROLE_FOR_OIDC }}
role-to-assume: ${{ env.ROLE_TO_ASSUME }}

- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1

- name: Build Stellar API Docker image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
id: build
with:
context: ./packages/ui/api/stellar
platforms: linux/amd64 # linux/arm64 causes anchore/scan-action to fail
tags: |
${{ env.REGISTRY }}/wizard-stellar-api-stg:latest
${{ env.REGISTRY }}/wizard-stellar-api-stg:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true

- name: Scan Stellar API Docker image
uses: anchore/scan-action@df395807f4554463d4455b8047cf58e37b6acaae # v6.5.0
id: scan
with:
image: ${{ env.REGISTRY }}/wizard-stellar-api-stg:${{ github.sha }}
fail-build: false

- name: Upload Anchore scan SARIF report
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
with:
sarif_file: ${{ steps.scan.outputs.sarif }}

- name: Build and push Stellar API Docker image
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
id: push
with:
context: packages/ui/api/stellar
file: Dockerfile.prod
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY }}/wizard-stellar-api-stg:latest
${{ env.REGISTRY }}/wizard-stellar-api-stg:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
runs-on: ubuntu-latest
needs: build-and-push
env:
ROLE_FOR_OIDC: 'arn:aws:iam::${{ secrets.ROOT_ACCOUNT_ID }}:role/github-actions-research-account-oidc-role'
ROLE_TO_ASSUME: 'arn:aws:iam::${{ secrets.RESEARCH_ACCOUNT_ID }}:role/GithubOIDCResearchAccountRole'
ECS_CLUSTER: 'wizard-stg-cluster'
ECS_SERVICE: 'wizard-stg-service'
AWS_REGION: 'us-east-1'
permissions:
contents: read
id-token: write
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit

- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up AWS credentials via OIDC and role chaining
uses: ./.github/actions/oidc
with:
role-for-oidc: ${{ env.ROLE_FOR_OIDC }}
role-to-assume: ${{ env.ROLE_TO_ASSUME }}

- name: AWS ECS force new deployment
run: |
aws ecs update-service --cluster $ECS_CLUSTER --service $ECS_SERVICE --force-new-deployment --region $AWS_REGION
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ node_modules
.env
.env.local
.vscode/settings.json
.qodo/

# Generated by Cargo
# will have compiled files and executables
debug/
target/
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ build/
public/
remappings.txt
*.cairo
*.sh
*.sh
*.rs
10 changes: 9 additions & 1 deletion .vscode/example.settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,13 @@
"deno.enable": true,
"deno.enablePaths": [
"packages/ui/scripts/deno/"
]
],
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
"rust-analyzer.linkedProjects": [
"packages/ui/stellar/Cargo.toml"
],
"rust-analyzer.check.command": "clippy",
"rust-analyzer.checkOnSave": true
}
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"denoland.vscode-deno"
]
"denoland.vscode-deno",
"rust-lang.rust-analyzer"
],
}
8 changes: 4 additions & 4 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
command = "yarn --cwd packages/ui build"
publish = "packages/ui/public"

edge_functions = "packages/ui/api"
edge_functions = "packages/ui/api/ai/paths"

[functions]
deno_import_map = "packages/ui/import_map.json"
deno_import_map = "packages/ui/api/ai/import_map.json"

[[edge_functions]]
path = "/ai"
function = "ai"
path = "/ai"
function = "ai"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"type:check:api": "yarn --cwd ./packages/ui type:check:api",
"dev:ui": "yarn --cwd ./packages/ui dev",
"dev:api": "yarn --cwd ./packages/ui dev:api",
"dev:api:build": "yarn --cwd ./packages/ui dev:api:build",
"dev": "concurrently --kill-others-on-fail --names \"UI,API\" --prefix-colors \"magenta.bold,green.bold\" \"yarn dev:ui\" \"yarn dev:api\"",
"run:core": "node ./scripts/run-command.mjs",
"version": "bash scripts/release/version.sh",
Expand Down Expand Up @@ -41,4 +42,4 @@
"@changesets/cli": "^2.29.2",
"@changesets/changelog-github": "^0.5.1"
}
}
}
3 changes: 3 additions & 0 deletions packages/core/stellar/src/zip-rust.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ const addRustProjectReadme = (zip: JSZip) => zip.file('README.md', readme);

export const zipRustProject = async (c: Contract, opts: GenericOptions) =>
addRustProjectReadme(createRustZipEnvironment(c, opts));

export const zipRustProjectBlob = async (c: Contract, opts: GenericOptions) =>
await (await zipRustProject(c, opts)).generateAsync({ type: 'blob', compression: 'DEFLATE' });
Loading
Loading