Skip to content
Merged
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
17 changes: 11 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
PORT=3000

CONFIG_APP_URL=https://app.deuro.com
CONFIG_INDEXER_URL=https://ponder.deuro.com
CONFIG_INDEXER_FALLBACK_URL=https://dev.ponder.deuro.com
CONFIG_CHAIN=mainnet
CONFIG_APP_URL=https://dev.app.testnet.juicedollar.com
CONFIG_INDEXER_URL=https://dev.ponder.testnet.juicedollar.com/
CONFIG_INDEXER_FALLBACK_URL=https://dev.ponder.testnet.juicedollar.com/
CONFIG_CHAIN=testnet

RPC_URL_MAINNET=https://eth-mainnet.g.alchemy.com/v2/[API-KEY]
RPC_URL_POLYGON=https://polygon-mainnet.g.alchemy.com/v2/[API-KEY]
RPC_URL_MAINNET=https://rpc.testnet.juiceswap.com/

COINGECKO_API_KEY=[API-KEY]

TELEGRAM_BOT_TOKEN=[API-KEY]
TELEGRAM_GROUPS_JSON=telegram.groups.json
TELEGRAM_IMAGES_DIR=./images

TWITTER_CLIENT_APP_KEY=
TWITTER_CLIENT_APP_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_SECRET=
TWITTER_IMAGES_DIR=
98 changes: 49 additions & 49 deletions .github/workflows/api-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: dEURO API DEV CI/CD
name: JuiceDollar API DEV CI/CD

on:
push:
branches: [develop]
workflow_dispatch:
push:
branches: [develop]
workflow_dispatch:

env:
DOCKER_TAGS: dfxswiss/deuro-api:beta
AZURE_RESOURCE_GROUP: rg-dfx-api-dev
AZURE_CONTAINER_APP: ca-dfx-dea-dev
DEPLOY_INFO: ${{ github.ref_name }}-${{ github.sha }}
DOCKER_TAGS: dfxswiss/juicedollar-api:beta
AZURE_RESOURCE_GROUP: rg-dfx-api-dev
AZURE_CONTAINER_APP: ca-dfx-jdta-dev
DEPLOY_INFO: ${{ github.ref_name }}-${{ github.sha }}

jobs:
build-and-deploy:
name: Build, test and deploy to DEV
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.DOCKER_TAGS }}

- name: Log in to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.DFX_DEV_CREDENTIALS }}

- name: Update Azure Container App
uses: azure/CLI@v2
with:
inlineScript: |
az containerapp update --resource-group ${{ env.AZURE_RESOURCE_GROUP }} --name ${{ env.AZURE_CONTAINER_APP }} --image ${{ env.DOCKER_TAGS }} --set-env-vars DEPLOY_INFO=${{ env.DEPLOY_INFO }}

- name: Logout from Azure
run: |
az logout
if: always()
build-and-deploy:
name: Build, test and deploy to DEV
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.DOCKER_TAGS }}

- name: Log in to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.DFX_DEV_CREDENTIALS }}

- name: Update Azure Container App
uses: azure/CLI@v2
with:
inlineScript: |
az containerapp update --resource-group ${{ env.AZURE_RESOURCE_GROUP }} --name ${{ env.AZURE_CONTAINER_APP }} --image ${{ env.DOCKER_TAGS }} --set-env-vars DEPLOY_INFO=${{ env.DEPLOY_INFO }}

- name: Logout from Azure
run: |
az logout
if: always()
98 changes: 49 additions & 49 deletions .github/workflows/api-prd.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: dEURO API PRD CI/CD
name: JuiceDollar API PRD CI/CD

on:
push:
branches: [main]
workflow_dispatch:
push:
branches: [main]
workflow_dispatch:

env:
DOCKER_TAGS: dfxswiss/deuro-api:latest
AZURE_RESOURCE_GROUP: rg-dfx-api-prd
AZURE_CONTAINER_APP: ca-dfx-dea-prd
DEPLOY_INFO: ${{ github.ref_name }}-${{ github.sha }}
DOCKER_TAGS: dfxswiss/juicedollar-api:latest
AZURE_RESOURCE_GROUP: rg-dfx-api-prd
AZURE_CONTAINER_APP: ca-dfx-jdta-prd
DEPLOY_INFO: ${{ github.ref_name }}-${{ github.sha }}

jobs:
build-and-deploy:
name: Build, test and deploy to PRD
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.DOCKER_TAGS }}

- name: Log in to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.DFX_PRD_CREDENTIALS }}

- name: Update Azure Container App
uses: azure/CLI@v2
with:
inlineScript: |
az containerapp update --resource-group ${{ env.AZURE_RESOURCE_GROUP }} --name ${{ env.AZURE_CONTAINER_APP }} --image ${{ env.DOCKER_TAGS }} --set-env-vars DEPLOY_INFO=${{ env.DEPLOY_INFO }}

- name: Logout from Azure
run: |
az logout
if: always()
build-and-deploy:
name: Build, test and deploy to PRD
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

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

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.DOCKER_TAGS }}

- name: Log in to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.DFX_PRD_CREDENTIALS }}

- name: Update Azure Container App
uses: azure/CLI@v2
with:
inlineScript: |
az containerapp update --resource-group ${{ env.AZURE_RESOURCE_GROUP }} --name ${{ env.AZURE_CONTAINER_APP }} --image ${{ env.DOCKER_TAGS }} --set-env-vars DEPLOY_INFO=${{ env.DEPLOY_INFO }}

- name: Logout from Azure
run: |
az logout
if: always()
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@deuro:registry=https://registry.npmjs.org
@juicedollar:registry=https://registry.npmjs.org
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ MIT License
Copyright (c) 2024 frankencoin
Copyright (c) 2024 samclassix
Copyright (c) 2024 deuro
Copyright (c) 2025 juicedollar

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ $ yarn install
```
PORT=3000

CONFIG_APP_URL=https://app.deuro.com
CONFIG_INDEXER_URL=https://ponder.deuro.com
CONFIG_APP_URL=https://app.juicedollar.com
CONFIG_INDEXER_URL=https://ponder.juicedollar.com
CONFIG_CHAIN=mainnet

RPC_URL_MAINNET=https://eth-mainnet.g.alchemy.com/v2/[API-KEY]
Expand Down Expand Up @@ -43,6 +43,24 @@ $ yarn run start:prod
$ npm publish --access public
```

## Publishing Types Package

This repository exports TypeScript type definitions that can be published to npm for use in other projects.

### Building and Publishing

1. **Build the project** (generates type definitions in `dist/`):

```bash
$ yarn build
```

2. **Publish to npm**:

```bash
$ npm publish --access public
```

## License

Nest is [MIT licensed](LICENSE).
Expand Down
11 changes: 6 additions & 5 deletions analytics/analytics.controller.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import { Controller, Get } from '@nestjs/common';
import { ApiResponse, ApiTags } from '@nestjs/swagger';
import { POOL_SHARES_SYMBOL } from 'api.config';
import { AnalyticsService } from './analytics.service';

@ApiTags('Analytics Controller')
@Controller('analytics')
export class AnalyticsController {
constructor(private readonly analytics: AnalyticsService) {}

@Get('deps/exposure')
@Get('poolshares/exposure')
@ApiResponse({
description: 'Returns info about the exposures within the DEPS token',
description: `Returns info about the exposures within the ${POOL_SHARES_SYMBOL} token`,
})
getExposure() {
return this.analytics.getCollateralExposure();
}

@Get('deps/earnings')
@Get('poolshares/earnings')
@ApiResponse({
description: 'Returns earnings from the DEPS token',
description: `Returns earnings from the ${POOL_SHARES_SYMBOL} token`,
})
getEarnings() {
return this.analytics.getDepsEarnings();
return this.analytics.getPoolSharesEarnings();
}
}
Loading