Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser committed Sep 12, 2023
2 parents 8995946 + ced2ca2 commit e705612
Show file tree
Hide file tree
Showing 17 changed files with 98 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/actions/prepare-deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ runs:
echo "function_name=${{ inputs.app_base_name }}-demo" >> $GITHUB_OUTPUT
echo "front_url=${{ inputs.app_base_name }}-demo.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=demo" >> $GITHUB_OUTPUT
elif ${{ contains(inputs.deploy_to, 'moonbeam-alpha') }}; then
# moonbeam-alpha
echo "function_name=${{ inputs.app_base_name }}-moonbeam-alpha" >> $GITHUB_OUTPUT
echo "front_url=${{ inputs.app_base_name }}-moonbeam-alpha.k-f.dev" >> $GITHUB_OUTPUT
echo "env_name=moonbeam-alpha" >> $GITHUB_OUTPUT
elif ${{ github.ref == 'refs/heads/main' }}; then
# DEV
echo "function_name=${{ inputs.app_base_name }}-dev" >> $GITHUB_OUTPUT
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/moonbeam-alpha-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Moonbeam dev (alpha) deployments (manual)"
on:
push:
branches: main
pull_request:
paths:
- '.github/workflows/moonbeam-alpha-deploy.yml'

jobs:
app-moonbeam-alpha:
uses: ./.github/workflows/centrifuge-app.yml
secrets: inherit
with:
deploy_env: moonbeam-alpha


pinning-moonbeam-alpha:
uses: ./.github/workflows/pinning-api.yml
secrets: inherit
with:
deploy_env: moonbeam-alpha


onboarding-moonbeam-alpha:
uses: ./.github/workflows/onboarding-api.yml
secrets: inherit
with:
deploy_env: moonbeam-alpha

# faucet-moonbeam-alpha:
# uses: ./.github/workflows/faucet-api.yml
# secrets: inherit
# with:
# deploy_env: moonbeam-alpha
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ yarn-error.log
!.env.demo
!.env.catalyst
!.env.production
!.env.moonbeam-alpha
2 changes: 1 addition & 1 deletion centrifuge-app/.env-config/.env.altair
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ REACT_APP_COLLATOR_WSS_URL=wss://fullnode.altair.centrifuge.io
REACT_APP_DEFAULT_NODE_URL=
REACT_APP_DEFAULT_UNLIST_POOLS=false
REACT_APP_FAUCET_URL=''
REACT_APP_IPFS_GATEWAY=https://altair.mypinata.cloud/
REACT_APP_IPFS_GATEWAY=https://centrifuge.mypinata.cloud/
REACT_APP_IS_DEMO=false
REACT_APP_NETWORK=altair
REACT_APP_ONBOARDING_API_URL=https://europe-central2-centrifuge-production-x.cloudfunctions.net/onboarding-api-altair
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/.env-config/.env.catalyst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ REACT_APP_COLLATOR_WSS_URL=wss://fullnode.catalyst.cntrfg.com
REACT_APP_DEFAULT_NODE_URL=
REACT_APP_DEFAULT_UNLIST_POOLS=true
REACT_APP_FAUCET_URL=
REACT_APP_IPFS_GATEWAY=https://altair.mypinata.cloud/
REACT_APP_IPFS_GATEWAY=https://centrifuge.mypinata.cloud/
REACT_APP_IS_DEMO=false
REACT_APP_NETWORK=centrifuge
REACT_APP_ONBOARDING_API_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/onboarding-api-catalyst
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/.env-config/.env.demo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ REACT_APP_COLLATOR_WSS_URL=wss://fullnode.algol.cntrfg.com/public-ws
REACT_APP_DEFAULT_NODE_URL=https://pod.algol.k-f.dev
REACT_APP_DEFAULT_UNLIST_POOLS=true
REACT_APP_FAUCET_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/faucet-api-demo
REACT_APP_IPFS_GATEWAY=https://altair.mypinata.cloud/
REACT_APP_IPFS_GATEWAY=https://centrifuge.mypinata.cloud/
REACT_APP_IS_DEMO=true
REACT_APP_ONBOARDING_API_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/onboarding-api-demo
REACT_APP_PINNING_API_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/pinning-api-demo
Expand Down
4 changes: 2 additions & 2 deletions centrifuge-app/.env-config/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ REACT_APP_COLLATOR_WSS_URL=wss://fullnode.development.cntrfg.com
REACT_APP_DEFAULT_NODE_URL=https://pod-development.k-f.dev
REACT_APP_DEFAULT_UNLIST_POOLS=false
REACT_APP_FAUCET_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/faucet-api-dev
REACT_APP_IPFS_GATEWAY=https://altair.mypinata.cloud/
REACT_APP_IPFS_GATEWAY=https://centrifuge.mypinata.cloud/
REACT_APP_IS_DEMO=false
REACT_APP_NETWORK=centrifuge
REACT_APP_ONBOARDING_API_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/onboarding-api-dev
Expand All @@ -17,4 +17,4 @@ REACT_APP_WHITELISTED_ACCOUNTS=
REACT_APP_TINLAKE_SUBGRAPH_URL=https://graph.centrifuge.io/tinlake
REACT_APP_REWARDS_TREE_URL=https://storage.googleapis.com/rad-rewards-trees-kovan-staging/latest.json
REACT_APP_WALLETCONNECT_ID=c32fa79350803519804a67fcab0b742a
REACT_APP_MEMBERLIST_ADMIN_PURE_PROXY=kAKfp33p1SHRq6d1BMtGndP7Cek6pH6oZKKUoA7wJXRUqf6FY
REACT_APP_MEMBERLIST_ADMIN_PURE_PROXY=kAJ27w29x7gHM75xajP2yXVLjVBaKmmUTxHwgRuCoAcWaoEiz
2 changes: 1 addition & 1 deletion centrifuge-app/.env-config/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ REACT_APP_COLLATOR_WSS_URL=wss://fullnode.development.cntrfg.com
REACT_APP_DEFAULT_NODE_URL=https://pod.development.cntrfg.com
REACT_APP_DEFAULT_UNLIST_POOLS=
REACT_APP_FAUCET_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/faucetDev
REACT_APP_IPFS_GATEWAY=https://altair.mypinata.cloud/
REACT_APP_IPFS_GATEWAY=https://centrifuge.mypinata.cloud/
REACT_APP_IS_DEMO=false
REACT_APP_NETWORK=altair
REACT_APP_ONBOARDING_API_URL=https://europe-central2-centrifuge-fargate-apps-dev.cloudfunctions.net/onboarding
Expand Down
20 changes: 20 additions & 0 deletions centrifuge-app/.env-config/.env.moonbeam-alpha
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
REACT_APP_COLLATOR_WSS_URL=wss://fullnode.moonbase-dev.cntrfg.com/public-ws
REACT_APP_DEFAULT_NODE_URL=https://pod.moonbeam-alpha.k-f.dev
REACT_APP_DEFAULT_UNLIST_POOLS=true
REACT_APP_FAUCET_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/faucet-api-moonbean-alpha
REACT_APP_IPFS_GATEWAY=https://centrifuge.mypinata.cloud/
REACT_APP_IS_DEMO=true
REACT_APP_ONBOARDING_API_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/onboarding-api-moonbean-alpha
REACT_APP_PINNING_API_URL=https://europe-central2-peak-vista-185616.cloudfunctions.net/pinning-api-moonbean-alpha
REACT_APP_POOL_CREATION_TYPE=immediate
REACT_APP_RELAY_WSS_URL=wss://frag-moonbase-relay-rpc-ws.g.moonbase.moonbeam.network
REACT_APP_SUBQUERY_URL=https://api.subquery.network/sq/centrifuge/pools-demo
REACT_APP_SUBSCAN_URL=
REACT_APP_TINLAKE_NETWORK=goerli
REACT_APP_INFURA_KEY=bf808e7d3d924fbeb74672d9341d0550
REACT_APP_WHITELISTED_ACCOUNTS=
REACT_APP_NETWORK=centrifuge
REACT_APP_REWARDS_TREE_URL=https://storage.googleapis.com/rad-rewards-trees-kovan-staging/latest.json
REACT_APP_MEMBERLIST_ADMIN_PURE_PROXY=kALwmJutBq95s41U9fWnoApCUgvPqPGTh1GSmFnQh5f9fWo93
REACT_APP_WALLETCONNECT_ID=c32fa79350803519804a67fcab0b742a
REACT_APP_TINLAKE_SUBGRAPH_URL=https://graph.centrifuge.io/tinlake
9 changes: 6 additions & 3 deletions centrifuge-app/src/utils/formatting.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import { CurrencyBalance, CurrencyMetadata, Perquintill, Price, TokenBalance } from '@centrifuge/centrifuge-js'
import { CurrencyBalance, CurrencyMetadata, Perquintill, Price, Rate, TokenBalance } from '@centrifuge/centrifuge-js'
import Decimal from 'decimal.js-light'

export function formatBalance(
amount: CurrencyBalance | TokenBalance | Price | Decimal | number,
amount: CurrencyBalance | TokenBalance | Price | Rate | Decimal | number,
currency?: string | CurrencyMetadata,
precision = 0,
minPrecision = precision
) {
const formattedAmount = (
amount instanceof TokenBalance || amount instanceof CurrencyBalance || amount instanceof Price
amount instanceof TokenBalance ||
amount instanceof CurrencyBalance ||
amount instanceof Price ||
amount instanceof Rate
? amount.toFloat()
: amount instanceof Decimal
? amount.toNumber()
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-app/src/utils/tinlake/useTinlakePools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ async function getPools(pools: IpfsPools): Promise<{ pools: TinlakePool[] }> {
const toCurrencyBalance = (val: BigNumber) => new CurrencyBalance(val.toString(), 18)
const toTokenBalance = (val: BigNumber) => new TokenBalance(val.toString(), 18)
const toRate = (val: BigNumber) => new Rate(val.toString())
const toPrice = (val: BigNumber) => new Price(val.toString())
const toPrice = (val: BigNumber) => new Rate(val.toString())

const calls: Call[] = []
pools.active.forEach((pool) => {
Expand Down
9 changes: 7 additions & 2 deletions centrifuge-js/src/modules/pools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { CurrencyBalance, Perquintill, Price, Rate, TokenBalance } from '../util
import { Dec } from '../utils/Decimal'

const PerquintillBN = new BN(10).pow(new BN(18))
const PriceBN = new BN(10).pow(new BN(27))
const PriceBN = new BN(10).pow(new BN(18))
const MaxU128 = '340282366920938463463374607431768211455'
const SEC_PER_DAY = 24 * 60 * 60

Expand Down Expand Up @@ -744,7 +744,8 @@ export function getPoolsModule(inst: Centrifuge) {
trancheInput,
currency,
maxReserve.toString(),
pinnedMetadata.ipfsHash
pinnedMetadata.ipfsHash,
[]
)
if (options?.createType === 'propose') {
const proposalTx = api.tx.utility.batchAll([
Expand Down Expand Up @@ -1218,6 +1219,10 @@ export function getPoolsModule(inst: Centrifuge) {
})
return Array.isArray(maybeArray)
? permissionsByAddressIndex
: permissionsByAddressIndex[0] ?? {
pools: {},
currencies: {},
}
})
)
})
Expand Down
2 changes: 1 addition & 1 deletion centrifuge-js/src/utils/BN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class TokenBalance extends CurrencyBalance {
}

export class Price extends BNSubType {
static decimals = 27
static decimals = 18
static fromFloat(number: Numeric) {
return Price._fromFloat<Price>(number)
}
Expand Down
2 changes: 1 addition & 1 deletion onboarding-api/env-vars/development.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
REDIRECT_URL=https://app-dev.k-f.dev
MEMBERLIST_ADMIN_PURE_PROXY=kAKfp33p1SHRq6d1BMtGndP7Cek6pH6oZKKUoA7wJXRUqf6FY
MEMBERLIST_ADMIN_PURE_PROXY=kAJ27w29x7gHM75xajP2yXVLjVBaKmmUTxHwgRuCoAcWaoEiz
COLLATOR_WSS_URL=wss://fullnode.development.cntrfg.com
RELAY_WSS_URL=wss://fullnode-relay.development.cntrfg.com
INFURA_KEY=bf808e7d3d924fbeb74672d9341d0550
Expand Down
7 changes: 7 additions & 0 deletions onboarding-api/env-vars/moonbeam-alpha.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REDIRECT_URL=https://app-moonbase.k-f.dev
MEMBERLIST_ADMIN_PURE_PROXY=kAM1ELFDHdHeLDAkAdwEnfufoCL5hpUycGs4ZQkSQKVpHFoXm
COLLATOR_WSS_URL=wss://fullnode.moonbase-dev.cntrfg.com/public-ws
RELAY_WSS_URL=wss://frag-moonbase-relay-rpc-ws.g.moonbase.moonbeam.network
INFURA_KEY=bf808e7d3d924fbeb74672d9341d0550
EVM_NETWORK=goerli
ONBOARDING_STORAGE_BUCKET=centrifuge-onboarding-api-dev
7 changes: 7 additions & 0 deletions onboarding-api/env-vars/moonbeam-alpha.secrets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SHUFTI_PRO_SECRET_KEY=projects/peak-vista-185616/secrets/SHUFTI_PRO_SECRET_KEY
SHUFTI_PRO_CLIENT_ID=projects/peak-vista-185616/secrets/SHUFTI_PRO_CLIENT_ID
JWT_SECRET=projects/peak-vista-185616/secrets/JWT_SECRET
SENDGRID_API_KEY=projects/peak-vista-185616/secrets/SENDGRID_API_KEY
COOKIE_SECRET=projects/peak-vista-185616/secrets/COOKIE_SECRET
PURE_PROXY_CONTROLLER_SEED=projects/peak-vista-185616/secrets/PURE_PROXY_CONTROLLER_SEED
EVM_MEMBERLIST_ADMIN_PRIVATE_KEY=projects/peak-vista-185616/secrets/EVM_MEMBERLIST_ADMIN_PRIVATE_KEY
2 changes: 2 additions & 0 deletions pinning-api/env-vars/moonbeam-alpha.secrets
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PINATA_API_KEY=projects/peak-vista-185616/secrets/PINATA_API_KEY
PINATA_SECRET_API_KEY=projects/peak-vista-185616/secrets/PINATA_SECRET_API_KEY

0 comments on commit e705612

Please sign in to comment.