Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TwinStory #78

Merged
merged 177 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
1190f9b
CI: bumps version to v1.2.45-app
gh-action-bump-version Sep 2, 2024
ba4b4eb
Adds studio app
peterpolman Sep 17, 2024
b40823f
Fix build
peterpolman Sep 18, 2024
5dfb353
Fixed qr download flow
peterpolman Sep 18, 2024
71cdba5
Polishes QR code flow
peterpolman Sep 18, 2024
4bc07b1
Adds cd for studio
peterpolman Sep 18, 2024
72b78b4
typo
peterpolman Sep 18, 2024
75c85b2
Change ci workflow name
peterpolman Sep 18, 2024
0654991
Fix env variables
peterpolman Sep 18, 2024
f1b5984
Handle logout properly
peterpolman Sep 18, 2024
0d2de9e
Fix logout and account pages
peterpolman Sep 19, 2024
54039d0
Adds wallet app boilerplate
peterpolman Sep 19, 2024
a4d4563
Adds wallet CICD
peterpolman Sep 19, 2024
38010e9
Adds env variables
peterpolman Sep 19, 2024
5700389
Fix erc721 import test
peterpolman Sep 19, 2024
a764869
Fix branch name in workflow
peterpolman Sep 19, 2024
a0f5f66
Fix CD cache invalidation
peterpolman Sep 19, 2024
5c94bc6
Adds settings page to studio
peterpolman Sep 19, 2024
ac90366
Fix walletconnect auth bug
peterpolman Sep 19, 2024
d527d53
CI: bumps version to v1.2.46-app
gh-action-bump-version Sep 19, 2024
fde6f88
Truncate in afterall
peterpolman Sep 19, 2024
2bf3416
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 19, 2024
cc0c6bb
Merge branch 'develop' into studio
peterpolman Sep 19, 2024
e692c96
CI: bumps version to v1.2.47-app
gh-action-bump-version Sep 19, 2024
fca1d2c
Adds widget migration
peterpolman Sep 19, 2024
6a426d8
CI: bumps version to v1.53.29-api
gh-action-bump-version Sep 19, 2024
f14fdca
Adds widget migration
peterpolman Sep 19, 2024
a5b5ae7
Add profile settings management
peterpolman Sep 20, 2024
ca12ddd
Adds walletconnect flow and wallet management in wallet app
peterpolman Sep 20, 2024
9ba843c
Adds collectible overview page and collect flow
peterpolman Sep 20, 2024
e20f4f2
Adds wallet injection script
peterpolman Sep 23, 2024
8a46f02
Adds search on account ID
peterpolman Sep 23, 2024
492f330
Show account ID in entries UI
peterpolman Sep 23, 2024
fe7d1e3
Add create Safe flow
peterpolman Sep 24, 2024
339b735
update workflows
peterpolman Sep 24, 2024
5ca8202
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 24, 2024
a4644e3
CI: bumps version to v1.2.48-app
gh-action-bump-version Sep 24, 2024
2854d41
CI: bumps version to v1.53.30-api
gh-action-bump-version Sep 24, 2024
31adb69
Adds studio and wallet to cors
peterpolman Sep 24, 2024
9e42196
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 24, 2024
7d3e041
CI: bumps version to v1.2.49-app
gh-action-bump-version Sep 24, 2024
5d5a8b2
Fix mobile nav and add uuid search
peterpolman Sep 24, 2024
3bdd3db
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 24, 2024
2137102
CI: bumps version to v1.2.50-app
gh-action-bump-version Sep 24, 2024
afd318b
Fix migration and qrcode create flow
peterpolman Sep 24, 2024
d7daef4
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 24, 2024
cda2026
CI: bumps version to v1.2.51-app
gh-action-bump-version Sep 24, 2024
cc4d7af
CI: bumps version to v1.53.31-api
gh-action-bump-version Sep 24, 2024
51dab37
Finetuning
peterpolman Sep 24, 2024
5a716c5
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 24, 2024
8cdc1b6
CI: bumps version to v1.2.52-app
gh-action-bump-version Sep 24, 2024
aec0a69
CI: bumps version to v1.53.32-api
gh-action-bump-version Sep 24, 2024
442d578
Small fixes
peterpolman Sep 25, 2024
39a9e3e
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 25, 2024
073be65
CI: bumps version to v1.2.53-app
gh-action-bump-version Sep 25, 2024
622ffd7
Adds wallet management to studio app
peterpolman Sep 25, 2024
cbd8222
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 25, 2024
f47d258
CI: bumps version to v1.2.54-app
gh-action-bump-version Sep 25, 2024
9524c7e
Adds a minter flow
peterpolman Sep 25, 2024
bbf3e6a
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 25, 2024
b66bdf7
CI: bumps version to v1.2.55-app
gh-action-bump-version Sep 25, 2024
f26a720
TEst fix
peterpolman Sep 26, 2024
9ca3eea
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 26, 2024
05f4b45
CI: bumps version to v1.2.56-app
gh-action-bump-version Sep 26, 2024
ddbdd3e
Api test fixes
peterpolman Sep 26, 2024
660f24c
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 26, 2024
e89b9df
Fix wallet deployment check
peterpolman Sep 26, 2024
55edd5d
CI: bumps version to v1.2.57-app
gh-action-bump-version Sep 26, 2024
65efa06
Disable test
peterpolman Sep 26, 2024
8f90f39
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 26, 2024
b3a8bba
CI: bumps version to v1.2.58-app
gh-action-bump-version Sep 26, 2024
7047687
CI: bumps version to v1.53.33-api
gh-action-bump-version Sep 26, 2024
87051c8
Disable web3 quests and create wallets and minters upon nft deployment
peterpolman Sep 26, 2024
1f27d7e
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 26, 2024
f82fd4d
CI: bumps version to v1.2.59-app
gh-action-bump-version Sep 26, 2024
484b430
CI: bumps version to v1.53.34-api
gh-action-bump-version Sep 26, 2024
0f3cf8e
Adds minter assignment
peterpolman Sep 26, 2024
63426ca
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 26, 2024
01cd17b
CI: bumps version to v1.2.60-app
gh-action-bump-version Sep 26, 2024
1a5af7f
CI: bumps version to v1.53.35-api
gh-action-bump-version Sep 26, 2024
629d90d
Improve load for minting
peterpolman Sep 26, 2024
fbad72b
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 26, 2024
1de8c15
CI: bumps version to v1.2.61-app
gh-action-bump-version Sep 26, 2024
650cbf9
No more upserts for erc721 tokens
peterpolman Sep 26, 2024
93c16b0
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 26, 2024
f41d879
CI: bumps version to v1.2.62-app
gh-action-bump-version Sep 26, 2024
8bead76
Fix test
peterpolman Sep 27, 2024
0eb3c18
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 27, 2024
72773e7
CI: bumps version to v1.2.63-app
gh-action-bump-version Sep 27, 2024
ff0dc70
CI: bumps version to v1.53.36-api
gh-action-bump-version Sep 27, 2024
05cd03f
Add transaction management
peterpolman Sep 27, 2024
94b843e
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 27, 2024
8f64f9a
CI: bumps version to v1.2.64-app
gh-action-bump-version Sep 27, 2024
2f00823
CI: bumps version to v1.53.37-api
gh-action-bump-version Sep 27, 2024
7179e2f
Prep prod
peterpolman Sep 27, 2024
bb1ea1c
Adds loading state
peterpolman Sep 27, 2024
b668655
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 27, 2024
7b3798e
CI: bumps version to v1.2.65-app
gh-action-bump-version Sep 27, 2024
08cac58
Fix inject url
peterpolman Sep 27, 2024
198f974
CI: bumps version to v1.2.66-app
gh-action-bump-version Sep 27, 2024
4aec33c
CI: bumps version to v1.53.38-api
gh-action-bump-version Sep 27, 2024
2a00f19
CI: bumps version to v1.53.39-api
gh-action-bump-version Sep 27, 2024
785af06
Find pool safe
peterpolman Sep 27, 2024
0acad0c
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 28, 2024
97e1b63
CI: bumps version to v1.2.67-app
gh-action-bump-version Sep 28, 2024
ea5c3d5
CI: bumps version to v1.53.40-api
gh-action-bump-version Sep 28, 2024
b4ba414
Fix sso signin and auto open wallet if qr code is scanned
peterpolman Sep 28, 2024
564c144
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 28, 2024
1d2c98a
CI: bumps version to v1.2.68-app
gh-action-bump-version Sep 28, 2024
121e7ef
Fix wallet build
peterpolman Sep 28, 2024
6d3cc06
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 28, 2024
52b82d7
CI: bumps version to v1.2.69-app
gh-action-bump-version Sep 28, 2024
92384c4
CI: bumps version to v1.53.41-api
gh-action-bump-version Sep 28, 2024
63766ef
Reorg components
peterpolman Sep 30, 2024
bf847cc
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 30, 2024
f6da1da
CI: bumps version to v1.2.70-app
gh-action-bump-version Sep 30, 2024
8e2f320
CI: bumps version to v1.53.42-api
gh-action-bump-version Sep 30, 2024
8379adf
Imrove wallet reloading
peterpolman Sep 30, 2024
c57ef61
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 30, 2024
0632c62
CI: bumps version to v1.2.71-app
gh-action-bump-version Sep 30, 2024
7ed36da
CI: bumps version to v1.53.43-api
gh-action-bump-version Sep 30, 2024
18e7248
Fix 401 followup
peterpolman Sep 30, 2024
9cc713c
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Sep 30, 2024
664d270
Various small fixes
peterpolman Sep 30, 2024
0b58aaf
CI: bumps version to v1.2.72-app
gh-action-bump-version Sep 30, 2024
7b1ca0a
CI: bumps version to v1.53.44-api
gh-action-bump-version Sep 30, 2024
0b79da3
Fix html title
peterpolman Oct 1, 2024
c431384
Fix link title
peterpolman Oct 1, 2024
efd87d9
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 1, 2024
316f118
Language change, fontfamily in message, favicon
peterpolman Oct 1, 2024
615029b
Change otp language
peterpolman Oct 1, 2024
3c122a0
CI: bumps version to v1.2.73-app
gh-action-bump-version Oct 1, 2024
1f4abd6
CI: bumps version to v1.2.74-app
gh-action-bump-version Oct 1, 2024
23d6d7f
CI: bumps version to v1.53.45-api
gh-action-bump-version Oct 1, 2024
ef5c64c
CI: bumps version to v1.53.46-api
gh-action-bump-version Oct 1, 2024
0d1d666
Adds correct logo instances and home page
peterpolman Oct 3, 2024
5bbeb88
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 3, 2024
b746223
CI: bumps version to v1.2.75-app
gh-action-bump-version Oct 3, 2024
613fe5e
CI: bumps version to v1.53.47-api
gh-action-bump-version Oct 3, 2024
108a610
Remove abbrevation
peterpolman Oct 3, 2024
61f0998
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 3, 2024
f550641
CI: bumps version to v1.2.76-app
gh-action-bump-version Oct 3, 2024
e7fd3b0
CI: bumps version to v1.53.48-api
gh-action-bump-version Oct 3, 2024
e95b22f
Change website label
peterpolman Oct 3, 2024
85dc275
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 3, 2024
721c366
CI: bumps version to v1.2.77-app
gh-action-bump-version Oct 3, 2024
3f24402
CI: bumps version to v1.53.49-api
gh-action-bump-version Oct 3, 2024
9ae7ea9
Rename entries page in studio
peterpolman Oct 3, 2024
892ce60
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 3, 2024
bb62f92
CI: bumps version to v1.2.78-app
gh-action-bump-version Oct 3, 2024
337a74a
Fix website url
peterpolman Oct 7, 2024
d271ba0
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 7, 2024
9c2a225
CI: bumps version to v1.2.79-app
gh-action-bump-version Oct 7, 2024
d33f581
Rename entries page
peterpolman Oct 11, 2024
e5de585
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 11, 2024
899ef59
CI: bumps version to v1.2.80-app
gh-action-bump-version Oct 11, 2024
56ffc69
CI: bumps version to v1.53.50-api
gh-action-bump-version Oct 11, 2024
46e09f9
Fix migration
peterpolman Oct 14, 2024
d1f97a3
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 14, 2024
2351583
CI: bumps version to v1.2.81-app
gh-action-bump-version Oct 14, 2024
570d9cc
CI: bumps version to v1.53.51-api
gh-action-bump-version Oct 14, 2024
24bbdfc
Fix widget script
peterpolman Oct 14, 2024
69b5e5c
Fix download and add minter endpoint
peterpolman Oct 14, 2024
392dc5f
Render styles inline and update minters async
peterpolman Oct 14, 2024
274f81a
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 14, 2024
885954c
CI: bumps version to v1.2.82-app
gh-action-bump-version Oct 14, 2024
0bb9d1a
Async css fetching for wallet script
peterpolman Oct 14, 2024
13740f0
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 14, 2024
77f6cc3
CI: bumps version to v1.2.83-app
gh-action-bump-version Oct 14, 2024
6656b75
CI: bumps version to v1.53.52-api
gh-action-bump-version Oct 14, 2024
776b738
Redirect RDM temporarily
peterpolman Oct 14, 2024
feeb989
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 14, 2024
f0544d3
better appraoch
peterpolman Oct 14, 2024
540a86c
CI: bumps version to v1.2.84-app
gh-action-bump-version Oct 14, 2024
bd49723
CI: bumps version to v1.2.85-app
gh-action-bump-version Oct 14, 2024
55ef15d
Fix qr absolute path
peterpolman Oct 14, 2024
39884e1
Merge branch 'develop' of github.com:thxprotocol/monorepo into develop
peterpolman Oct 14, 2024
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
133 changes: 133 additions & 0 deletions .github/workflows/studio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Studio CI

on:
push:

jobs:
buildAndTest:
name: 'Build & Test'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18'] # Add other versions if needed

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Restore Node.js dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install Node.js dependencies
run: yarn install --frozen-lockfile

- name: Cache Node.js dependencies
uses: actions/cache/save@v3
if: always()
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}

- name: Build Studio
run: yarn nx run studio:build --prod --skip-nx-cache

autodeploy:
name: 'Auto deploy'
runs-on: ubuntu-latest
if: "(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main')"
needs: [buildAndTest]
outputs:
newTag: ${{ steps.version-bump.outputs.newTag }}
steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v3'
with:
ref: ${{ github.ref }}

- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-3

- name: Restore Node.js dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-

- name: Set environment based on branch
run: |
if [[ $GITHUB_REF == 'refs/heads/develop' ]]; then
echo "S3_URL=s3://dev-studio.thx.network" >> $GITHUB_ENV
echo "DISTRIBUTION=${{ secrets.CLOUDFRONT_DISTRIBUTION_STUDIO_DEV }}" >> $GITHUB_ENV
echo "BUILD_MODE=dev" >> $GITHUB_ENV
elif [[ $GITHUB_REF == 'refs/heads/main' ]]; then
echo "S3_URL=s3://studio.thx.network" >> $GITHUB_ENV
echo "DISTRIBUTION=${{ secrets.CLOUDFRONT_DISTRIBUTION_STUDIO_PROD }}" >> $GITHUB_ENV
echo "BUILD_MODE=prod" >> $GITHUB_ENV
fi

- name: Build Studio
run: NODE_ENV='production' yarn nx run studio:build --configuration=production --mode $BUILD_MODE --skip-nx-cache

- name: Deploy
run: aws s3 sync ./dist/apps/studio $S3_URL --delete

- name: Invalidate CloudFront cache
run: aws cloudfront create-invalidation --distribution-id $DISTRIBUTION --paths "/*"

discord:
name: Update Discord
runs-on: ubuntu-latest
needs: [autodeploy]
steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v3'
with:
ref: ${{ github.ref }}

- name: Set DISCORD_WEBHOOK based on branch
run: |
if [[ $GITHUB_REF == 'refs/heads/develop' ]]; then
echo "DISCORD_WEBHOOK=${{ secrets.DISCORD_WEBHOOK_DEV }}" >> $GITHUB_ENV
elif [[ $GITHUB_REF == 'refs/heads/main' ]]; then
echo "DISCORD_WEBHOOK=${{ secrets.DISCORD_WEBHOOK_PROD }}" >> $GITHUB_ENV
fi

- name: Get version
run: echo "VERSION=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Send message
env:
DISCORD_WEBHOOK: ${{ env.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "${{ needs.autodeploy.result == 'success' && '✅' || '⛔' }} Released Studio `v${{ env.VERSION }}-app`"
133 changes: 133 additions & 0 deletions .github/workflows/wallet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Wallet CI

on:
push:

jobs:
buildAndTest:
name: 'Build & Test'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18'] # Add other versions if needed

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Restore Node.js dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-

- name: Install Node.js dependencies
run: yarn install --frozen-lockfile

- name: Cache Node.js dependencies
uses: actions/cache/save@v3
if: always()
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}

- name: Build Wallet
run: yarn nx run wallet:build --prod --skip-nx-cache

autodeploy:
name: 'Auto deploy'
runs-on: ubuntu-latest
if: "(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main')"
needs: [buildAndTest]
outputs:
newTag: ${{ steps.version-bump.outputs.newTag }}
steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v3'
with:
ref: ${{ github.ref }}

- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-3

- name: Restore Node.js dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-

- name: Set environment based on branch
run: |
if [[ $GITHUB_REF == 'refs/heads/develop' ]]; then
echo "S3_URL=s3://dev-wallet.thx.network" >> $GITHUB_ENV
echo "DISTRIBUTION=${{ secrets.CLOUDFRONT_DISTRIBUTION_WALLET_DEV }}" >> $GITHUB_ENV
echo "BUILD_MODE=dev" >> $GITHUB_ENV
elif [[ $GITHUB_REF == 'refs/heads/main' ]]; then
echo "S3_URL=s3://wallet.thx.network" >> $GITHUB_ENV
echo "DISTRIBUTION=${{ secrets.CLOUDFRONT_DISTRIBUTION_WALLET_PROD }}" >> $GITHUB_ENV
echo "BUILD_MODE=prod" >> $GITHUB_ENV
fi

- name: Build Wallet
run: NODE_ENV='production' yarn nx run wallet:build --configuration=production --mode $BUILD_MODE --skip-nx-cache

- name: Deploy
run: aws s3 sync ./dist/apps/wallet $S3_URL --delete

- name: Invalidate CloudFront cache
run: aws cloudfront create-invalidation --distribution-id $DISTRIBUTION --paths "/*"

discord:
name: Update Discord
runs-on: ubuntu-latest
needs: [autodeploy]
steps:
- name: 'Checkout source code'
uses: 'actions/checkout@v3'
with:
ref: ${{ github.ref }}

- name: Set DISCORD_WEBHOOK based on branch
run: |
if [[ $GITHUB_REF == 'refs/heads/develop' ]]; then
echo "DISCORD_WEBHOOK=${{ secrets.DISCORD_WEBHOOK_DEV }}" >> $GITHUB_ENV
elif [[ $GITHUB_REF == 'refs/heads/main' ]]; then
echo "DISCORD_WEBHOOK=${{ secrets.DISCORD_WEBHOOK_PROD }}" >> $GITHUB_ENV
fi

- name: Get version
run: echo "VERSION=$(git rev-parse HEAD)" >> $GITHUB_ENV

- name: Send message
env:
DISCORD_WEBHOOK: ${{ env.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: "${{ needs.autodeploy.result == 'success' && '✅' || '⛔' }} Released Wallet `v${{ env.VERSION }}-app`"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ Thumbs.db
!.env.example
!apps/app/.env.prod
!apps/app/.env.dev
!apps/studio/.env.prod
!apps/studio/.env.dev
!apps/wallet/.env.prod
!apps/wallet/.env.dev

certs/*

Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"jochemvn <[email protected]>"
],
"license": "AGPL-3.0",
"version": "1.53.28",
"version": "1.53.52",
"scripts": {
"migrate": "yarn run migrate:db && yarn run migrate:post-migrate",
"migrate:post-migrate": "node post-migrate.js",
Expand Down
4 changes: 2 additions & 2 deletions apps/api/scripts/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import db from '@thxnetwork/api/util/database';
// import main from './src/preview';
// import main from './src/metamask';
// import main from './src/lottery';
import main from './src/web3';
// import main from './src/safe';
// import main from './src/web3';
import main from './src/safe';

db.connect(process.env.MONGODB_URI_PROD);

Expand Down
38 changes: 38 additions & 0 deletions apps/api/scripts/src/qr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { QRCodeEntry, RewardNFT } from '@thxnetwork/api/models';
import PoolService from '@thxnetwork/api/services/PoolService';
import { PromiseParser } from '@thxnetwork/api/util';

export default async function main() {
const chunkSize = 1000;

let skip = 0;
let entries = [];
console.log('start while', entries.length);
while (true) {
entries = await QRCodeEntry.find().skip(skip).limit(chunkSize).exec();
if (!entries.length) break;

const operations = await PromiseParser.parse(
entries.map(async (entry) => {
const reward = await RewardNFT.findById(entry.rewardId);
const pool = await PoolService.getById(reward.poolId);
const owner = await PoolService.findOwner(pool);
return {
updateOne: {
filter: { _id: entry._id },
update: {
$set: {
accountId: owner._id,
},
},
},
};
}),
);

console.log(operations.length);
await QRCodeEntry.bulkWrite(operations);

skip += chunkSize;
}
}
37 changes: 25 additions & 12 deletions apps/api/scripts/src/safe.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import { RewardCoin, Wallet } from '@thxnetwork/api/models';
import RewardCoinService from '@thxnetwork/api/services/RewardCoinService';
import { Wallet } from '@thxnetwork/api/models';
import SafeService from '@thxnetwork/api/services/SafeService';
import { PromiseParser } from '@thxnetwork/api/util';
import { WalletVariant } from '@thxnetwork/common/enums';

export default async function main() {
// const reward = await RewardCoin.findById('669126e1110e00291909e0e3'); // Polygon Reward
// const reward = await RewardCoin.findById('66952d939a90f7280b2d3164'); // Linea Reward
const reward = await RewardCoin.findById('6698033a03bf2db6c9a940f1'); // Linea Reward
const wallet = await Wallet.findById('669805738c683b6c4c506e97');
const service = new RewardCoinService();

await service.createPayment({
reward,
wallet,
});
const query = {
variant: WalletVariant.Safe,
owners: { $exists: false },
poolId: { $exists: true },
};
const walletsCount = await Wallet.countDocuments(query);
console.log(`Updating ${walletsCount} wallets...`);

const wallet = await Wallet.find(query);
const chunkSize = 25;

for (let i = 0; i < wallet.length; i += chunkSize) {
await PromiseParser.parse(
wallet.slice(i, i + chunkSize).map(async (w) => {
const safe = await SafeService.getSafe(w);
const owners = await safe.getOwners();

await w.updateOne({ owners });
}),
);
}
}
1 change: 1 addition & 0 deletions apps/api/src/app/config/secrets.ts
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const WALLET_URL = process.env.WALLET_URL || '';
export const DASHBOARD_URL = process.env.DASHBOARD_URL || '';
export const WIDGET_URL = process.env.WIDGET_URL || '';
export const PUBLIC_URL = process.env.PUBLIC_URL || '';
export const STUDIO_URL = process.env.STUDIO_URL || '';

export const HARDHAT_RPC = process.env.HARDHAT_RPC || '';
export const POLYGON_RPC = process.env.POLYGON_RPC || 'https://rpc.ankr.com/polygon';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import WalletService from '@thxnetwork/api/services/WalletService';
import { Request, Response } from 'express';
import { query } from 'express-validator';
import WalletService from '@thxnetwork/api/services/WalletService';

const validation = [query('chainId').optional().isNumeric()];

Expand Down
Loading
Loading